[mapguide-users] Zoom to Extents
Walt Welton-Lair
walt.welton-lair at autodesk.com
Thu May 31 10:25:45 EDT 2007
There's a lot of useful DWF Viewer API that is (unfortunately) not
exposed in the shared API for DWF / AJAX. To zoom to an extent with DWF
Viewer you could add the following method to dwfmappane.templ:
function ZoomToExtent(x0,y0,x1,y1,refresh)
{
var extent = emapViewer.CreateExtent();
extent.Set(x0, y0, x1, y1);
emapViewer.ZoomToExtent(extent);
if(refresh == 1)
emapViewer.Refresh();
}
Walt
-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of David
Hequet
Sent: Thursday, May 31, 2007 12:18 PM
To: mapguide-users at lists.osgeo.org
Subject: Re: [mapguide-users] Zoom to Extents
I'm trying do the same thing with the DWF viewer.
If you are using the ajax viewer, look at the "ZoomSelection()" in
"ajaxmappane.templ" file. This method ask the mapagent for the selecion
extents, calculate the scale, then use ZoomToView().
But with the DWF viewer, i found no tricks to reproduce the
calculteScale()
method.
Nichols, Mark A. wrote:
>
> I see documentation on zooming to an x,y point at a particular scale.
> What I have is the extents already calculated and I'd like to zoom to
> that particular extent. I use postgis to get the extents of an
object.
> Results look like
>
county_geometry_extents=631637.01873067,287635.157843,687024.28129651,33
> 7031.91208509.
>
> Can I zoom not to a point, but instead to a set of points that make up
> the extents.
>
>
> Mark Nichols
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>
--
View this message in context:
http://www.nabble.com/Zoom-to-Extents-tf3447457s16610.html#a10891104
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
More information about the mapguide-users
mailing list