[OpenLayers-Users] Openlayers 2.6 - zoomLevels.html

Linda Rawson linda.rawson at gmail.com
Wed Apr 2 17:13:54 EDT 2008


I want to make the panZoomBar contain specific scales.  How do I do that?

I have tried the following the the zoomLevels.html

        var lon = 50;
        var lat = 0;
        var zoom = 0;
        var map, layer;
        function init(){
            OpenLayers.DOTS_PER_INCH = 72;
            var options = {
                          scales: [50000000, 10000000],
                            controls: [new
OpenLayers.Control.MouseDefaults()]
                          };
            map = new OpenLayers.Map( 'map' , options);
            map.addControl(new OpenLayers.Control.PanZoomBar());
            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
                    "http://labs.metacarta.com/wms/vmap0", {layers:
'basic'});
            map.addLayer(layer);

            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
      }

I expected to see only two bars in the PanZoomBar.  What do I need to do to
see that?

-- 
Linda Rawson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080402/8e8894e9/attachment.html


More information about the Users mailing list