[mapguide-commits] r5657 - in sandbox/adsk/2.2gp: Common/Renderers Server/src/Services/Kml

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Mar 23 01:51:23 EDT 2011


Author: liuar
Date: 2011-03-22 22:51:23 -0700 (Tue, 22 Mar 2011)
New Revision: 5657

Modified:
   sandbox/adsk/2.2gp/Common/Renderers/KmlRenderer.cpp
   sandbox/adsk/2.2gp/Server/src/Services/Kml/ServerKmlService.cpp
Log:
Fix break build in Windows and Linux

Modified: sandbox/adsk/2.2gp/Common/Renderers/KmlRenderer.cpp
===================================================================
--- sandbox/adsk/2.2gp/Common/Renderers/KmlRenderer.cpp	2011-03-22 11:12:10 UTC (rev 5656)
+++ sandbox/adsk/2.2gp/Common/Renderers/KmlRenderer.cpp	2011-03-23 05:51:23 UTC (rev 5657)
@@ -633,7 +633,50 @@
     m_kmlContent->WriteString(buffer);
 }
 
+void KmlRenderer::WriteStyle(double scale, const std::wstring& href)
+{
+    if (m_styleContent == NULL)
+    {
+        m_styleContent = new KmlContent();
+    }
 
+    char buffer[256];
+    int thisStyleId = 0;
+    KmlIconStyle key(1, href);
+    KmlIconStyleIdMap::iterator iter = m_iconStyleMap.find(key);
+    if (iter != m_iconStyleMap.end())
+    {
+        thisStyleId = (*iter).second;
+    }
+    else
+    {
+        thisStyleId = m_iconStyleMap[key] = m_styleId;
+
+        //write the style definitions into the style storage
+        sprintf(buffer, "<Style id=\"%d\">", m_styleId++);
+        m_styleContent->WriteString(buffer);
+
+        //line style
+        m_styleContent->WriteString("<IconStyle>",false);
+        m_styleContent->WriteString("<scale>",false);
+        sprintf(buffer, "%f", scale);
+        m_styleContent->WriteString(buffer,false);
+        m_styleContent->WriteString("</scale>",false);
+        m_styleContent->WriteString("<Icon>",false);
+        m_styleContent->WriteString("<href>",false);
+        m_styleContent->WriteString(href,false);
+        m_styleContent->WriteString("</href>",false);
+        m_styleContent->WriteString("</Icon>",false);
+        m_styleContent->WriteString("</IconStyle>");
+
+        m_styleContent->WriteString("</Style>");
+    }
+
+    //write a style reference into the main document
+    sprintf(buffer, "<styleUrl>#%d</styleUrl>", thisStyleId);
+    m_kmlContent->WriteString(buffer);
+}
+
 double KmlRenderer::_MeterToPixels(RS_Units unit, double number)
 {
     double scale_factor;
@@ -686,16 +729,6 @@
 }
 
 
-void KmlRenderer::DrawScreenRaster(unsigned char* data, int length,
-                                   RS_ImageFormat format, int native_width, int native_height,
-                                   double x, double y, double w, double h, double angleDeg,
-                                   double alpha)
-{
-    RenderUtil::DrawScreenRaster(this, data, length, format, native_width, native_height,
-                                 x, y, w, h, angleDeg, alpha);
-}
-
-
 void KmlRenderer::DrawScreenText(const RS_TextMetrics&  /*tm*/,
                                  RS_TextDef&      /*tdef*/,
                                  double           /*insx*/,

Modified: sandbox/adsk/2.2gp/Server/src/Services/Kml/ServerKmlService.cpp
===================================================================
--- sandbox/adsk/2.2gp/Server/src/Services/Kml/ServerKmlService.cpp	2011-03-22 11:12:10 UTC (rev 5656)
+++ sandbox/adsk/2.2gp/Server/src/Services/Kml/ServerKmlService.cpp	2011-03-23 05:51:23 UTC (rev 5657)
@@ -944,7 +944,7 @@
                             for(int l = 0; l < symbolInstanceCollection->GetCount(); l++)
                             {
                                 MdfModel::SymbolInstance* symbolInstance = symbolInstanceCollection->GetAt(l);
-                                if(symbolInstance->GetGeometryContext() == MdfModel::SymbolInstance::GeometryContext::gcPoint)
+                                if(symbolInstance->GetGeometryContext() == MdfModel::SymbolInstance::gcPoint)
                                 {
                                     MgUtil::Int32ToString(++categoryIndex,strCategoryIndex);
                                 }



More information about the mapguide-commits mailing list