[mapserver-commits] r10163 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue May 18 00:47:32 EDT 2010


Author: sdlime
Date: 2010-05-18 00:47:30 -0400 (Tue, 18 May 2010)
New Revision: 10163

Modified:
   trunk/mapserver/maplayer.c
   trunk/mapserver/mapserver.h
Log:
Added a msLayerGetItemIndex() function...

Modified: trunk/mapserver/maplayer.c
===================================================================
--- trunk/mapserver/maplayer.c	2010-05-15 19:13:39 UTC (rev 10162)
+++ trunk/mapserver/maplayer.c	2010-05-18 04:47:30 UTC (rev 10163)
@@ -352,11 +352,21 @@
   }
 }
 
+int msLayerGetItemIndex(layerObj *layer, char *item)
+{
+  int i;
 
-/*                                                                                                                                                                                                                                        
-** This function builds a list of items necessary to draw or query a particular layer by                                                                                                                                                  
-** examining the contents of the various xxxxitem parameters and expressions. That list is                                                                                                                                                
-** then used to set the iteminfo variable.                                                                                                                                                                                                
+  for(i=0; i<layer->numitems; i++) {
+    if(strcasecmp(layer->items[i], item) == 0) return(i);
+  }
+    
+  return -1; /* item not found */
+}
+
+/*
+** This function builds a list of items necessary to draw or query a particular layer by
+** examining the contents of the various xxxxitem parameters and expressions. That list is
+** then used to set the iteminfo variable.
 */
 int msLayerWhichItems(layerObj *layer, int get_all, char *metadata)
 {

Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h	2010-05-15 19:13:39 UTC (rev 10162)
+++ trunk/mapserver/mapserver.h	2010-05-18 04:47:30 UTC (rev 10163)
@@ -1961,6 +1961,7 @@
 MS_DLL_EXPORT int msLayerIsOpen(layerObj *layer);
 MS_DLL_EXPORT void msLayerClose(layerObj *layer);
 MS_DLL_EXPORT int msLayerWhichShapes(layerObj *layer, rectObj rect);
+MS_DLL_EXPORT int msLayerGetItemIndex(layerObj *layer, char *item);
 MS_DLL_EXPORT int msLayerWhichItems(layerObj *layer, int get_all, char *metadata); 
 MS_DLL_EXPORT int msLayerNextShape(layerObj *layer, shapeObj *shape);
 MS_DLL_EXPORT int msLayerGetItems(layerObj *layer);



More information about the mapserver-commits mailing list