Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove #ifdef USE_PRIOLIST. Change name from panPriolist to layerorder.

git-svn-id: http://svn.osgeo.org/mapserver/trunk@811 7532c77e-422f-0410-93f4-f0b67bdd69e2
  • Loading branch information...
commit 8e4392cd3b34777b59085ad8c867d2e0ff089b20 1 parent 92da6fe
Assefa Yewondwossen authored
Showing with 26 additions and 43 deletions.
  1. +1 −1  map.h
  2. +10 −17 mapfile.c
  3. +2 −5 maplegend.c
  4. +2 −5 mapscale.c
  5. +11 −15 maputil.c
2  map.h
View
@@ -614,7 +614,7 @@ typedef struct { /* structure for a map */
webObj web;
- int *panPrioList;
+ int *layerorder;
} mapObj;
27 mapfile.c
View
@@ -2934,12 +2934,10 @@ int initMap(mapObj *map)
if(msProcessProjection(&(map->latlon)) == -1) return(-1);
#endif
- //Initialize the priority list (used to modify the order in which the layers
- //are drawn).
- map->panPrioList = NULL;
-#ifdef USE_PRIOLIST
- map->panPrioList = (int *)malloc(sizeof(int)*MS_MAXLAYERS);
-#endif
+ //Initialize the layer order list (used to modify the order in
+ //which the layers are drawn).
+ map->layerorder = (int *)malloc(sizeof(int)*MS_MAXLAYERS);
+
return(0);
}
@@ -2985,8 +2983,8 @@ void msFreeMap(mapObj *map) {
freeLayer(&(map->layers[i]));
msFree(map->layers);
- if (map->panPrioList)
- free(map->panPrioList);
+ if (map->layerorder)
+ free(map->layerorder);
msFree(map);
}
@@ -3041,11 +3039,8 @@ int msSaveMap(mapObj *map, char *filename)
for(i=0; i<map->numlayers; i++)
{
-#ifdef USE_PRIOLIST
- writeLayer(map, &(map->layers[map->panPrioList[i]]), stream);
-#else
- writeLayer(map, &(map->layers[i]), stream);
-#endif
+ writeLayer(map, &(map->layers[map->layerorder[i]]), stream);
+ //writeLayer(map, &(map->layers[i]), stream);
}
fprintf(stream, "END\n");
@@ -3183,10 +3178,8 @@ mapObj *msLoadMap(char *filename)
}
if(loadLayer(&(map->layers[map->numlayers]), map) == -1) return(NULL);
map->layers[map->numlayers].index = map->numlayers; /* save the index */
-#ifdef USE_PRIOLIST
- //Update the priority list with the layer's index.
- map->panPrioList[map->numlayers] = map->numlayers;
-#endif
+ //Update the layer order list with the layer's index.
+ map->layerorder[map->numlayers] = map->numlayers;
map->numlayers++;
break;
case(LEGEND):
7 maplegend.c
View
@@ -262,11 +262,8 @@ int msEmbedLegend(mapObj *map, gdImagePtr img)
map->layers[l].status = MS_ON;
if(initClass(&(map->layers[l].class[0])) == -1) return(-1);
-#ifdef USE_PRIOLIST
- //Update the priority list with the layer's index.
- map->panPrioList[l] = l;
-#endif
-
+ //Update the layer order list with the layer's index.
+ map->layerorder[l] = l;
}
map->layers[l].class[0].symbol = s;
7 mapscale.c
View
@@ -252,11 +252,8 @@ int msEmbedScalebar(mapObj *map, gdImagePtr img)
map->layers[l].status = MS_ON;
if(initClass(&(map->layers[l].class[0])) == -1) return(-1);
-#ifdef USE_PRIOLIST
- //Update the priority list with the layer's index.
- map->panPrioList[l] = l;
-#endif
-
+ //Update the layer order list with the layer's index.
+ map->layerorder[l] = l;
}
map->layers[l].class[0].symbol = s;
26 maputil.c
View
@@ -229,11 +229,9 @@ gdImagePtr msDrawMap(mapObj *map)
for(i=0; i<map->numlayers; i++) {
-#ifdef USE_PRIOLIST
- lp = &(map->layers[ map->panPrioList[i]]);
-#else
- lp = &(map->layers[i]);
-#endif
+ lp = &(map->layers[ map->layerorder[i]]);
+ //lp = &(map->layers[i]);
+
if(lp->postlabelcache) // wait to draw
continue;
@@ -1095,14 +1093,13 @@ int *msGetLayersIndexByGroup(mapObj *map, char *groupname, int *pnCount)
*/
int msMoveLayerUp(mapObj *map, int nLayerIndex)
{
-#ifdef USE_PRIOLIST
int iCurrentIndex = -1;
int i = 0;
if (map && nLayerIndex < map->numlayers-1 && nLayerIndex >=0)
{
for (i=0; i<map->numlayers; i++)
{
- if ( map->panPrioList[i] == nLayerIndex)
+ if ( map->layerorder[i] == nLayerIndex)
{
iCurrentIndex = i;
break;
@@ -1114,13 +1111,13 @@ int msMoveLayerUp(mapObj *map, int nLayerIndex)
if (iCurrentIndex == 0)
return 0;
- map->panPrioList[iCurrentIndex] = map->panPrioList[iCurrentIndex-1];
- map->panPrioList[iCurrentIndex-1] = nLayerIndex;
+ map->layerorder[iCurrentIndex] =
+ map->layerorder[iCurrentIndex-1];
+ map->layerorder[iCurrentIndex-1] = nLayerIndex;
return 0;
}
}
-#endif
return -1;
}
@@ -1130,14 +1127,13 @@ int msMoveLayerUp(mapObj *map, int nLayerIndex)
*/
int msMoveLayerDown(mapObj *map, int nLayerIndex)
{
-#ifdef USE_PRIOLIST
int iCurrentIndex = -1;
int i = 0;
if (map && nLayerIndex < map->numlayers-1 && nLayerIndex >=0)
{
for (i=0; i<map->numlayers; i++)
{
- if ( map->panPrioList[i] == nLayerIndex)
+ if ( map->layerorder[i] == nLayerIndex)
{
iCurrentIndex = i;
break;
@@ -1149,13 +1145,13 @@ int msMoveLayerDown(mapObj *map, int nLayerIndex)
if (iCurrentIndex == map->numlayers-1)
return 0;
- map->panPrioList[iCurrentIndex] = map->panPrioList[iCurrentIndex+1];
- map->panPrioList[iCurrentIndex+1] = nLayerIndex;
+ map->layerorder[iCurrentIndex] =
+ map->layerorder[iCurrentIndex+1];
+ map->layerorder[iCurrentIndex+1] = nLayerIndex;
return 0;
}
}
-#endif
return -1;
}
Please sign in to comment.
Something went wrong with that request. Please try again.