[mapguide-users] Zoom to extent of single selected polygon

sathishpsk9 sathishpsk9 at gmail.com
Thu Aug 6 03:16:17 EDT 2009


Hi tejaswi 
            I had a feature selection problem ..
 my code :


                Dim resService1 As MgResourceService =
CType(siteConnection.CreateService(MgServiceType.ResourceService),
MgResourceService)
                Dim featureService1 As MgFeatureService =
CType(siteConnection.CreateService(MgServiceType.FeatureService),
MgFeatureService)
                Dim fetresource1 As MgResourceIdentifier = New
MgResourceIdentifier("Library://SonshpProp/imcshpprop.FeatureSource")
                Dim nameQuery1 As MgFeatureQueryOptions = New
MgFeatureQueryOptions()
                Dim val1 As String = "PARCEL_ID"
                nameQuery1.AddFeatureProperty(val1)
                Dim queryval1 As String = Session("id1")
                Dim totquery1 As String = val1 + "=" + "'" + queryval1 + "'"
                nameQuery1.SetFilter(totquery1)
                Dim layer1 As MgLayer = map.GetLayers().GetItem("PROPERTY
LAYER")



                Dim featureReader1 As MgFeatureReader =
featureService1.SelectFeatures(fetresource1, layer1.GetFeatureClassName(),
nameQuery1)
                Dim byrdr As MgByteReader = featureReader1.ToXml()
                Dim str As String = byrdr.ToString()
                Dim selection As MgSelection = New MgSelection(map)
                'selection.FromXml(str)
                selection.AddFeatures(layer1, featureReader1, 0)
                selection.Save(resService1, "map")
                Dim selectXML As String = selection.ToXml()


                Page.ClientScript.RegisterStartupScript(Page.GetType(),
"test", "select(" & selectXML & "')", True)

and 
 i found there data in selectXML...

I hope you have solved this problem..........
am i doing doing it right .....Please help..........

Thanking you in anticipation
Satish ....
-- 
View this message in context: http://n2.nabble.com/Zoom-to-extent-of-single-selected-polygon-tp3370796p3396736.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list