[mapguide-users] Zoom to selection and set new scale

ruivilanova rui.vilanova at gismedia.pt
Mon Oct 22 11:45:22 EDT 2007


Hi all,


I'm selecting a point and then I zoom to it (with SetSelectionXML and
ExecuteMapAction(10) functions), but mapguide zooms to a scale of 0.01
because the selection is a point. I need to zoom to a bigger scale.

If I do the following code, it zooms to the center of the map before do
ExecuteMapAction(10), not to the place I want. It seems that Refresh() isn't
working.


function zoom2point(xml)
{
    parent.parent.SetSelectionXML(xml); 
    parent.parent.mapFrame.ExecuteMapAction(10);

    parent.parent.mapFrame.Refresh();
    parent.parent.Refresh();

    var x= parent.parent.mapFrame.GetCenter().X;
    var y= parent.parent.mapFrame.GetCenter().Y;
    parent.parent.mapFrame.ZoomToView(x,y,2500,true);
}	


Any sugestion?

Thanks in advance

Rui
-- 
View this message in context: http://www.nabble.com/Zoom-to-selection-and-set-new-scale-tf4670899s16610.html#a13343411
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list