<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Steve and I have been working on this. In a nutshell, we are creating a page that displays in the task frame where the user can enter into a form values from various coord systems. The form will then convert the coordinate system to the current map and then zoom to that point at a certain zoom scale. When we do this the map zooms to the correct location, but anything after is broken as if the session has been lost. I have simplified the page as much as possible to show the exact issue. The hard coded coords below are in the same projection the map is in and the scale is valid. This is with the AJAX viewer.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><html><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><head><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><script language="Javascript"><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> function MyZoomToCoord(){<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> parent.parent.ZoomToView("11516002.190242026", "3400692.2790488531", 2000.0, true);<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> parent.parent.refresh();<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> }<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'></script><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'></head><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><body><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><form><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> <input type="button" id="Submit" width="250" height="75" onclick="MyZoomToCoord();" value="Zoom to Coordinate"><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'></form><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'></body><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'></html><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>The result is, the map zooms correctly to the point at the correct scale. Then the user tries to do anything else and it fails, e.g. pan using the mouse, the map moves, then the screen goes blank.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Any thoughts? Is this a bug in the core code?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Mapguide 2.2 RC2/Apache/W2003k/AJAX viewer.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><p class=MsoNormal><span style='color:#1F497D'>Martin Morrison<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Application Engineer<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Engineering Design Systems, Inc.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>3780 Peters Creek Rd Ext SW<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Roanoke, VA 24018<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>540.345.1410<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>gis.edsi.com<o:p></o:p></span></p></div><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> mapguide-users-bounces@lists.osgeo.org [mailto:mapguide-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Steve Finch<br><b>Sent:</b> Monday, March 14, 2011 4:41 PM<br><b>To:</b> mapguide-users@lists.osgeo.org<br><b>Subject:</b> [mapguide-users] ZoomToView function breaks session<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hi all,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The command executes in the Task view pane and I’m calling ZoomToView() from there as follows:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>…<o:p></o:p></p><p class=MsoNormal>function GetParent()<o:p></o:p></p><p class=MsoNormal> {<o:p></o:p></p><p class=MsoNormal> if(popup)<o:p></o:p></p><p class=MsoNormal> return opener;<o:p></o:p></p><p class=MsoNormal> else<o:p></o:p></p><p class=MsoNormal> return parent.parent;<o:p></o:p></p><p class=MsoNormal> }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>function ZoomToCoord(){<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>GetParent().ZoomToView(document.getElementById('ProjectedX').value, document.getElementById('ProjectedY').value, 2000.0, true);<o:p></o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The zoom works correctly, but then I get an error in the browser with any subsequent operation.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For example, using the scroll wheel to zoom results in this error message in the browser:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-indent:.5in'>Message: Invalid argument.<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>Line: 3856<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>Char: 9<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>Code: 0<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>URI: <a href="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">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</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Since nothing else appears to be wrong and my session is dead, I assume this is indicating the expired session.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for any ideas.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Steve Finch<o:p></o:p></p><p class=MsoNormal>Engineering Design Systems, Inc.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>