[OpenLayers-Users] Problems when deactivating custom control

Zer hcan at hotmail.com
Tue May 13 16:15:05 EDT 2008


Hi all,

I have made a custom control that gets the length of a line feature. I then
show this length in a div. When the control gets deactivated, I want the div
to be cleared. What happens is that the div gets cleared but the control
does not get deactivated in the panel. Am I missing something here???

mt = new OpenLayers.Control.DrawFeature(vLayer, OpenLayers.Handler.Path,
		{	featureAdded: ShowDistance,
			handlerOptions: {'freehand': true},
			displayClass: 'MeasureTool',
			deactivate: function() {clearDistance();},
		});

If I remove this line "deactivate: function() {clearDistance();" the control
gets deactivated in the panel, but how do I then get the div cleard? 

I also want to clear the div when a new line is drawn. Is there a way to
capture an event for this?

Thanks and Best Regards,

Zer
-- 
View this message in context: http://www.nabble.com/Problems-when-deactivating-custom-control-tp17168613p17168613.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list