[mapguide-users] Working with the current selection

Berdel, Brian brian.berdel at mcmtrans.com
Tue Apr 18 10:11:08 EDT 2006


Has anyone been able to work with the active selection in a map?  (I am
working with the sample in the development guide (Page 39-40)

I keep getting an error saying:  

Message	"Resource was not found:
Session:72234676-0000-1000-8004-00142260e7d1_en//myMap.Selection"
String

I am able to open the map and the session is valid.  I am basically
copying the code (although I am converting to asp.net..)

Here is some of the code:

Dim mgSessionId As String = GetParameters()("SESSION")
Dim matches As Integer = 0  ' Variable to control output results.
Dim mapUpdated As Boolean = False
MapGuideApi.InitializeSockets()
InitializeWebTier()

Dim userInfo As MgUserInformation = New MgUserInformation(mgSessionId)
Dim siteConnection As MgSiteConnection = New MgSiteConnection
siteConnection.Open(userInfo)
Dim resourceService As MgResourceService =
siteConnection.CreateService(MgServiceType.ResourceService)
Dim featureService As MgFeatureService =
siteConnection.CreateService(MgServiceType.FeatureService)
Dim queryOptions As New MgFeatureQueryOptions
Dim map As New MgMap
map.Open(resourceService, "myMap")
Dim Selection As New MgSelection(map)

ERROR OCCURS at the line below
Selection.Open(resourceService, "myMap")

Thanks for any suggestions






More information about the Mapguide-users mailing list