[mapguide-users] Problems add LayerDefinition to MapDefinition (MaestroAPI 4.0)

Gunter Becker gunter.becker at csogis.de
Tue Nov 29 06:57:59 EST 2011


Hi, 

my application allows it to make a new MapDefinition from the current
RuntimeMap. When trying to iterate over the RuntimeMapLayerCollection to
create the IMapLayer

    mapDef.AddLayer(rtLayer.Group, rtLayer.Name, rtLayer.LayerDefinitionID);

an error occurs on layers that have a FeatureSource that refrence a
DataStore with no objects (empty SDF in SessionRepository for redlining).
Seems that Maestro checks the extent of every layer when adding them to the
MapDefinition. The error happens in line 1572 of PlatformConnectionBase.cs.

What is the reason for this check and could the MaestroAPI be changed to
avoid this. My code worked fine with the MaestroAPI 2.x. Maybe there is
another workaround for my problem.

Thanks, Gunter

Here is the StackTrace:

   at
OSGeo.MapGuide.ObjectModels.Common.FdoSpatialContextListSpatialContext.OSGeo.MapGuide.ObjectModels.Common.IFdoSpatialContext.get_Extent()
in C:\Users\gunter.becker.CSO\Documents\Visual Studio
2010\Projects\Maestro4\OSGeo.MapGuide.MaestroAPI\ObjectModels\IFdoSpatialContext.cs:Zeile
113.
   at
OSGeo.MapGuide.ObjectModels.LayerDefinition.LayerDefinitionExtensions.GetSpatialExtent(ILayerDefinition
layer, Boolean allowFallbackToContextInformation, String& csWkt) in
C:\Users\gunter.becker.CSO\Documents\Visual Studio
2010\Projects\Maestro4\OSGeo.MapGuide.MaestroAPI\ObjectModels\LayerInterfaceExtensions.cs:Zeile
265.
   at
OSGeo.MapGuide.ObjectModels.MapDefinition_1_0_0.MapDefinition.OnFirstLayerAdded(MapLayerType
layer) in C:\Users\gunter.becker.CSO\Documents\Visual Studio
2010\Projects\Maestro4\OSGeo.MapGuide.MaestroAPI\ObjectModels\MapDefinition.cs:Zeile
288.
   at
OSGeo.MapGuide.ObjectModels.MapDefinition_1_0_0.MapDefinition.AddLayer(String
groupName, String layerName, String resourceId) in
C:\Users\gunter.becker.CSO\Documents\Visual Studio
2010\Projects\Maestro4\OSGeo.MapGuide.MaestroAPI\ObjectModels\MapDefinition.cs:Zeile
278.
   at
CSOGIS.Core.MapGuide.CsoRuntimeMap.CreateMapDefinition(MgResourceIdentifier
newMapDefinitionId, Boolean preserveSessionResources) in
C:\Users\gunter.becker.CSO\Documents\Visual Studio
2010\Projects\CSOGIS\Core\MapGuide\CsoRuntimeMap.cs:Zeile 1251.



--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Problems-add-LayerDefinition-to-MapDefinition-MaestroAPI-4-0-tp7042582p7042582.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list