<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5730.11" name=GENERATOR><!--[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-face {
        font-family: Tahoma;
}
@font-face {
        font-family: Trebuchet MS;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-WEIGHT: normal; COLOR: windowtext; FONT-STYLE: normal; FONT-FAMILY: "Trebuchet MS"; TEXT-DECORATION: none; mso-style-type: personal
}
SPAN.EmailStyle18 {
        FONT-WEIGHT: normal; COLOR: blue; FONT-STYLE: normal; FONT-FAMILY: "Trebuchet MS"; TEXT-DECORATION: none; mso-style-type: personal-reply
}
DIV.Section1 {
        page: Section1
}
OL {
        MARGIN-BOTTOM: 0in
}
UL {
        MARGIN-BOTTOM: 0in
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=390332422-01022007><FONT face=Arial
color=#0000ff size=2>After this:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390332422-01022007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=390332422-01022007><FONT face="Courier New"
size=2>selection.AddFeatures(layer, featureReader, 0);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390332422-01022007><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=390332422-01022007><FONT face="Courier New"
size=2>Try adding this:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390332422-01022007><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=390332422-01022007><FONT face="Courier New"
size=2>selection.Save(resourceService, mapName);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390332422-01022007><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=390332422-01022007><FONT face="Courier New"
size=2>(note that your resourceService and mapName variable names may be
different)</FONT></SPAN></DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=en-us><FONT face=Tahoma size=1>Andy </FONT></SPAN></P><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <B>On Behalf Of </B>Knight,
Gregory<BR><B>Sent:</B> Thursday, February 01, 2007 2:02 PM<BR><B>To:</B>
MapGuide Users Mail List<BR><B>Subject:</B> RE: [mapguide-users] set and zoom to
selection<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face="Trebuchet MS" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Trebuchet MS'">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 face="Trebuchet MS" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Trebuchet MS'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Trebuchet MS" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Trebuchet MS'">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 face="Trebuchet MS" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Trebuchet MS'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Trebuchet MS" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Trebuchet MS'">Any idea what
Im doing wrong here?<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Trebuchet MS" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Trebuchet MS'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
queryOptions.SetFilter(filter);<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
featureReader.ReadNext();<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" color=green size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
selection.AddFeatures(layer, featureReader, 0);<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
<FONT color=teal><SPAN style="COLOR: teal">String</SPAN></FONT> selectionXml =
selection.ToXml();</SPAN></FONT><FONT face="Trebuchet MS" color=blue
size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Trebuchet MS'"><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Trebuchet MS" color=blue size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Trebuchet MS'"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; 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> MapGuide Users Mail
List<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 face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal
style="MARGIN-LEFT: 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"><![if !supportLists]><FONT
face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'"><SPAN
style="mso-list: Ignore">-<FONT face="Times New Roman" size=1><SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face="Trebuchet MS"
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'">Get parcel id
from user<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal
style="MARGIN-LEFT: 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"><![if !supportLists]><FONT
face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'"><SPAN
style="mso-list: Ignore">-<FONT face="Times New Roman" size=1><SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face="Trebuchet MS"
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'">Return link to
parcel <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal
style="MARGIN-LEFT: 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"><![if !supportLists]><FONT
face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'"><SPAN
style="mso-list: Ignore">-<FONT face="Times New Roman" size=1><SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face="Trebuchet MS"
size=2><SPAN style="FONT-SIZE: 10pt; 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: 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"><![if !supportLists]><FONT
face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'"><SPAN
style="mso-list: Ignore">-<FONT face="Times New Roman" size=1><SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></FONT></SPAN></SPAN></FONT><![endif]><FONT face="Trebuchet MS"
size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'">User can then
select parcel to display parcel attributes<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; 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 face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'">Many
thanks,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face="Trebuchet MS" size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'">Greg<o:p></o:p></SPAN></FONT></P></DIV>
<P>
<HR SIZE=1>
<P></P><BR>
<P><STRONG><BR>The substance of this message, including any attachments, may
be<BR>confidential, legally<BR>privileged and/or exempt from disclosure pursuant
to Massachusetts<BR>law. It is intended<BR>solely for the addressee. If you
received this in error, please<BR>contact the sender and<BR>delete the material
from any computer.<BR></STRONG></P></BODY></HTML>