maxExtent not working

1 view
Skip to first unread message

diego

unread,
Aug 26, 2010, 2:47:51 PM8/26/10
to openscales-dev
Hi all. I prepared a test map like this:

<os:Map
id="osMap"
width="100%" height="100%">

<os:WMS id="wmsLayer"
name="Callejero"
url="http://idecan2.grafcan.es/ServicioWMS/Callejero?"
layers="WMS_CA"
isBaseLayer="true"
format="image/png"/>
<os:Extent left="-16.4700"
bottom="28.5000"
right="-16.1500"
top="28.3800"/>
</os:Map>

It worked correctly. Now I'm trying to do the same thing
programmatically:

var lLayer :WMS;
var lExtent :Bounds;

lLayer = new WMS ('Callejero', "http://idecan2.grafcan.es/ServicioWMS/
Callejero?", "WMS_CA", true);
(lLayer.params as WMSParams).format = "image/png";

lExtent = new Bounds (-16.4700,28.5000,-16.1500,28.3800);
this.iGUI.osMap.map.addLayer (lLayer);
this.iGUI.osMap.maxExtent = Bounds.getBBOXStringFromBounds
(lExtent); // Does not work
lLayer.maxExtent =
lExtent; //
Does not work either

The map displays, but the bounds are not what I expected. How can I
accomplish this?

Thanks
Reply all
Reply to author
Forward
0 new messages