Selecting map objects using ol.source.TileWMS in open layers 3

可紊 提交于 2019-12-02 04:38:22

You use a TileWMS source, which is a collection of images (tiles) rendered on the WMS server. OpenLayers does not know about the features used to render the images. Because of this, forEachFeatureIntersectingExtent is only available on vector sources.

You could create a WMS getFeatureInfo-request in the boxend callback, to load the feature information from the server.

Alternatively, you could create a vector source containing the features you want and use for the forEachFeatureIntersectingExtent call.

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