[mapguide-users] ZoomToView function breaks session
steve.finch at edsi.com
Mon Mar 14 16:40:51 EDT 2011
I'm new to the MapGuide list, but have been working some with MapGuide for the past couple of years and reading a lot here. I'm testing a new PHP utility using MGOS 2.2 RC2 with the Ajax viewer.
The code I'm writing allows a user to zoom to a given location by typing in a coordinate in the local projected coordinate system, or optionally using LL (WGS84). I think I'm on track with everything except that the Main frame ZoomToView() function seems to break my session. After my code does the ZoomToView, the session is broken for any other operation until a browser refresh.
If I hard-code a similar ZoomToView function as a custom command in MapGuide Studio using InvokeScript, it works fine and the session continues normally. It appears as though this has something to do with calling the function from a different frame.
The command executes in the Task view pane and I'm calling ZoomToView() from there as follows:
GetParent().ZoomToView(document.getElementById('ProjectedX').value, document.getElementById('ProjectedY').value, 2000.0, true);
The zoom works correctly, but then I get an error in the browser with any subsequent operation.
For example, using the scroll wheel to zoom results in this error message in the browser:
Message: Invalid argument.
Since nothing else appears to be wrong and my session is dead, I assume this is indicating the expired session.
Thanks for any ideas.
Engineering Design Systems, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mapguide-users