[Users] Fwd: How to remove/hide Openlayers PanZoomBar

Kai Volland kaivolland at web.de
Wed Jan 26 19:09:44 CET 2011


Code is now like that but pan and zoom are still visible.
/
     var map = new OpenLayers.Map(options);

     // Options

     var options = {
         controls: [],
         projection: new OpenLayers.Projection("EPSG:900913"),
         displayProjection: new OpenLayers.Projection("EPSG:4326"),
         units: "m",
         maxResolution: "auto",
         allOverlays: false,
         maxExtent: new 
OpenLayers.Bounds(-75.86,44.05,-74.526,45.016).transform(new 
OpenLayers.Projection("EPSG:4326"), new 
OpenLayers.Projection("EPSG:900913")),
         stateId: "map",
         prettyStateKeys: true // for pretty permalinks

     };

     map.addControl(new OpenLayers.Control.ScaleLine());
     map.addControl(new OpenLayers.Control.Navigation());
     //map.addControl(new OpenLayers.Control.PanPanel());
     //map.addControl(new OpenLayers.Control.ZoomPanel());
     map.addControl(new OpenLayers.Control.Permalink('permalink'));/


Am 26.01.2011 18:49, schrieb Andrew Stewart:
>   Try declaring your controls empty initially  - controls: []
>
> Then just add any control you want after
>
> 		map.addControl(new OpenLayers.Control.Whatever());
>
> And I think your pan bar will not be there anymore.
>
>
>
> -----Original Message-----
> From: users-bounces at geoext.org [mailto:users-bounces at geoext.org] On Behalf Of Kai Volland
> Sent: January 26, 2011 10:45 AM
> To: users at geoext.org
> Subject: Re: [Users] Fwd: How to remove/hide Openlayers PanZoomBar
>
> I added them this way:
>
>
>                   controls: [
>                   new OpenLayers.Control.ScaleLine(),
>                   new OpenLayers.Control.Navigation(),
>                   //new OpenLayers.Control.PanPanel(),
>                   //new OpenLayers.Control.ZoomPanel(),
>                   new OpenLayers.Control.Permalink('permalink')
>               ],
>
>
> Am 26.01.2011 18:31, schrieb Andrew Stewart:
>> Are you adding your map to a mappanel? When you declare your map variable set the controls to be
>>
>> controls: []
>>
>>
>>
>> -----Original Message-----
>> From: users-bounces at geoext.org [mailto:users-bounces at geoext.org] On Behalf Of Kai Volland
>> Sent: January 26, 2011 10:27 AM
>> To: users at geoext.org
>> Subject: [Users] Fwd: How to remove/hide Openlayers PanZoomBar
>>
>> Hi,
>>
>> here is my very simple question:
>>
>> How to remove or hide the PanZoomBar from Openlayers. It seems to be
>> added to the map automatically.
>> Removing only the zoom-buttons of this bar would be even better for me.
>>
>> Kind regards
>> Kai
>>
>> _______________________________________________
>> Users mailing list
>> Users at geoext.org
>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>>
>>
>> [This message has been scanned for security content threats and viruses.]
>>
>> [The City of Red Deer I.T. Services asks that you please consider the environment before printing this e-mail.]
>>
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at geoext.org
>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
>
> [This message has been scanned for security content threats and viruses.]
>
> [The City of Red Deer I.T. Services asks that you please consider the environment before printing this e-mail.]
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110126/355c8d16/attachment-0001.htm 


More information about the Users mailing list