[mapguide-users] Error when instantiating a Map via MgMap.Open() method

Maksim Sestic max at geoinova.com
Thu Oct 11 05:26:09 EDT 2007


Hi all,

It's about MGE 2008 and instantiating MpMap type via MgMap.Open() method. It
throws an exception saying that "Resource was not found". I tried various
types of parameters on overloaded Open method and none of them worked,
throwing the same exception. Necessary connection and services were
instantiated just fine. It always dies at the MgMap.Open(...) line:

(Method 1 - via Library ResourceIdentifier)
Dim svc As MgResourceService = CType(Me.SiteConnection.CreateService(0),
MgResourceService)
Dim m As MgMap = New MgMap()
Dim id As String = "Library://...(path to my map)..."
Dim resId As MgResourceIdentifier = New MgResourceIdentifier(id)
m.Open(svc, id)

(Method 2 - via Map name)
Dim svc As MgResourceService = CType(Me.SiteConnection.CreateService(0),
MgResourceService)
Dim m As MgMap = New MgMap()
m.Open(svc, "NameOfMyMap")

(Method 3 - via Session + Map name)
Dim site As MgSite = New MgSite
site.Open(Me.UserInformation)
dim sessionId As String = site.CreateSession
Dim svc As MgResourceService = CType(Me.SiteConnection.CreateService(0),
MgResourceService)
Dim id As String = "Session:"+sessionId+"//NameOfMyMap"
Dim resId As MgResourceIdentifier = New MgResourceIdentifier(id)
m.Open(svc, id)

and few other methods but none of them worked :-)

Is there any help to this?

Regards,
Maksim Sestic

-- 
View this message in context: http://www.nabble.com/Error-when-instantiating-a-Map-via-MgMap.Open%28%29-method-tf4606044s16610.html#a13152257
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list