[mapserver-commits] r11463 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Apr 5 10:29:38 EDT 2011


Author: assefa
Date: 2011-04-05 07:29:38 -0700 (Tue, 05 Apr 2011)
New Revision: 11463

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapkmlrenderer.cpp
Log:
set layer's projection when it is not defined (#3809)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-04-05 14:08:53 UTC (rev 11462)
+++ trunk/mapserver/HISTORY.TXT	2011-04-05 14:29:38 UTC (rev 11463)
@@ -15,6 +15,8 @@
 Current Version (SVN trunk): 
 ---------------------------- 
 
+- KML: set layeer's projection when it is not defined (#3809)
+
 - Updated xml mapfile schema and xsl with the new lexer properties (#3735)
 
 - Updated PHP/MapScript for MS RFC 69: clustering. (#3700)

Modified: trunk/mapserver/mapkmlrenderer.cpp
===================================================================
--- trunk/mapserver/mapkmlrenderer.cpp	2011-04-05 14:08:53 UTC (rev 11462)
+++ trunk/mapserver/mapkmlrenderer.cpp	2011-04-05 14:29:38 UTC (rev 11463)
@@ -222,7 +222,7 @@
       return;
 
     /*turn of labelcache*/
-    layer->labelcache = MS_OFF;
+    //layer->labelcache = MS_OFF;
     
     /*if there are labels we want the coordinates to 
       be the center of the element.*/
@@ -510,6 +510,28 @@
         char epsg_string[100];
         rectObj sRect;
         projectionObj out;
+
+        /* for layer the do not have any projection set, set them with the current map
+           projection*/
+        if (projection && projection->numargs > 0)
+        {
+            layerObj *lp = NULL;
+            int i =0;
+            char *pszMapProjectString = msGetProjectionString(projection);
+            if (pszMapProjectString)
+            {
+                 for(i=0; i<map->numlayers; i++)
+                 {
+                     lp = GET_LAYER(map, i);
+                     if (lp->projection.numargs == 0 && lp->transform == MS_TRUE)
+                     {
+                          msFreeProjection(&lp->projection);
+                          msLoadProjectionString(&lp->projection, pszMapProjectString);
+                     }
+                 }
+                 msFree(pszMapProjectString);
+            }
+        }
         strcpy(epsg_string, "epsg:4326" );
         msInitProjection(&out);
         msLoadProjectionString(&out, epsg_string);



More information about the mapserver-commits mailing list