SetExtent

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SetExtent

iomeneandrei
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
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: SetExtent

Christopher Schmidt-2
On Wed, Nov 22, 2006 at 05:48:32PM +0100, andy wrote:
> 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?

I think you'll first want to read how to set OpenLayers to use a
different projection:

http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#Projections

Once you've read that, you should have better luck. If you still can't
get it working, feel free to report back and we can continue from there.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users