Hi,
I have an OpenLayers.Map() object on which I'd like to register a click event. For that, I do the following:
The problem is the following error:Code:// This function has to be declared outside map.events.on() in order to be able to unregister the map click. var mafnc = function(e){...}; // Map click event registration map.events.on({ click : mafnc }); // Map click event unregistration map.events.un({ click : mafnc });
If I use, instead, the following code, I get no error. The inconvenient is that unregistration of the map click becomes impossible (?):Code:TypeError: d.func.apply is not a function
Do you have any hint about how to use the first code snippet without getting the error?Code:map.events.on({ click : function(e){...} });
Best regards.


Reply With Quote
Bookmarks