[mapguide-users] ZoomToView function breaks session

Steve Finch steve.finch at edsi.com
Mon Mar 14 16:40:51 EDT 2011


Hi all,

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:

...
function GetParent()
        {
            if(popup)
                return opener;
            else
                return parent.parent;
        }

function ZoomToCoord(){
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.
Line: 3856
Char: 9
Code: 0
URI: http://gisvr1/mapguide/mapviewerajax/mapframe.php?MAPDEFINITION=Library%3A%2F%2FCounty%2FCounty_Premium_GIS_SQL.MapDefinition&TYPE=HTML&SHOWLEGEND=1&SHOWPROP=1&INFOWIDTH=240&LOCALE=en&HLTGT=2&HLTGTNAME=&SHOWSLIDER=1&SESSION=86b0a858-4e79-11e0-8000-0003ffca20da_en_C0A8C8D2591C591B591A

Since nothing else appears to be wrong and my session is dead, I assume this is indicating the expired session.

Thanks for any ideas.

Steve Finch
Engineering Design Systems, Inc.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20110314/bdebe0d5/attachment.html


More information about the mapguide-users mailing list