[mapserver-commits] r9664 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Jan 4 12:10:20 EST 2010


Author: tamas
Date: 2010-01-04 12:10:19 -0500 (Mon, 04 Jan 2010)
New Revision: 9664

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapdraw.c
Log:
Changed the query map rendering implementation without adding extra layers to the map (#3069)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2010-01-04 17:08:55 UTC (rev 9663)
+++ trunk/mapserver/HISTORY.TXT	2010-01-04 17:10:19 UTC (rev 9664)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Changed the query map rendering implementation without adding extra layers to the map (#3069)
+
 - SQL Server 2008 plugin is not handling null field values correctly (#2893)
 
 - Hatch symbol not properly saved (#2905)

Modified: trunk/mapserver/mapdraw.c
===================================================================
--- trunk/mapserver/mapdraw.c	2010-01-04 17:08:55 UTC (rev 9663)
+++ trunk/mapserver/mapdraw.c	2010-01-04 17:10:19 UTC (rev 9664)
@@ -1142,30 +1142,18 @@
   ** single-pass queries we have to make a copy of the layer and work from it instead.
   */
   if(map->querymap.style == MS_NORMAL || map->querymap.style == MS_HILITE) {
-    char *tmp_name=NULL;
-    layerObj *tmp_layer=NULL;
+    layerObj tmp_layer;
 
-    tmp_name = (char *) malloc((strlen(layer->name)+5+1)*sizeof(char));
-    sprintf(tmp_name, "%s_copy", layer->name);
+    if(initLayer(&tmp_layer, map) == -1) 
+		return(MS_FAILURE);
 
-    i = msGetLayerIndex(map, tmp_name);
-    if(i == -1) {
-      if(msGrowMapLayers(map) == NULL) return(MS_FAILURE);
-      i = map->numlayers;
-      map->layerorder[i] = i; /* important! */
-      map->numlayers++;
-      if(initLayer((GET_LAYER(map, i)), map) == -1) return(MS_FAILURE);      
-    }
+	if (msCopyLayer(&tmp_layer, layer) != MS_SUCCESS)
+		return(MS_FAILURE);
 
-    tmp_layer = GET_LAYER(map, i);
-    msCopyLayer(tmp_layer, layer);
+    status = msDrawLayer(map, &tmp_layer, image);
 
-    tmp_layer->index = i;
-    if(tmp_layer->name) free(tmp_layer->name); /* avoid leak */
-    tmp_layer->name = strdup(tmp_name);
+	freeLayer(&tmp_layer);
 
-    status = msDrawLayer(map, tmp_layer, image);
-    tmp_layer->status = MS_DELETE; /* so we don't write the copy or draw it again */
     if(map->querymap.style == MS_NORMAL || status != MS_SUCCESS) return(status);
   }
 



More information about the mapserver-commits mailing list