[mapguide-commits] r1057 - trunk/MgDev/Common/Stylization

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Jan 18 13:04:40 EST 2007


Author: waltweltonlair
Date: 2007-01-18 13:04:40 -0500 (Thu, 18 Jan 2007)
New Revision: 1057

Modified:
   trunk/MgDev/Common/Stylization/EMapUpdateRenderer.cpp
Log:
This bug happens with DWF Viewer when removing layers programmatically from
the map in web tier code.  The information needed to remove the layer from
the viewer would not get encoded properly by the server.

In EMapUpdateRenderer::CmdRemoveLayer the code tries to get the RS_LayerUIInfo
for the removed layer.  But since the layer was removed that information was
never added to the m_hLayerInfoMap.  The result is that the layer guid set
in the DWFEMapUpdateLayerCommand is empty, and therefore the viewer doesn't
know which layer to remove.

The same problem occurs in EMapUpdateRenderer::CmdRemoveLayerGroup.

The fix is simply to use the passed in guid.


Modified: trunk/MgDev/Common/Stylization/EMapUpdateRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/EMapUpdateRenderer.cpp	2007-01-17 01:23:22 UTC (rev 1056)
+++ trunk/MgDev/Common/Stylization/EMapUpdateRenderer.cpp	2007-01-18 18:04:40 UTC (rev 1057)
@@ -378,14 +378,11 @@
 
 void EMapUpdateRenderer::CmdRemoveLayer(const RS_String& guid)
 {
-    //get the previously accumulated layer information
-    RS_LayerUIInfo layerInfo = m_hLayerInfoMap[guid];
+    //verify the guid is valid
+    _ASSERT(!guid.empty());
 
-    //see if we actually got a valid structure
-    _ASSERT(!layerInfo.guid().empty());
-
     DWFEMapRemoveLayerCommand* cmd = DWFCORE_ALLOC_OBJECT (
-                                    DWFEMapRemoveLayerCommand( layerInfo.guid().c_str()));
+                                    DWFEMapRemoveLayerCommand( guid.c_str()));
 
     ((DWFEMapTransactionSection*)m_pPage)->addCommand(cmd);
 }
@@ -443,14 +440,11 @@
 
 void EMapUpdateRenderer::CmdRemoveLayerGroup(const RS_String& guid)
 {
-    //get the previously accumulated layer information
-    RS_LayerUIInfo layerInfo = m_hGroups[guid];
+    //verify the guid is valid
+    _ASSERT(!guid.empty());
 
-    //see if we actually got a valid structure
-    _ASSERT(!layerInfo.guid().empty());
-
     DWFEMapRemoveLayerGroupCommand* cmd = DWFCORE_ALLOC_OBJECT (
-                                    DWFEMapRemoveLayerGroupCommand( layerInfo.guid().c_str()));
+                                    DWFEMapRemoveLayerGroupCommand( guid.c_str()));
 
     ((DWFEMapTransactionSection*)m_pPage)->addCommand(cmd);
 }



More information about the mapguide-commits mailing list