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

后端 未结 1 1153
挽巷
挽巷 2021-01-27 03:28

I am using open layers 3, and I am using this code for displaying the map:

wmsSource = new ol.source.TileWMS({
           url: \'http://demo.boundlessgeo.com/ge         


        
相关标签:
1条回答
  • 2021-01-27 03:58

    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.

    0 讨论(0)
提交回复
热议问题