[mapserver-commits] r10761 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Thu Nov 25 11:49:42 EST 2010


Author: assefa
Date: 2010-11-25 08:49:42 -0800 (Thu, 25 Nov 2010)
New Revision: 10761

Modified:
   trunk/mapserver/mapkmlrenderer.cpp
Log:
use layer's opacity for groundlayers

Modified: trunk/mapserver/mapkmlrenderer.cpp
===================================================================
--- trunk/mapserver/mapkmlrenderer.cpp	2010-11-24 17:29:47 UTC (rev 10760)
+++ trunk/mapserver/mapkmlrenderer.cpp	2010-11-25 16:49:42 UTC (rev 10761)
@@ -350,7 +350,7 @@
    FILE *tmpFile = NULL;
     
    tmpFileName = msTmpFile(MapPath, image->imagepath, "png");
-   tmpFile = fopen(tmpFileName,"w");
+   tmpFile = fopen(tmpFileName,"wb");
    if (tmpFile)
    {
      
@@ -719,11 +719,17 @@
           </GroundOverlay>
           </kml>
 	*/
-
+    char	layerHexColor[32];
     xmlNodePtr groundOverlayNode = xmlNewChild(parentNode, NULL, BAD_CAST "GroundOverlay", NULL);
     char *layerName = getLayerName(layer);
     xmlNewChild(groundOverlayNode, NULL, BAD_CAST "name", BAD_CAST layerName);
-    xmlNewChild(groundOverlayNode, NULL, BAD_CAST "color", BAD_CAST "ffffffff");
+    if (layer->opacity > 0 && layer->opacity < 100)
+    {
+        sprintf(layerHexColor, "%02xffffff", MS_NINT(layer->opacity*2.55));
+        xmlNewChild(groundOverlayNode, NULL, BAD_CAST "color", BAD_CAST layerHexColor);
+    }
+    else
+      xmlNewChild(groundOverlayNode, NULL, BAD_CAST "color", BAD_CAST "ffffffff");
     char stmp[20];
     sprintf(stmp, "%d",layer->index);
     xmlNewChild(groundOverlayNode, NULL, BAD_CAST "drawOrder", BAD_CAST stmp);



More information about the mapserver-commits mailing list