Skip to content Skip to sidebar Skip to footer

Openlayers 4 Getgetfeatureinfourl And Hittollerance

I'm using this piece of code map.on('singleclick', function(evt) { ... url = pmfeatlayer.getSource().getGetFeatureInfoUrl(coordinate, viewResolution, projection, {'INFO_FORMAT': '

Solution 1:

The example you're looking at is slightly different because it is using a vector layer, where all the geometries are already added to the map. Because you're making a getFeatureInfoRequest you can't apply a hit tolerance in OpenLayers. Instead you can try adding a buffer param in the getFeatureInfoUrl function, as {'INFO_FORMAT': 'text/html', 'BUFFER': 5}. This requests that the map server include any geometries within this buffer area in its response. If that doesn't work you could try adding a maxFeatures param, indicating the maximum amount of feature's you'd want to get back from the map server, as it may be that the server is defaulting to only giving one feature back.

Solution 2:

At the end I make it works with FEATURE_COUNT:10,buffer doesn't work.

Checking the Request WMS URL I found FEATURE_COUNT:10, in another version of the project with others type of data, a parameter that is not present in the old code, I'm still unable to understand how OL2 has inserted this parameter in the URL

Post a Comment for "Openlayers 4 Getgetfeatureinfourl And Hittollerance"