Nice idea.
You could do the same with the runtime map, which would ease the
pre-creation/modification of maps.
If the user presses the reload button, the map would stay the same, as
would the selection.
Is this a problem, and do you have and idea for a workaround?
Regards, Kenneth Skovhede, GEOGRAF A/S
Bruno Scott skrev:
I could propose a patch to fix that problem
The idea would be to verify if the Session://...MapDefinition exist
If it already exist, do not overwrite
Something like this
bool mapStateIdExist = true;
MgResourceIdentifier mapStateId = new
MgResourceIdentifier("Session:" + sessionId + "//" + mapName + "." +
MgResourceType.Map);
try
{
MgByteReader tmpReader =
resourceSrvc.GetResourceContent(mapStateId);
}
catch(MgException mge)
{
mapStateIdExist = false;
}
Then use the mapStateIdExist flag
//if MapStateId exist, we should not erase the selection
if(!mapStateIdExist)
{
//create an empty selection object and store it in the session
repository
MgSelection sel = new MgSelection(map);
sel.Save(resourceSrvc, mapName);
}
and
//if MapStateId exist, we should not overwrite it
if(!mapStateIdExist)
{
map.Save(resourceSrvc, mapStateId);
}
_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users