[mapguide-users] Selection problem after modify runtime map with MaestroAPI

Krug, Thomas Thomas.Krug at softPlan-Informatik.de
Fri Oct 1 10:33:46 EDT 2010


Hello,

the following code is used to add a layer from an template map to the
runtime map, where the required layergroup already exists:

MapGuideApi.MgInitializeWebTier(@"D:\Programme\Autodesk\MapGuideEnterprise20
11\WebServerExtensions\www\webconfig.ini");
LocalNativeConnection connection = new LocalNativeConnection(sessionId);
MapDefinition templateMap =
connection.GetMapDefinition("Library://TestProject/Maps/Project.MapDefinitio
n");
ResourceIdentifier resIdRuntimeMap = new ResourceIdentifier("Map",
ResourceTypes.RuntimeMap, sessionId);
RuntimeMap runtimeMap =
connection.GetRuntimeMap(resIdRuntimeMap.ResourceId);

MapLayerType layer =
templateMap.Layers[templateMap.Layers.IndexOf("testLayer")];
runtimeMap.Layers.Insert(runtimeMap.Layers.Count, new
RuntimeMapLayer(layer));
connection.SaveRuntimeMap(resIdRuntimeMap.ResourceId, runtimeMap);

In normal conditions the obove code runs successfully, getting a defined
layer from TemplateMap("Project") and inserting it to the runtime map.
However if the layer to be added is set as invisible at startup in the
template, elements from these layer become not highlighted after being
selected in the target runtime map.
When selecting an element from such a layer, the selection highlighting
fails to show the selected element, although the toolbar confirms one
element selected. Also getting the id of the element works. 
In such condition, the Mapviewernet tries to get the selection image:
	
/mapguide2011/mapagent/mapagent.fcgi?OPERATION=GETDYNAMICMAPOVERLAYIMAGE&FOR
MAT=PNG&VERSION=2.1.0&SESSION=f66f5f60-bcb9-11df-8000-005056c00008_de_7F0000
010AFC0AFB0AFA&MAPNAME=Map&SEQ=0.4188060987466432&CLIENTAGENT=Ajax%20Viewer&
BEHAVIOR=5&SELECTIONCOLOR=0x0000FFFF
But the result is an empty png.

If the layer is added interactively to the map with Maestor/MapGuide Studio,
all is working fine.
So it seems this problem occurs only when transfering a layer from template
to runtime programmatically.

I use MapGuide Enterprise 2011 with Maestro 2.1.0.

Any help would be appreciated.

Regards,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20101001/f5774e7f/attachment.html


More information about the mapguide-users mailing list