[mapguide-users] Zooming to a defined point

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Wed Jan 28 07:29:25 EST 2009


It is not a built-in function, so you have to append it.

The easy way is to modify some of the viewerfiles, but that will cause 
trouble on upgrades.

The slightly more difficult way is to register a "map loaded" event. You 
can find code for this in the mail archives.
In the handler, you can retrieve the main frame url by this code:
//Not tested
var openerurl = GetMapFrame().parent.location.href;

You can then parse the url, and look for x/y/scale parameters in the string.
There are plenty free url parsers, if you search for it.

Once you have the data, you can call the ZoomToView function.

Regards, Kenneth Skovhede, GEOGRAF A/S



Carmelo Saffioti skrev:
> Hi everybody,
> I need to zoom on a defined point of known coordinates, when the page 
> loads. I saw that it exists the ZoomToView() function... is it 
> possible to pass to the ajaxviewer a parameter for zooming on a 
> defined point (like ZoomToView) ?
>  
> I'm calling the ajaxviewer with this script:
> location.replace("../../mapviewerjava/ajaxviewer.jsp?SESSION=<%= 
> sessionId %>&WEBLAYOUT=<%= webLayout %>");
>  
>  
> I hope you can help me
> Cheers
> Carmelo
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090128/3daf271b/attachment.html


More information about the mapguide-users mailing list