[mapserver-commits] r10768 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Nov 26 16:06:42 EST 2010


Author: assefa
Date: 2010-11-26 13:06:42 -0800 (Fri, 26 Nov 2010)
New Revision: 10768

Modified:
   trunk/mapserver/mapkmlrenderer.cpp
Log:
use ows_description and ows_include_items

Modified: trunk/mapserver/mapkmlrenderer.cpp
===================================================================
--- trunk/mapserver/mapkmlrenderer.cpp	2010-11-26 21:04:43 UTC (rev 10767)
+++ trunk/mapserver/mapkmlrenderer.cpp	2010-11-26 21:06:42 UTC (rev 10768)
@@ -213,13 +213,14 @@
 void KmlRenderer::processLayer(layerObj *layer)
 {
     int i;
+    const char *asRaster = NULL;
     if (!layer)
       return;
 
     /*turn of labelcache*/
     layer->labelcache = MS_OFF;
     
-    /*if there are labels we want to coordinates to 
+    /*if there are labels we want the coordinates to 
       be the center of the element.*/
     for(i=0; i<layer->numclasses; i++)
       layer->_class[i]->label.position = MS_XY;
@@ -228,13 +229,21 @@
       the new rendering architecture does not allow
       to know if we are dealing with a multi-style.
       So here we remove all styles beside the first one*/
-    /*
+    
     for(i=0; i<layer->numclasses; i++)
     {
         while (layer->_class[i]->numstyles > 1)
           msDeleteStyle(layer->_class[i], layer->_class[i]->numstyles-1);
     }
-    */
+
+    /*if layer has a metadata KML_OUTPUTASRASTER set to true, add a processing directive
+      to use an agg driver*/
+    asRaster = msLookupHashTable(&layer->metadata, "kml_outputasraster");
+    if (asRaster && (strcasecmp(asRaster, "true") == 0 ||
+                     strcasecmp(asRaster, "yes") == 0))
+      msLayerAddProcessing(layer, "RENDERER=png24");
+      
+    
 }
 
 char* KmlRenderer::getLayerName(layerObj *layer)
@@ -349,8 +358,12 @@
 
      if (msLookupHashTable(&layer->metadata, "kml_description"))
        pszLayerDescMetadata = msLookupHashTable(&layer->metadata, "kml_description");
-     
+     else if (msLookupHashTable(&layer->metadata, "ows_description"))
+        pszLayerDescMetadata = msLookupHashTable(&layer->metadata, "ows_description");
+
      value=msLookupHashTable(&layer->metadata, "kml_include_items");
+     if (!value)
+       value=msLookupHashTable(&layer->metadata, "ows_include_items");
      if (value)
        papszLayerIncludeItems = msStringSplit(value, ',', &nIncludeItems);
 



More information about the mapserver-commits mailing list