[mapguide-users] Re: Upgrading MaestroAPI
Gunter Becker
gunter.becker at csogis.de
Thu Dec 1 07:48:47 EST 2011
OK,
now I've tested this piece of code I guessed it would be right, but it
doesn't work!
>
> // Create a new ResourcIdentifier for the new LayerDefinition
> ResourceIdentifier newResourceID = new ResourceIdentifier(layerName,
> ResourceTypes.LayerDefinition, Connection.SessionID);
>
> // Saving the LayerDefinition first
> Connection.ResourceService.SaveResourceAs(newLayerDefinition,
> newResourceID);
>
> // Create a new RuntimeLayer from the just saved LayerDefinition and
> assign it to the old one
> runMapLayer = runtimeMap.CreateLayer(newResourceID,
> runtimeMap.GetGroupByName(runMapLayer.Group));
>
>
I certainly can remove the old layer and add the newly created one to the
map. But it seems like a little overhead to me.
Jackie, what is the reason for making the FeatureSourceID-property of the
RuntimeMapLayer private. Any chance to make it public so that the code works
like the old way? Looks much smarter to me:
>
> // Create a new ResourcIdentifier for the new LayerDefinition and
> assign it to the RuntimeMapLayer
> runMapLayer.LayerDefinitionID = new ResourceIdentifier(layerName,
> ResourceTypes.LayerDefinition,Connection.SessionID);
>
> // Saving the LayerDefinition and RuntimeMap
> Connection.ResourceService.SaveResourceAs(newLayerDefinition,
> runMapLayer.LayerDefinitionID);
> runtimeMap.Save();
>
>
Thanks, Gunter
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Upgrading-MaestroAPI-tp7019938p7050393.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list