[mapguide-commits] r8354 - branches/2.6/MgDev/Common/Renderers

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Sep 23 23:22:24 PDT 2014


Author: jng
Date: 2014-09-23 23:22:24 -0700 (Tue, 23 Sep 2014)
New Revision: 8354

Modified:
   branches/2.6/MgDev/Common/Renderers/KmlRenderer.cpp
Log:
#2485: Clamp 0 line thickness to [some very small value > 0] for the KML renderer. This is what happens with the existing image-based renderers. The KML renderer should behave the same way. This way, when a layer is exported to KML, and 0 line/border thickness is specified, it will be clamped to some very small value so that Google Earth will still draw said lines.

Modified: branches/2.6/MgDev/Common/Renderers/KmlRenderer.cpp
===================================================================
--- branches/2.6/MgDev/Common/Renderers/KmlRenderer.cpp	2014-09-24 06:18:33 UTC (rev 8353)
+++ branches/2.6/MgDev/Common/Renderers/KmlRenderer.cpp	2014-09-24 06:22:24 UTC (rev 8354)
@@ -26,9 +26,9 @@
 
 #include "RenderUtil.h"
 
+const double MIN_KML_THICKNESS = 0.00001;
 const double ELEV_FACTOR = 0.1;
 
-
 //default constructor
 KmlRenderer::KmlRenderer(KmlContent* kmlContent,
                          RS_Bounds& extents,
@@ -685,7 +685,11 @@
         scale_factor = 1.0 / m_mapScale / m_pixelSize;
     }
 
-    return number * scale_factor;
+    double result = number * scale_factor;
+    //We cannot apply a thickness of 0 as this will cause Google Earth to draw nothing
+    //so if the thickness computes to 0, replace it with a very small value that's greater
+    //than 0
+    return result == 0.0 ? MIN_KML_THICKNESS : result;
 }
 
 



More information about the mapguide-commits mailing list