[mapguide-users] Error in highlighting multiple polygons on map

anand anand.speck at gmail.com
Mon Jul 18 04:51:43 EDT 2011


hi all,

I'm using MGOS 2.0 with .net 2.0 with windows xp. Earlier I used to
highlight multiple parcels (polygons) on map by using shape file, but now
instead of shape file i'm getting spatial data from SQL Server 2008. Till
now everything is fine, but i cannot display multiple parcels (polygons) on
map.

The following is the code i'm using to highlight map: 

Dim requestParams As NameValueCollection = IIf(Request.HttpMethod = "POST",
Request.Form, Request.QueryString)
                Dim sessionId As String = Request.QueryString("SESSION")
                Dim realPath As String =
Request.ServerVariables("APPL_PHYSICAL_PATH")
                Dim configPath As String = realPath + "webconfig.ini"
                MapGuideApi.MgInitializeWebTier(configPath)
                Dim userInfo As MgUserInformation = New
MgUserInformation(sessionId)
                Dim siteConnection As MgSiteConnection = New
MgSiteConnection
                siteConnection.Open(userInfo)
                Dim resService As MgResourceService =
siteConnection.CreateService(MgServiceType.ResourceService)
                Dim featureService As MgFeatureService =
siteConnection.CreateService(MgServiceType.FeatureService)
                Dim nameQuery As MgFeatureQueryOptions = New
MgFeatureQueryOptions()
                Dim val As String = giscolumn1
                Dim queryval As String = strChaltaNo
                Dim totquery As String = val & " LIKE " & "'" & queryval &
"'"

                nameQuery.SetFilter(totquery)
                Dim tabname As String = propertylayer
                Dim map As MgMap = New MgMap(siteConnection)
                map.Open(oramap)
                
                Dim layer As MgLayer =
map.GetLayers().GetItem(propertylayer)
                Dim layerfeatures As MgFeatureReader =
layer.SelectFeatures(nameQuery)
                Dim layer1 As MgLayer =
map.GetLayers().GetItem(propertylayer)
                Dim selection As MgSelection = New MgSelection(map)
                selection.AddFeatures(layer1, layerfeatures, 0)
                Dim selectXML As String = selection.ToXml()




Is there anything i'm missing?? Please help me..


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Error-in-highlighting-multiple-polygons-on-map-tp6593928p6593928.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list