<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:st1="urn:schemas-microsoft-com:office:smarttags" 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 11 (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]-->
<title>Viewer API Selection Timing Issues</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@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:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks again Walt. I am using the DWF
Viewer and will call the WaitForMapUpdated method in the DWF Viewer api. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Regards,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Shane<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal style='margin-left:.5in'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Walt Welton-Lair<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, March 15, 2007
10:12 AM<br>
<b><span style='font-weight:bold'>To:</span></b> MapGuide Users Mail List<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users]
Viewer API Selection Timing Issues</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>You're using DWF Viewer
right?</span></font><o:p></o:p></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>With DWF Viewer there's a
WaitForMapUpdated API you can call on the EMapViewer document
handler. That method is precisely there to solve your kind of
problem. Just call it after the zoom call and before the select.</span></font><o:p></o:p></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>I sent you all the DWF
Viewer API a while back, so you have the necessary information.</span></font><o:p></o:p></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>In general, the
difficulty is that the MapGuide "client API" is the API common
to DWF and <st1:City w:st="on"><st1:place w:st="on">AJAX</st1:place></st1:City>.
DWF Viewer has tons more API available (like this WaitForMapUpdated method)
that's just not exposed in the MapGuide client API layer.</span></font><o:p></o:p></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>Walt</span></font><o:p></o:p></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabIndex=-1>
</span></font></div>
<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:.5in'><b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
mapguide-users-bounces@lists.osgeo.org [mailto:mapguide-users-bounces@lists.osgeo.org]
<b><span style='font-weight:bold'>On Behalf Of </span></b>Buscher, Shane<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, March 15, 2007
4:02 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Mapguide_users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [mapguide-users] Viewer
API Selection Timing Issues</span></font><o:p></o:p></p>
<p style='margin-left:.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'><!-- Converted from text/rtf format -->I may be going
about this the wrong way, but here’s my problem. I want to</span></font> <font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> select a
feature based on</span></font> <font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>an attribute query in the task pane, automatically
zoom to it, and</span></font> <font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>highlight</span></font> <font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>it. </span></font> <font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I have found
highlighting the feature to be the most</span></font> <font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>problematic because the feature has
to exist within the map frame</span></font> <font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>extent before it can be selected
with</span></font> <font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>the SetSelectionXML() Viewer api function.</span></font> <font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>As far as I
know, this is the only function call you can make in MapGuide to</span></font> <font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>highlight
features. </span></font><o:p></o:p></p>
<p style='margin-left:.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>Knowing that SetSelectionXML() will only highlight
features in the current map extent, I preceded to zoom to the feature</span></font>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>(ZoomToView)</span></font>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>before
calling SetSelectionXML(). </span></font> <font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>The problem is that the map
can’t zoom quick enough, and so no features</span></font> <font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>are highlighted:</span></font><o:p></o:p></p>
<p style='margin-left:.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>ZoomToView(x, y, scale); </span></font> <o:p></o:p></p>
<p style='margin-left:.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>SetSelectionXML(xmlSet); //no features exist
yet because of</span></font> <font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>delay in ZoomToView</span></font> <o:p></o:p></p>
<p style='margin-left:.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>I don’t have</span></font> <font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>any problems when
the feature already exists in my map extent. Does anyone have a
workaround or better method to</span></font> <font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>accomplish this? </span></font>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>The
only hack can think of is to pause the</span></font> <font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>execution</span></font> <font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>of
SetSelectionXML() until ZoomoView is complete, but I’m not sure the best
way to code this. </span></font> <o:p></o:p></p>
<p style='margin-left:.5in'><a name=""><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Regards,</span></font></a><o:p></o:p></p>
<p style='margin-left:.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>Shane</span></font><o:p></o:p></p>
</div>
</body>
</html>