[OpenLayers-Users] SetExtent

andy aborruso at tin.it
Wed Nov 22 11:48:32 EST 2006


Dear all,
I would like to set a starting view starting from a bounding box.
I have seen the "setxextent.html" file of the openlayers examples, and 
it's ok.
In my map I have coordinates in meter (EPSG:26592). Is it possible to 
set the bounds in meter?
If I use this code, I have no result:

  <script defer="defer" type="text/javascript">
    var map = new OpenLayers.Map('map',{projection:"EPSG:26592", units: 
"m"});
    var bounds = new OpenLayers.Bounds(2000000,4000000, 2200000, 4500000);
    var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
        
"http://www.cartapaesaggio.sicilia.it/cgi-bin/mapserv.exe?map=/Siti/cartapaesaggiosicilia/progetti/pista/wms/pista_wms.map&",
        {layers: 'test'});
    map.addLayer(wms);
    map.zoomToExtent(bounds);
    var boxes = new OpenLayers.Layer.Boxes("boxes");
    var box = new OpenLayers.Marker.Box(bounds);
    boxes.addMarker(box);
    map.addLayer(boxes);
  </script>

What's wrong??

Thank you,

a



More information about the Users mailing list