[mapguide-users] Re: Maestro API 4 - On new versions, there should be no layer data in map

Hans Milling hm at geograf.dk
Wed Dec 7 06:56:50 EST 2011


Hi Jackie

Yes it is the AIMS 2012. If I cut the bits and pieces from my application
that involves the map, these are the steps that produces the error:

Uri host = new Uri("http://msvm/mapserver2012/mapagent/mapagent.fcgi");
IServerConnection conn =
ConnectionProviderRegistry.CreateConnection("Maestro.Http", "Url",
host.ToString(), "Username", "Administrator", "Password", "admin");
IMappingService mapSvc =
(IMappingService)conn.GetService((int)ServiceType.Mapping);
string mapdefinition = "Library://Byggesag/ByggesagKort.MapDefinition";
ResourceIdentifier rtmX = new ResourceIdentifier(mapdefinition);
string rtmDef = "Library://Runtime data cache/" + rtmX.Fullpath.Replace(":",
"_").Replace("/", "_");
string mapName = rtmX.Name;
mapid = new ResourceIdentifier(mapName, ResourceTypes.RuntimeMap,
con.SessionID);
IMapDefinition mdef =
(IMapDefinition)con.ResourceService.GetResource(mapdefinition);
IMappingService mSvc =
(IMappingService)con.GetService((int)ServiceType.Mapping);
RuntimeMap rtm = mSvc.CreateMap(mdef); // Create new runtime map
rtm.Save();
RuntimeMap tmprtm = mSvc.CreateMap(mapid, mdef); // Create new map in data
cache
tmprtm.Save();

Later on I do this to retrieve the map and then it fails (the mapid has been
stored in session variable or something)
RuntimeMap mymap = mapSvc.OpenMap(mapid);

Hans...

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Maestro-API-4-On-new-versions-there-should-be-no-layer-data-in-map-tp7069684p7070242.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list