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. _______________________________________________ mapguide-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapguide-users
