Set map extent in ActionScript

16 views
Skip to first unread message

diego

unread,
Sep 1, 2010, 12:56:32 PM9/1/10
to openscales-dev
Hi all.

I am having trouble trying to set the map extent in ActionScript. I
have tried everything I could think of with no success. I have been
able to set up a map with a WMS layer, but I haven't been able to
specify the map's initial extent (bounds). In MXML, no problem, but in
ActionScript no success. Can someone help me out with this?

TIA

Diego.

Andrew Ayre

unread,
Sep 1, 2010, 1:00:45 PM9/1/10
to opensca...@googlegroups.com
This works for me:

ASMap = FlexMap.map;

// zoom to bounding box
var TrackExtent:Bounds = new
Bounds(Application.application.parameters.xmin,
Application.application.parameters.ymin,
Application.application.parameters.xmax,
Application.application.parameters.ymax);
TrackExtent.transform(new ProjProjection("EPSG:4326"), new
ProjProjection("EPSG:900913"));
ASMap.zoomToExtent(TrackExtent);

--
Andy
PGP Key ID: 0xDC1B5864

Diego Marrero

unread,
Sep 1, 2010, 1:50:52 PM9/1/10
to opensca...@googlegroups.com
That made it. Thanks a lot!

Diego.


2010/9/1 Andrew Ayre <an...@britishideas.com>:

> --
> You received this message because you are subscribed to the Google Groups
> "openscales-dev" group.
> To post to this group, send email to opensca...@googlegroups.com.
> To unsubscribe from this group, send email to
> openscales-de...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/openscales-dev?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages