<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="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>
<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'>RFC 15 should solve this problem in the
AJAX viewer when/if it makes it through<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='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><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
10:02 AM<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>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>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><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><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><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><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><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><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>