[mapguide-users] Fusion SetExtents Stops Working
Frank Misurec
frank.misurec at open-minds.ca
Sat Jan 2 17:04:43 EST 2010
I have a MapGuide Enterprise 2010 application using Fusion. I have an
application running in a custom widget, basically Task Pane, and it
performs the basic operations:
- Allows the user to open a Project
- Creates several layers in the Session repository filtered for the objects
belonging to the project
- Opens the project zooms the map to the extents of the project
This works fine, the project form opens and the following code is used to
zoom to the extents:
window.onload = function() {
var mapWidget = window.top.Fusion.getWidgetById('Map');
var extents = new OpenLayers.Bounds($("#MinX").attr("value"),
$("#MinY").attr("value"), $("#MaxX").attr("value"),
$("#MaxY").attr("value"));
mapWidget.setExtents(extents);
}
This all works fine. However, if I perform an action in another form and
then return to the main project form the window.onload function is executed
and the mapWidget.setExtents call never returns and the map is not
refreshed. In addition my Map is partially frozen in the sense that the zoom
in/out buttons on the toolbar don't work and panning doesn't work. However,
Zoom Rectangle does work and this updates and refreshes the map reflecting
any changes that were made. Also, after a Zoom Rectangle at any time I can
make an edit and the window onload function works properly when the project
form is redisplayed. Any ideas what the problem might be? Note the use of
JQuery to retrieve the extents from the form elements. Any chance there is a
conflict between JQuery and Javascript libraries Fusion is using?
Thanks,
Frank.
More information about the mapguide-users
mailing list