[mapguide-users] .NET Basic Example Issues (Hello World?)

Rock Beans rockbeans at gmail.com
Mon Nov 2 15:31:34 EST 2009


I create a session then use session to create site connection. I then
have issues with map.open(). I tried map name "Sheboygan" and I tried
using a resource indentifier. What am I doing wrong?

MapGuideApi.MgInitializeWebTier("C:\\Program Files
(x86)\\OSGeo\\MapGuide\\Web\\www\\webconfig.ini");
MgUserInformation userInfo = new MgUserInformation("Anonymous", "");
MgSite site = new MgSite();
site.Open(userInfo);
String mgSessionId = site.CreateSession();


MgUserInformation userInfoSession = new MgUserInformation(mgSessionId);
MgSiteConnection siteConnection = new MgSiteConnection();
siteConnection.Open(userInfoSession);


//MgResourceIdentifier resourceId = new
MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");


//create resource services
MgResourceService resourceSrvc =
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);


MgResourceIdentifier resourceId = new
MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");

MgMap map = new MgMap();
map.Create(resourceId, mapName);
map.Open(resourceSrvc, mapName)y


More information about the mapguide-users mailing list