[OpenLayers-Users] Simple coordinate displaying with layer listener and activation/deactivation

floebig frederick.loebig at live.de
Wed Apr 30 06:17:09 PDT 2014


Hey all,
I have two questions. The first one:


I have a map with several layers, and a listener on one of those layers:

			layerListeners2 = {
				nofeatureclick: 
					function(e) {
					
						// do stuff with coords
                   
                }
				};

This listener is registered and works (e.g. if I replcae the "//do stuff
with coords" part with an alert). I now want to work with the coordinates of
the clicked position, like in the openlayers.control.click example. There
are reasons why I am not using this particular example. Basically, what I
need to know, is how to access "e" in a way, that it reports the mouse
position. Then I can calculare my position. I cannot add the event to the
map as well (another almost similar listener ist already registered.

And the second one: 

In case I have defined such a listener and added it to my layer, e.g. to
report details of a clicked feature. Is it possible to activate and
deactivate this listener in a way like it works with controls (e.g.
clickControl.activate). 

Thanks for your help!

Cheers,
Freddy



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Simple-coordinate-displaying-with-layer-listener-and-activation-deactivation-tp5137963.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list