[mapserver-commits] r9663 - branches/branch-5-6/mapserver
svn at osgeo.org
svn at osgeo.org
Mon Jan 4 12:08:57 EST 2010
Author: tamas
Date: 2010-01-04 12:08:55 -0500 (Mon, 04 Jan 2010)
New Revision: 9663
Modified:
branches/branch-5-6/mapserver/HISTORY.TXT
branches/branch-5-6/mapserver/mapdraw.c
Log:
Changed the query map rendering implementation without adding extra layers to the map (#3069)
Modified: branches/branch-5-6/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-6/mapserver/HISTORY.TXT 2010-01-04 15:13:18 UTC (rev 9662)
+++ branches/branch-5-6/mapserver/HISTORY.TXT 2010-01-04 17:08:55 UTC (rev 9663)
@@ -15,6 +15,8 @@
Current Version (SVN branch-5-6):
--------------------------------
+- 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: branches/branch-5-6/mapserver/mapdraw.c
===================================================================
--- branches/branch-5-6/mapserver/mapdraw.c 2010-01-04 15:13:18 UTC (rev 9662)
+++ branches/branch-5-6/mapserver/mapdraw.c 2010-01-04 17:08:55 UTC (rev 9663)
@@ -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