[OpenLayers-Dev] Graticule control can't be deactivated

bartvde at osgis.nl bartvde at osgis.nl
Thu Apr 1 08:34:34 EDT 2010


Hi Fabian,

I don't think control activate and deactivate are meant to control the
visibility of the actual control. Compare this for instance to the
MousePosition control, it also does not disappear on deactivate. Normally
active means it will respond to mouse events etc.

There is however the ability the switch the graticule layer off and on
using the LayerSwitcher, or alternatively you can control it by using its
vector layer property called gratLayer directly, so e.g.:

mycontrol.gratLayer.setVisibility(false);

Best regards,
Bart

>
> Graticule control dan't be deactivated
> Fabian Patzke (OL) 	Fabian Patzke (OL) 	  Apr 01, 2010; 01:54pm
>
> Hi,
> first of all you guys made a huge step with 2.9RC1 many thanks.
> So I started to work with it and test it.
> I create a map with EPSG:25832, remembered to use proj4js ;) and added the
> control like this:
>
>   var gratControl = new OpenLayers.Control.Graticule({
>     autoActivate: false
>   });
>   map.addControl(gratControl);
>
> Everything is fine the control works and theres no prob besides the fact
> that the control is active though I have set "autoActivate" to false. Also
> a
> JS call like:
>   gratControl.deactivate();
> does not work. Although the gratControl.active parameter tells me
> afterwards
> that the control is deactiveted, but I can still see it in the map. Am I
> missing something here or is this maybe a bug?
>
> Greetings,
> Fabian
> --
> View this message in context:
> http://n2.nabble.com/Graticule-control-can-t-be-deactivated-tp4836670p4836670.html
> Sent from the OpenLayers Dev mailing list archive at Nabble.com.
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>





More information about the Dev mailing list