[mapguide-users] Maestro 3.5 Exception on CreateMap

djonio DJonio at miami-airport.com
Tue Nov 22 14:36:56 EST 2011


Maestro 3.5 SDK
MGOS 2.2 x64
IIS 7.5
CreateMap produces the exception. Same map definition works w/interactive
Maestro _Preview_.

THIS: IMappingService mapSvc =
(IMappingService)MGConn.GetService((int)ServiceType.Mapping);
         IMapDefinition mapDef =
(IMapDefinition)MGConn.ResourceService.GetResource(sb_mapdef.ToString());
         rtMapName = mapDef.Name;
         rtMapID = new ResourceIdentifier(rtMapName,
ResourceTypes.RuntimeMap, MGConn.SessionID);
                try
                {
                    rtMap = mapSvc.CreateMap(mapDef);
                }
                catch (System.Exception)
                {
		}

EXCEPTION:
		$exception	{"Unable to cast object of type
'OSGeo.MapGuide.ObjectModels.UntypedResource' to type
'OSGeo.MapGuide.ObjectModels.LayerDefinition.ILayerDefinition'."}
System.Exception {System.InvalidCastException}


STACK TRACE:
   at OSGeo.MapGuide.MaestroAPI.Mapping.RuntimeMap.GetLayerDefinition(String
layerDefinitionId) in
d:\Workspace\maestro-trunk\OSGeo.MapGuide.MaestroAPI\Mapping\RuntimeMap.cs:line
1068
   at OSGeo.MapGuide.MaestroAPI.Mapping.RuntimeMap..ctor(IMapDefinition mdf,
Double metersPerUnit) in
d:\Workspace\maestro-trunk\OSGeo.MapGuide.MaestroAPI\Mapping\RuntimeMap.cs:line
265
   at OSGeo.MapGuide.MaestroAPI.PlatformConnectionBase.CreateMap(String
runtimeMapResourceId, IMapDefinition mdf, Double metersPerUnit) in
d:\Workspace\maestro-trunk\OSGeo.MapGuide.MaestroAPI\PlatformConnectionBase.cs:line
1802
   at OSGeo.MapGuide.MaestroAPI.PlatformConnectionBase.CreateMap(String
runtimeMapResourceId, IMapDefinition mdf) in
d:\Workspace\maestro-trunk\OSGeo.MapGuide.MaestroAPI\PlatformConnectionBase.cs:line
1790
   at
OSGeo.MapGuide.MaestroAPI.HttpServerConnection.OSGeo.MapGuide.MaestroAPI.Services.IMappingService.CreateMap(String
, IMapDefinition )
   at newAPIs.theApp.InitMGOSMap() in
C:\MDADMGMapImage22\newAPIs\Program.cs:line 106
   at newAPIs.theApp..ctor(MapImageGenInParam param) in
C:\MDADMGMapImage22\newAPIs\Program.cs:line 55
   at newAPIs.Program.Main(String[] args) in
C:\MDADMGMapImage22\newAPIs\Program.cs:line 45
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[]
args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

r,
dennis

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Maestro-3-5-Exception-on-CreateMap-tp7021648p7021648.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list