[mapguide-commits] r5479 - trunk/MgDev/Common/Renderers

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Dec 19 22:10:10 EST 2010


Author: liuar
Date: 2010-12-19 19:10:10 -0800 (Sun, 19 Dec 2010)
New Revision: 5479

Modified:
   trunk/MgDev/Common/Renderers/KmlRenderer.cpp
Log:
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: trunk/MgDev/Common/Renderers/KmlRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Renderers/KmlRenderer.cpp	2010-12-19 18:44:30 UTC (rev 5478)
+++ trunk/MgDev/Common/Renderers/KmlRenderer.cpp	2010-12-20 03:10:10 UTC (rev 5479)
@@ -535,25 +535,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
@@ -597,16 +597,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