[OpenLayers-Users] deactivate control
Francesco D'Alesio
francesco.dalesio at r3-gis.com
Fri May 4 08:32:11 EDT 2012
Hi Jo,
you can deactivate a control using the deactivate() function.
var control = new OpenLayers.Control.ZoomBox();
...
...on click...
control.deactivate();
yourControl.activate();
Francesco
Il 04/05/2012 13:50, Jochen Wagner ha scritto:
> Hi Michael,
> thank you for your answer. Is it only possible to deactivate the
> control by adding my custom control to the same control panel?
> Jo
>
> 2012/5/4 Michael Shishcu <micklesh at gmail.com <mailto:micklesh at gmail.com>>
>
> Hi Jo,
> please have a look at control.type.
> http://docs.openlayers.org/library/controls.html#controls-to-be-used-with-panels
> adding several controls to a panel with type TYPE_TOOL makes only
> one to be active at a time
>
> regards, michael
>
> On Fri, May 4, 2012 at 1:45 PM, Jochen Wagner
> <jjwag0815 at googlemail.com <mailto:jjwag0815 at googlemail.com>> wrote:
>
> Hi,
> I (newbe) have created a new Zoombox-Control for a map and it
> works fine:
>
> ...
> new OpenLayers.Control.ZoomBox({alwaysZoom:true});
> ...
>
> Now I have added a custom Control for adding vector-points to
> my map (for routing), I activate this over a radion buttom:
>
> routecontrols = {
> start: new OpenLayers.Control.DrawFeature(
> start,
> SinglePoint,
> {'featureAdded': computeRoute}
> )
> }
>
> for (var key in routecontrols) {
> map.addControl(routecontrols[key]);
> }
>
> My Problem now: If the Zoomboxcontrol is active, it is not
> possible to activate my custom control. How can I trigger a
> control to be active/inactive?
>
> Thanks
> Jo
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org <mailto:Users at lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120504/4aed72a7/attachment.html
More information about the Users
mailing list