[OpenLayers-Dev] bbox=Nan,null,null,null
ralthaus
raphael.althaus at agridea.ch
Fri Oct 16 08:13:26 EDT 2009
pericoltoxic wrote:
>
>
>
> <script defer="defer" type="text/javascript">
>
>
> var bounds=new OpenLayers.Bounds(-180, -90, 180, 90);
>
>
> var map = new OpenLayers.Map( 'map', {maxExtent: bounds,
> projection:"EPSG:2000"});
>
> //var map = new OpenLayers.Map('map');
>
> var wms = new OpenLayers.Layer.WMS("cite:gtest2",
> "http://localhost:8080/geoserver/wms",{
> styles:'',
> format:"application/openlayers",
> layers: 'cite:gtest2'});
> map.addLayer(wms);
> map.zoomToMaxExtent();
> alert(wms.getURL(new OpenLayers.Bounds(map)));
> </script>
>
>
Hmmm, when you make "wms.getURL(new OpenLayers.Bounds(map))", you make a
double strange thing : you create "new" bounds (you don't want new bounds,
you want to get your map's bounds) , and arguments for OpenLayers.Bounds
are...bounds, not a map
To get your map bounds, you should make something like
wms.getURL(map.getExtents())
--
View this message in context: http://n2.nabble.com/bbox-Nan-null-null-null-tp3829292p3835209.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.
More information about the Dev
mailing list