I am new to OpenLayers as I just today tried porting over my map from Leaflet to OL since hitTolerance
is exactly what I was looking for. Also, I understand v5 is quite new, so the docs are not completely updated in my experience.
I can't seem to get hitTolerance
to work with WMS layers.
I understand that since v5 you can now specify hitTolerance
in forEachLayerAtPixel
, but I still have to hit the layer pretty accurately for it to be picked up by forEachLayerAtPixel
.
I also tried forEachFeatureAtPixel
, but that gave me nothing, ever. Does WMS layers have features?
I have tried both with TileLayer/TileWMS
and ImageLayer/ImageWMS
. Both behave the same. Using forEachLayerAtPixel
even with a hitTolerance
of 100
I still have to be very precise to hit the layer.
Am I doing something wrong? I don't know if this is a bug, or if hitTolerance
simply doesn't work with WMS layers. Any help would be appreciated. Thanks.