<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]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName"/>
<!--[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;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 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.EmailStyle17
        {mso-style-type:personal;
        font-family:"Trebuchet MS";
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Trebuchet MS";
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Trebuchet MS";
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@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=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'>I added the code
to save the selection after doing the AddFeature. Im still getting an ‘empty’
Xml selection.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'>If I convert the
selection to a string, and output that to the task pane, its comes back as “OSGeo.MapGuide.MgSelection”.
If I convert the selection to Xml, it comes back empty.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'>What am I doing
wrong here?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><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>Andy Morsell<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, February 01, 2007
5:30 PM<br>
<b><span style='font-weight:bold'>To:</span></b> '<st1:PersonName w:st="on">MapGuide
Users Mail List</st1:PersonName>'<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] set
and zoom to selection</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 class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>After this:</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>selection.AddFeatures(layer, featureReader, 0);</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>Try adding this:</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>selection.Save(resourceService, mapName);</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>(note that your resourceService and mapName variable
names may be different)</span></font><o:p></o:p></p>
<p><font size=1 face=Tahoma><span style='font-size:7.5pt;font-family:Tahoma'><!-- Converted from text/rtf format -->Andy
</span></font><o:p></o:p></p>
<p class=MsoNormal><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='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-bottom:12.0pt'><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>Knight, Gregory<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, February 01, 2007
2:02 PM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">MapGuide
Users Mail List</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] set
and zoom to selection</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'>Me
again… Im trying to work through some of the PHP examples and
convert them to C#... I not doing a very good job… but Im
making some progress…<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'>I have a feature
source – to which Ive applied a basic filter. I am able to read
feature geometry and attributes from my featureReader… now id like
to convert that filtered feature to a selection… I think there is a
problem with the last four lines in the code below… because, if I
write the selectionXml variable to the task pane, it is empty.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'>Any idea what Im
doing wrong here?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=green><span style='color:green'>// create a filter to select the
specified parcel<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=teal><span style='color:teal'>String</span></font> filter = <font
color=maroon><span style='color:maroon'>"PID_LONG LIKE '%"</span></font>
+ parcelID + <font color=maroon><span style='color:maroon'>"%'"</span></font>;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgResourceIdentifier</span></font>
featureResId = <font color=blue><span style='color:blue'>new</span></font> <font
color=teal><span style='color:teal'>MgResourceIdentifier</span></font>(<font
color=maroon><span style='color:maroon'>"Library://BRA/Data/Bos_Parcels_06.FeatureSource"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgFeatureQueryOptions</span></font>
queryOptions = <font color=blue><span style='color:blue'>new</span></font> <font
color=teal><span style='color:teal'>MgFeatureQueryOptions</span></font>();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
queryOptions.SetFilter(filter);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=green><span style='color:green'>// get the parcel feature from the
feature source<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgAgfReaderWriter</span></font>
geometryReaderWriter = <font color=blue><span style='color:blue'>new</span></font>
<font color=teal><span style='color:teal'>MgAgfReaderWriter</span></font>();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgFeatureReader</span></font>
featureReader = featureService.SelectFeatures(featureResId, <font color=maroon><span
style='color:maroon'>"Bos_Parcels_06"</span></font>, queryOptions);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
featureReader.ReadNext();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=green><span
style='color:green'>// get the parcel geometry<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 color=green face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgByteReader</span></font> byteReader
= featureReader.GetGeometry(<font color=maroon><span style='color:maroon'>"Geometry"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgGeometry</span></font> geometry =
geometryReaderWriter.Read(byteReader);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgPoint</span></font> point =
geometry.GetCentroid();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=blue><span style='color:blue'>double</span></font> x =
point.GetCoordinate().GetX();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=blue><span style='color:blue'>double</span></font> y =
point.GetCoordinate().GetY();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=green><span style='color:green'>// create a selection, save the
selection as XML<o:p></o:p></span></font></span></font></p>
<p class=MsoNormal><font size=2 color=green face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:green'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgLayerBase</span></font> layer =
map.GetLayers().GetItem(<font color=maroon><span style='color:maroon'>"Bos_Parcels_06"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=teal><span style='color:teal'>MgSelection</span></font> selection =
<font color=blue><span style='color:blue'>new</span></font> <font color=teal><span
style='color:teal'>MgSelection</span></font>(map);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
selection.AddFeatures(layer, featureReader, 0);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
<font color=teal><span style='color:teal'>String</span></font> selectionXml =
selection.ToXml();</span></font><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:blue'><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>Knight, Gregory<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, February 01, 2007
12:07 PM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">MapGuide
Users Mail List</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> [mapguide-users] set and
zoom to selection</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 class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>I have an application that allows a user to
get parcel info for a given parcel id. The application flow is much like
many of the available developer samples:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><font size=2
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>-</span></font><font
size=1><span style='font-size:7.0pt'>
</span></font><font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS"'>Get parcel id from user<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><font size=2
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>-</span></font><font
size=1><span style='font-size:7.0pt'>
</span></font><font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS"'>Return link to parcel <o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><font size=2
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>-</span></font><font
size=1><span style='font-size:7.0pt'>
</span></font><font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS"'>User clicks on link to zoom to parcel<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><font size=2
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'>-</span></font><font
size=1><span style='font-size:7.0pt'>
</span></font><font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS"'>User can then select parcel to display parcel
attributes<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>This works, but I think there is much more
user interaction here than necessary. Once I have the parcel id from the
user (and I know its valid), Id like to automatically zoom to that parcel and
display the relevant parcel data in the task pane. Im a little stumped on
how I might do this, as the examples that illustrate setting active selection,
zooming to active selection, etc - all rely on using page load events /
javascript, XML selection sets, etc – again, all more user interaction
than I’d like. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>I’m assuming I can do this with one
page (as opposed to 2 or 3) via the web api – but I cant find any
examples. Can someone point me in the right direction here?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>Many thanks,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'>Greg<o:p></o:p></span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=1 width="100%" align=center>
</span></font></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><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt;
font-weight:bold'><br>
<strong><b><font face="Times New Roman">The substance of this message,
including any attachments, may be</font></b></strong><br>
<strong><b><font face="Times New Roman">confidential, legally</font></b></strong><br>
<strong><b><font face="Times New Roman">privileged and/or exempt from
disclosure pursuant to <st1:State w:st="on"><st1:place w:st="on">Massachusetts</st1:place></st1:State></font></b></strong><br>
<strong><b><font face="Times New Roman">law. It is intended</font></b></strong><br>
<strong><b><font face="Times New Roman">solely for the addressee. If you
received this in error, please</font></b></strong><br>
<strong><b><font face="Times New Roman">contact the sender and</font></b></strong><br>
<strong><b><font face="Times New Roman">delete the material from any computer.</font></b></strong></span></font></b><o:p></o:p></p>
</div>
</body>
</html>