<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)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Palatino Linotype";
        panose-1:2 4 5 2 5 5 5 3 3 4;}
@font-face
        {font-family:"MS Shell Dlg 2";
        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";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle25
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle26
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle27
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle28
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle29
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</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 bgcolor=white lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='color:#1F497D'>Again, many thanks for the
continued help.<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'>Interesting about Fusion not
having a scriptFrame.. this may be possible – as you can tell I’m
not an expert. Unfortunately I’ve regressed over the last few days
though and I’m not even in a position to solve that problem. Here’s
where I stand now:<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'>I had all my pages working that
used the GetParent() function with the exception of gotopoint.aspx.
Somewhere in my playing I must have screwed something up as I noticed that all
the other pages that called GetParent() function had started opening in new
windows where they had at one time worked properly. After a day of
playing around without any success I figured that I must have really messed
something up somewhere in one of the Fusion files. So I backed up all my
code and decided I was going to start from scratch ( I was already starting to forgot
half the stuff I had done weeks before and figured it might be a good idea to
re-learn again anyway).<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'>I uninstalled mapguide entirely
from my machine. Deleted the existing directories that were left behind
after the uninstall and started with a fresh install (restarted the machine and
everything). Strangest thing happens when I loaded the Fusion template right
after the new install – it loads with all the googlestuff code and all my
modifications to the template. I check IIS the virtual directories for
mapguide and they all point to the default install directory . I check
the default install directory and there is no sign of the addGoogle code or any
of the other modifications to the template. I didn’t even back
things up to this computer, the backup resides on an entirely different
machine. When I right click in IE and select view source, the addgoogle
stuff code is being loaded into the browser from index.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'>Can anyone explain this behavior?<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'>Thanks<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>Fraser<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'><o:p> </o:p></span></p>
<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";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Chris
Claydon<br>
<b>Sent:</b> Friday, September 18, 2009 11:37 AM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> RE: [mapguide-users] RE: parent.parent.parent.mapFrame - AJAX
vsFUSION<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in'><span style='color:#1F497D'>“The
gotopoint.aspx is being held and fired from the hidden scriptFrame in
MapGuide. “<o:p></o:p></span></p>
<p class=MsoListParagraph style='text-indent:-.25in'><o:p> </o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in'>Correct me if I’m
wrong, but I don’t think the Fusion viewer has a frame called
‘scriptFrame’.<o:p></o:p></p>
<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";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Kenneth
Skovhede, GEOGRAF A/S<br>
<b>Sent:</b> Friday, September 18, 2009 12:35 AM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> Re: [mapguide-users] RE: parent.parent.parent.mapFrame - AJAX
vsFUSION<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>Try to put a breakpoint at the
line in question, then click "Start debugging".<br>
Now once the page hits the line, the debugger will stop and show the line with
a highlight.<br>
Then, go to the 4th tab on the right ("Show"), and type in
"GetParent" and press enter.<br>
It will now show you what it thinks GetParent is (a function or null).<br>
If it is a function, try to type "GetParent()", to see what
GetParent() returns.<br>
If it returns null, try to type "window", and expand the
"[Methods]" item, to see what methods you have loaded/defined.<o:p></o:p></p>
<pre>Regards, Kenneth Skovhede, GEOGRAF A/S<o:p></o:p></pre>
<p class=MsoNormal><br>
<br>
Fraser Burgess skrev: <o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>Thanks, I’ve done some
more reading and think I understand. But that being said, I’m
confused as to why this still isn’t working. </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in'><span style='color:#1F497D'>In
my navigatetask.aspx is where I grab the XY and scale parameters. </span><o:p></o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in'><span style='color:#1F497D'>From
here I create a url pointing to gotopoint.aspx and pass in the XY and scale
paremeters to the URL.</span><o:p></o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in'><span style='color:#1F497D'>The
gotopoint.aspx is being held and fired from the hidden scriptFrame in
MapGuide. </span><o:p></o:p></p>
<p class=MsoListParagraph style='text-indent:-.25in'><span style='color:#1F497D'>Gotopoint.aspx
contains the onPageLoad function which calls ZoomToView.</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>So since I want the script frame
to interact with the mapFrame I should be able to start from the top frame and
drill down like this:</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>function
OnPageLoad()</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>{</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
window.top.fusion.ZoomToView(<%= GetRequestParameters()["X"] %>,
<%= GetRequestParameters()["Y"] %>, <%=
GetRequestParameters()["Scale"] %>, true);</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>}</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'></script></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><body
onLoad="OnPageLoad()"></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>Or I could also use the
GetParent() function which should fire at the first if (parent.Fusion) section
as the scriptFrame should be one level below the Fusion frame which is
essentially defined as window.top.fusion to begin with. </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>Both these methods fire the
script and open the URL passed in from Navigate.aspx in a new IE window. I can only
assume this is because the reference to the mapFrame is invalid and somehow the
URL defaults to opening in a new window? Do I need to reference
MapGuideViewerAPI.js in this script somewhere?? – I don’t think
this is the case as I didn’t need to do it for the mapFrame references.</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>-----------</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>I tried the IE8 debugger and my
code (see below) fails at</span><span style='font-size:9.0pt;font-family:"Courier New"'>
<span style='background:yellow'>GetParent().ZoomToView(605793.225947542,
5057603.85822154, 25000, true)</span>; with the error </span><span
style='font-size:8.5pt;font-family:"MS Shell Dlg 2","sans-serif";color:red'>'undefined'
is null or not an object.</span> I assume this means it doesn’t
know what GetParent() is.<o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>Any ideas?</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>F</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><%@
Page language="c#"%></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><!--
#Include File="utilityfunctions.aspx" --></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><!DOCTYPE
HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><html></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><head></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
<title>Viewer Sample Application - Goto Point</title></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
<meta content="text/html; charset=utf-8"
http-equiv="Content-Type"></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
<meta http-equiv="content-script-type"
content="text/javascript"></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'></head></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><!--
Emit this function and assocate it with the onLoad event for the --></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><!--
page so that it gets executed when this page loads in
the --></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><!--
browser. The function calls the ZoomToView method on
the --></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><!--
Viewer frame forcing the Viewer to navigate to the
specified --></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><!--
point and
scale.
--></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><script
language="javascript"></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>function
GetParent()</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
{</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
if (parent.Fusion) {</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
return parent;</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
} else if (parent.parent.Fusion) {</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
return parent.parent;</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
}</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
}</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>function
OnPageLoad()</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>{</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
GetParent().ZoomToView(<%= GetRequestParameters()["X"] %>,
<%= GetRequestParameters()["Y"] %>, <%=
GetRequestParameters()["Scale"] %>, true);</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>}</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'></script></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><body
onLoad="OnPageLoad()"></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'></body></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'></html></span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<div>
<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;
border-color:-moz-use-text-color -moz-use-text-color'>
<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"'> <a
href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Chris Claydon<br>
<b>Sent:</b> Wednesday, September 16, 2009 4:30 PM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> RE: [mapguide-users] RE: parent.parent.parent.mapFrame - AJAX
vsFUSION</span><o:p></o:p></p>
</div>
</div>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>‘parent’ takes you
to the frame that is the parent of the one you’re running the script in.
The GetParent() method as defined below looks for ‘Fusion’ to be
defined either in the direct parent or the parent of that frame. If
you’re launching in a new window, you’ll never get to a parent that
has Fusion defined. I think you need to use ‘opener’ instead…</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<div>
<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;
border-color:-moz-use-text-color -moz-use-text-color'>
<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"'> <a
href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Fraser Burgess<br>
<b>Sent:</b> Wednesday, September 16, 2009 2:04 PM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> RE: [mapguide-users] RE: parent.parent.parent.mapFrame - AJAX
vs FUSION</span><o:p></o:p></p>
</div>
</div>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>So
GetParent() worked when things were called with
“parent.parent.parent.mapFrame”; however, what if I have something
in AJAX like this:</span><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New"'> </span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>function OnPageLoad()</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>{</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'> parent.ZoomToView(<%=
GetRequestParameters()["X"] %>, <%=
GetRequestParameters()["Y"] %>, <%=
GetRequestParameters()["Scale"] %>, true);</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>}</span></i><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>I
then modify by adding your code below and then try:</span><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New"'> </span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>function GetParent()</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'> {</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>
if (parent.Fusion) {</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>
return parent;</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>
} else if (parent.parent.Fusion) {</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>
return parent.parent;</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>
}</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:.5in'><i><span style='font-size:10.0pt;
font-family:"Courier New";color:#4F81BD'> }</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'> </span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>function OnPageLoad()</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>{</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'> GetParent().ZoomToView(<%= GetRequestParameters()["X"]
%>, <%= GetRequestParameters()["Y"] %>, <%=
GetRequestParameters()["Scale"] %>, true);</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>}</span></i><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>This code is using the sample gotopoint.aspx file.
When I select the link that activates this gotopoint, the URL contains the X Y and
scale <a
href="http://172.16.186.38/mapguide2010/UtilityMap/gotopoint.aspx?X=632593.974151717&Y=4989398.03115329&Scale=25000">http://172.16.186.38/mapguide2010/UtilityMap/gotopoint.aspx?X=632593.974151717&Y=4989398.03115329&Scale=25000</a>
which should be passed into this onPageLoad() function. However it
appears that nothing is firing for OnPageLoad – so when I click the link
nothing happens, no error message or anything.<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>Can anyone help with this problem? Also, can anyone
point me to something that would help explain this parent.parent. syntax?
I’m not really certain why at one point we would use parent.function() vs
parent.parent.parent.function() etc.<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>Thanks again<o:p></o:p></p>
<p class=MsoNormal>Fraser<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<div>
<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;
border-color:-moz-use-text-color -moz-use-text-color'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> </span></b><o:p></o:p></p>
<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"'> <a
href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Berdel, Brian<br>
<b>Sent:</b> Wednesday, September 16, 2009 9:02 AM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> [mapguide-users] RE: parent.parent.parent.mapFrame - AJAX vs
FUSION</span><o:p></o:p></p>
</div>
</div>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>If you want to add the reference
to your fusion index page, add the following to your aspx (task pane) page</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>function</span><span style='font-size:10.0pt;font-family:"Courier New"'>
GetParent()</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
{</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>if</span><span
style='font-size:10.0pt;font-family:"Courier New"'> (parent.Fusion) {</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>return</span><span
style='font-size:10.0pt;font-family:"Courier New"'> parent;</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
} </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>else</span><span
style='font-size:10.0pt;font-family:"Courier New"'> </span><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>if</span><span
style='font-size:10.0pt;font-family:"Courier New"'> (parent.parent.Fusion) {</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>return</span><span
style='font-size:10.0pt;font-family:"Courier New"'> parent.parent;</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
}</span><o:p></o:p></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'> }</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Then
you can call functions in the same way as before but substitute</span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>GetParent().<i>DigitizePoint(OnPointDigitized);</i></span><o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<div>
<div>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Palatino Linotype","serif";
color:#1F497D'>Brian Berdel</span><o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Palatino Linotype","serif";
color:#1F497D'>McMahon Associates, Inc.</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Palatino Linotype","serif";
color:#1F497D'>p: 215.283.9444 x 260</span><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Palatino Linotype","serif";
color:#1F497D'><a href="http://www.mcmtrans.com">www.mcmtrans.com</a></span><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";
color:#1F497D'> </span><o:p></o:p></p>
</div>
</div>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";
color:#1F497D'> </span><o:p></o:p></p>
<div>
<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;
border-color:-moz-use-text-color -moz-use-text-color'>
<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"'> <a
href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Chris Claydon<br>
<b>Sent:</b> Tuesday, September 15, 2009 4:43 PM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> [mapguide-users] RE: parent.parent.parent.mapFrame - AJAX vs
FUSION</span><o:p></o:p></p>
</div>
</div>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>I think you should be able to
reference the MapGuideViewerAPI.js script from your aspx page, and then just
call DigitizePoint directly without any window.top or parent references.</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>It should also be possible to
add a reference to MapGuideViewerAPI.js to the index.html file in the Fusion
template you’re using, and reference it using window.top…</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'>It’s been a while since
I’ve played around with this stuff, so someone else may be able to
provide specifics…</span><o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'> </span><o:p></o:p></p>
<div>
<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;
border-color:-moz-use-text-color -moz-use-text-color'>
<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"'> <a
href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Fraser Burgess<br>
<b>Sent:</b> Tuesday, September 15, 2009 1:40 PM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> [mapguide-users] parent.parent.parent.mapFrame - AJAX vs FUSION</span><o:p></o:p></p>
</div>
</div>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>Hi List,<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>I’m making steady progress with my project and
learning many things about MapGuide along the way thanks largely to the help
from those on this list – many thanks to those who have helped so far<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>From what I can tell parent.parent.parent.mapFrame is how
the map frame is referenced from the task pane in the AJAX viewer. I have
been reading posts about how this is referenced in Fusion and it seems the <i>MapGuideViewerAPI.js</i>
file has a bit of info. Unfortunately I’m having a bit if trouble
putting the pieces together and was hoping that someone here may steer me in
the right direction.<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>In both AJAX and FUSION I’m working from the taskpane
and using the markup scripts that are part of the AJAX demo’s and
tutorials.<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>I assume I need to substitute either ‘Fusion’ or
‘window.top.Fusion’ somehow for ‘<i><span style='font-size:
10.0pt;font-family:"Courier New"'>parent.parent.parent.mapFrame.DigitizePoint(OnPointDigitized);’.
</span></i>in my script however I have yet to do this in such a way that it
works. I keep getting ‘Object doesn’t support this property
or method’.<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>So for example in my editmarkup.aspx code for example, I
have the following function which should be activated when I click the digitize
point button<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New"'>
function AddPoint()</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New"'>
{</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New"'>
SetDigitizeInfo(EDIT_POINT_HELP);</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New"'>
parent.parent.parent.mapFrame.DigitizePoint(OnPointDigitized);</span></i><o:p></o:p></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Courier New"'>
}</span></i><o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>In Fusion this code gives an error
‘parent.parent,parent.mapFrame’ is null or not an object<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>I see that in MapGuideViewerAPI.js<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>function DigitizePoint(handler) {</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> if (handler) {</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> var Fusion =
window.top.Fusion;</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> var mapWidget =
Fusion.getWidgetById(mapWidgetId);</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> var digitizer = new
Fusion.Tool.Canvas.Point(mapWidget);</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> digitizer.mouseUp =
PointHandlers.prototype.mouseUp;</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>
Object.inheritFrom(digitizer, Fusion.Tool.Canvas.prototype, []);</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>
digitizer.initializeCanvas();</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> var activeWidget =
mapWidget.buttonSet.activeButton;</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>
mapWidget.buttonSet.setActiveButton(null);</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> digitizer.handler =
function() {</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>
handler.apply(null, arguments);</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>
activeWidget.setActive(true);</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> }</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> digitizer.activateCanvas();</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> </span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> //add a listener to
update the position of the features</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> var mapWidget =
Fusion.getWidgetById(mapWidgetId);</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>
mapWidget.registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED, </span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>
function(){</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>
digitizer.updatePx();</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>
digitizer.clearContext();</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>
digitizer.draw(digitizer.context);</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> }</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> );</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'> }</span></i><o:p></o:p></p>
<p class=MsoNormal style='margin-left:1.0in'><i><span style='font-size:10.0pt;
font-family:"Courier New"'>}</span></i><o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>Thanks<o:p></o:p></p>
<p class=MsoNormal>Fraser<o:p></o:p></p>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> </span><o:p></o:p></p>
<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'>
<hr size=2 width="100%" align=center>
</span></div>
<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Arial","sans-serif";
color:gray'>Important notice to recipients:<br>
Copies of documents that may be relied upon by you are limited to the printed
copies (also known as 'hard copies') that are signed and sealed by the Engineer
and/or Land Surveyor. Files in electronic formats, or other types of
information furnished by the Engineer and/or Land Surveyor to you such as text,
data or graphics are for your convenience only. Any conclusions or information
obtained or derived from such electronic files will be at the user's sole risk.
When transferring documents in electronic formats, the Engineer and/or Land
Surveyor makes no representation as to long-term compatibility, usability, or
readability of the documents resulting from the use of software application packages,
operating systems or computer hardware differing from those used by McMahon
Associates, Inc. at the beginning of the project.</span><o:p></o:p></p>
<pre><o:p> </o:p></pre><pre style='text-align:center'><o:p> </o:p></pre><pre
style='text-align:center'><o:p> </o:p></pre><pre style='text-align:center'>
<hr size=4 width="90%" align=center>
</pre><pre style='text-align:center'><o:p> </o:p></pre><pre
style='text-align:center'><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>mapguide-users mailing list<o:p></o:p></pre><pre><a
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></pre><pre><a
href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><o:p></o:p></pre><pre> <o:p></o:p></pre></div>
</body>
</html>