[OpenLayers-Users] clicked on the map, but not a feature?

Eric Lemoine eric.lemoine at camptocamp.com
Tue May 24 00:40:51 EDT 2011


On Friday, May 20, 2011, ulao <S_K_U_N_X at yahoo.com> wrote:
> How can I tell once I clicked on a map ( layer ) but only if there is no
> shape/arker under my mouse. I see the .click handler passed evt, but no info
> about objects.

You can call getFeatureFromEvent on the vector layer:

var f = vectorLayer.getFeatureFromEvent(evt); // f is null if there's
no feature under the mouse

But note that this methode isn't part of the API, it is private to OpenLayers.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Users mailing list