How do I activate a feature + popup when clicking outside of a map in Openlayers?

烈酒焚心 提交于 2019-12-04 05:26:21

I think you should remove the "selected.clickFeature" call, and instead create an event listener for the "featureselected" event in your feature layer:

OpenLayers.Layer.Vector

If you display the popup in that event, you will only have to find it and select it with your existing code, and remove the line selected.clickFeature();

Sidenote: Can your feature server deliver data in other formats? WFS for instance? Parsing KML data shouldn't be needed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!