[mapguide-commits] r5548 - sandbox/adsk/2.2gp/Common/Renderers

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Feb 15 02:58:14 EST 2011


Author: liuar
Date: 2011-02-14 23:58:14 -0800 (Mon, 14 Feb 2011)
New Revision: 5548

Modified:
   sandbox/adsk/2.2gp/Common/Renderers/KmlRenderer.cpp
Log:
Port the fix to 2.2gp branch

KML styles can't be applied when integrated with GoogleMaps API (v3) unless removing some returns characters in the style section 

For example:

<Style id="6">
<LineStyle>
<color>
00000000
</color>
<width>
0.000000
</width>
</LineStyle>
<PolyStyle>
<color>
FFFF3CA0
</color>
</PolyStyle>
</Style>

To:

<Style id="6">
<LineStyle><color>00000000</color><width>0.000000</width></LineStyle>
<PolyStyle><color>FFFF3CA0</color></PolyStyle></Style>

Modified: sandbox/adsk/2.2gp/Common/Renderers/KmlRenderer.cpp
===================================================================
--- sandbox/adsk/2.2gp/Common/Renderers/KmlRenderer.cpp	2011-02-15 02:48:25 UTC (rev 5547)
+++ sandbox/adsk/2.2gp/Common/Renderers/KmlRenderer.cpp	2011-02-15 07:58:14 UTC (rev 5548)
@@ -541,25 +541,25 @@
         m_styleContent->WriteString(buffer);
 
         //outline
-        m_styleContent->WriteString("<LineStyle>");
-        m_styleContent->WriteString("<color>");
+        m_styleContent->WriteString("<LineStyle>",false);
+        m_styleContent->WriteString("<color>",false);
         RS_Color color = fill.outline().color();
         sprintf(buffer, "%.2X%.2X%.2X%.2X", color.alpha(), color.blue(), color.green(), color.red());
-        m_styleContent->WriteString(buffer);
-        m_styleContent->WriteString("</color>");
-        m_styleContent->WriteString("<width>");
+        m_styleContent->WriteString(buffer,false);
+        m_styleContent->WriteString("</color>",false);
+        m_styleContent->WriteString("<width>",false);
         sprintf(buffer, "%f", key.m_lineWidth);
-        m_styleContent->WriteString(buffer);
-        m_styleContent->WriteString("</width>");
+        m_styleContent->WriteString(buffer,false);
+        m_styleContent->WriteString("</width>",false);
         m_styleContent->WriteString("</LineStyle>");
 
         //fill
-        m_styleContent->WriteString("<PolyStyle>");
-        m_styleContent->WriteString("<color>");
+        m_styleContent->WriteString("<PolyStyle>",false);
+        m_styleContent->WriteString("<color>",false);
         color = fill.color();
         sprintf(buffer, "%.2X%.2X%.2X%.2X", color.alpha(), color.blue(), color.green(), color.red());
-        m_styleContent->WriteString(buffer);
-        m_styleContent->WriteString("</color>");
+        m_styleContent->WriteString(buffer,false);
+        m_styleContent->WriteString("</color>",false);
         m_styleContent->WriteString("</PolyStyle>");
 
         //icon
@@ -603,16 +603,16 @@
         m_styleContent->WriteString(buffer);
 
         //line style
-        m_styleContent->WriteString("<LineStyle>");
-        m_styleContent->WriteString("<color>");
+        m_styleContent->WriteString("<LineStyle>",false);
+        m_styleContent->WriteString("<color>",false);
         RS_Color color = lsym.color();
         sprintf(buffer, "%.2X%.2X%.2X%.2X", color.alpha(), color.blue(), color.green(), color.red());
-        m_styleContent->WriteString(buffer);
-        m_styleContent->WriteString("</color>");
-        m_styleContent->WriteString("<width>");
+        m_styleContent->WriteString(buffer,false);
+        m_styleContent->WriteString("</color>",false);
+        m_styleContent->WriteString("<width>",false);
         sprintf(buffer, "%f", key.m_width);
         m_styleContent->WriteString(buffer);
-        m_styleContent->WriteString("</width>");
+        m_styleContent->WriteString("</width>",false);
         m_styleContent->WriteString("</LineStyle>");
 
         m_styleContent->WriteString("</Style>");



More information about the mapguide-commits mailing list