Changeset 7586
- Timestamp:
- 05/13/08 02:27:00 (2 months ago)
- Files:
-
- trunk/mapserver/mapserv.c (modified) (87 diffs)
- trunk/mapserver/maptemplate.c (modified) (92 diffs)
- trunk/mapserver/maptemplate.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/mapserver/mapserv.c
r7557 r7586 42 42 43 43 44 mapservObj* m sObj;44 mapservObj* mapserv; 45 45 46 46 int writeLog(int show_error) … … 51 51 char szPath[MS_MAXPATHLEN]; 52 52 53 if(!m sObj) return(0);54 if(!m sObj->Map) return(0);55 if(!m sObj->Map->web.log) return(0);53 if(!mapserv) return(0); 54 if(!mapserv->map) return(0); 55 if(!mapserv->map->web.log) return(0); 56 56 57 if((stream = fopen(msBuildPath(szPath, m sObj->Map->mappath,58 m sObj->Map->web.log),"a")) == NULL) {59 msSetError(MS_IOERR, m sObj->Map->web.log, "writeLog()");57 if((stream = fopen(msBuildPath(szPath, mapserv->map->mappath, 58 mapserv->map->web.log),"a")) == NULL) { 59 msSetError(MS_IOERR, mapserv->map->web.log, "writeLog()"); 60 60 return(-1); 61 61 } … … 70 70 fprintf(stream,"NULL,"); 71 71 72 fprintf(stream,"%s,",m sObj->Map->name);73 fprintf(stream,"%d,",m sObj->Mode);74 75 fprintf(stream,"%f %f %f %f,", m sObj->Map->extent.minx, msObj->Map->extent.miny, msObj->Map->extent.maxx, msObj->Map->extent.maxy);76 77 fprintf(stream,"%f %f,", m sObj->MapPnt.x, msObj->MapPnt.y);78 79 for(i=0;i<m sObj->NumLayers;i++)80 fprintf(stream, "%s ", m sObj->Layers[i]);72 fprintf(stream,"%s,",mapserv->map->name); 73 fprintf(stream,"%d,",mapserv->Mode); 74 75 fprintf(stream,"%f %f %f %f,", mapserv->map->extent.minx, mapserv->map->extent.miny, mapserv->map->extent.maxx, mapserv->map->extent.maxy); 76 77 fprintf(stream,"%f %f,", mapserv->mappnt.x, mapserv->mappnt.y); 78 79 for(i=0;i<mapserv->NumLayers;i++) 80 fprintf(stream, "%s ", mapserv->Layers[i]); 81 81 fprintf(stream,","); 82 82 … … 98 98 writeLog(MS_TRUE); 99 99 100 if(!m sObj || !msObj->Map) {100 if(!mapserv || !mapserv->map) { 101 101 msIO_printf("Content-type: text/html%c%c",10,10); 102 102 msIO_printf("<HTML>\n"); … … 106 106 msWriteErrorXML(stdout); 107 107 msIO_printf("</BODY></HTML>"); 108 if(m sObj)109 msFreeMapServObj(m sObj);108 if(mapserv) 109 msFreeMapServObj(mapserv); 110 110 msCleanup(); 111 111 exit(0); 112 112 } 113 113 114 if((ms_error->code == MS_NOTFOUND) && (m sObj->Map->web.empty)) {115 /* msRedirect(m sObj->Map->web.empty); */116 if(msReturnURL(m sObj, msObj->Map->web.empty, BROWSE) != MS_SUCCESS) {114 if((ms_error->code == MS_NOTFOUND) && (mapserv->map->web.empty)) { 115 /* msRedirect(mapserv->map->web.empty); */ 116 if(msReturnURL(mapserv, mapserv->map->web.empty, BROWSE) != MS_SUCCESS) { 117 117 msIO_printf("Content-type: text/html%c%c",10,10); 118 118 msIO_printf("<HTML>\n"); … … 124 124 } 125 125 } else { 126 if(m sObj->Map->web.error) {127 /* msRedirect(m sObj->Map->web.error); */128 if(msReturnURL(m sObj, msObj->Map->web.error, BROWSE) != MS_SUCCESS) {126 if(mapserv->map->web.error) { 127 /* msRedirect(mapserv->map->web.error); */ 128 if(msReturnURL(mapserv, mapserv->map->web.error, BROWSE) != MS_SUCCESS) { 129 129 msIO_printf("Content-type: text/html%c%c",10,10); 130 130 msIO_printf("<HTML>\n"); … … 146 146 } 147 147 148 /* Clean-up (the following are not stored as part of the m sObj) */148 /* Clean-up (the following are not stored as part of the mapserv) */ 149 149 if(QueryItem) free(QueryItem); 150 150 if(QueryString) free(QueryString); … … 153 153 if(QueryFile) free(QueryFile); 154 154 155 msFreeMapServObj(m sObj);155 msFreeMapServObj(mapserv); 156 156 msCleanup(); 157 157 … … 186 186 char *tmpstr, *key, *value=NULL; 187 187 188 for(i=0;i<m sObj->request->NumParams;i++) /* find the mapfile parameter first */189 if(strcasecmp(m sObj->request->ParamNames[i], "map") == 0) break;188 for(i=0;i<mapserv->request->NumParams;i++) /* find the mapfile parameter first */ 189 if(strcasecmp(mapserv->request->ParamNames[i], "map") == 0) break; 190 190 191 if(i == m sObj->request->NumParams) {191 if(i == mapserv->request->NumParams) { 192 192 if(getenv("MS_MAPFILE")) /* has a default file has not been set */ 193 193 map = msLoadMap(getenv("MS_MAPFILE"), NULL); … … 197 197 } 198 198 } else { 199 if(getenv(m sObj->request->ParamValues[i])) /* an environment references the actual file to use */200 map = msLoadMap(getenv(m sObj->request->ParamValues[i]), NULL);199 if(getenv(mapserv->request->ParamValues[i])) /* an environment references the actual file to use */ 200 map = msLoadMap(getenv(mapserv->request->ParamValues[i]), NULL); 201 201 else 202 map = msLoadMap(m sObj->request->ParamValues[i], NULL);202 map = msLoadMap(mapserv->request->ParamValues[i], NULL); 203 203 } 204 204 … … 207 207 /* check for any %variable% substitutions here, also do any map_ changes, we do this here so WMS/WFS */ 208 208 /* services can take advantage of these "vendor specific" extensions */ 209 for(i=0;i<m sObj->request->NumParams;i++) {209 for(i=0;i<mapserv->request->NumParams;i++) { 210 210 /* 211 211 ** a few CGI variables should be skipped altogether … … 214 214 ** below conflict with that so we avoid it here 215 215 */ 216 if(strncasecmp(m sObj->request->ParamNames[i],"qstring",7) == 0) continue;217 218 if(strncasecmp(m sObj->request->ParamNames[i],"map_",4) == 0 || strncasecmp(msObj->request->ParamNames[i],"map.",4) == 0) { /* check to see if there are any additions to the mapfile */219 if(msUpdateMapFromURL(map, m sObj->request->ParamNames[i], msObj->request->ParamValues[i]) != MS_SUCCESS) writeError();216 if(strncasecmp(mapserv->request->ParamNames[i],"qstring",7) == 0) continue; 217 218 if(strncasecmp(mapserv->request->ParamNames[i],"map_",4) == 0 || strncasecmp(mapserv->request->ParamNames[i],"map.",4) == 0) { /* check to see if there are any additions to the mapfile */ 219 if(msUpdateMapFromURL(map, mapserv->request->ParamNames[i], mapserv->request->ParamValues[i]) != MS_SUCCESS) writeError(); 220 220 continue; 221 221 } 222 222 223 223 /* runtime subtitution string */ 224 tmpstr = (char *)malloc(sizeof(char)*strlen(m sObj->request->ParamNames[i]) + 3);225 sprintf(tmpstr,"%%%s%%", m sObj->request->ParamNames[i]);224 tmpstr = (char *)malloc(sizeof(char)*strlen(mapserv->request->ParamNames[i]) + 3); 225 sprintf(tmpstr,"%%%s%%", mapserv->request->ParamNames[i]); 226 226 227 227 /* validation pattern metadata key */ 228 key = (char *)malloc(sizeof(char)*strlen(m sObj->request->ParamNames[i]) + 20);229 sprintf(key,"%s_validation_pattern", m sObj->request->ParamNames[i]);228 key = (char *)malloc(sizeof(char)*strlen(mapserv->request->ParamNames[i]) + 20); 229 sprintf(key,"%s_validation_pattern", mapserv->request->ParamNames[i]); 230 230 231 231 for(j=0; j<map->numlayers; j++) { 232 232 value = msLookupHashTable(&(GET_LAYER(map, j)->metadata), key); 233 233 if(value) { /* validate parameter value */ 234 if(msEvalRegex(value, m sObj->request->ParamValues[i]) == MS_FALSE) {235 msSetError(MS_WEBERR, "Parameter '%s' value fails to validate.", "loadMap()", m sObj->request->ParamNames[i]);234 if(msEvalRegex(value, mapserv->request->ParamValues[i]) == MS_FALSE) { 235 msSetError(MS_WEBERR, "Parameter '%s' value fails to validate.", "loadMap()", mapserv->request->ParamNames[i]); 236 236 writeError(); 237 237 } … … 239 239 240 240 if(GET_LAYER(map, j)->data && (strstr(GET_LAYER(map, j)->data, tmpstr) != NULL)) 241 GET_LAYER(map, j)->data = msReplaceSubstring(GET_LAYER(map, j)->data, tmpstr, m sObj->request->ParamValues[i]);241 GET_LAYER(map, j)->data = msReplaceSubstring(GET_LAYER(map, j)->data, tmpstr, mapserv->request->ParamValues[i]); 242 242 if(GET_LAYER(map, j)->tileindex && (strstr(GET_LAYER(map, j)->tileindex, tmpstr) != NULL)) 243 GET_LAYER(map, j)->tileindex = msReplaceSubstring(GET_LAYER(map, j)->tileindex, tmpstr, m sObj->request->ParamValues[i]);243 GET_LAYER(map, j)->tileindex = msReplaceSubstring(GET_LAYER(map, j)->tileindex, tmpstr, mapserv->request->ParamValues[i]); 244 244 if(GET_LAYER(map, j)->connection && (strstr(GET_LAYER(map, j)->connection, tmpstr) != NULL)) 245 GET_LAYER(map, j)->connection = msReplaceSubstring(GET_LAYER(map, j)->connection, tmpstr, m sObj->request->ParamValues[i]);245 GET_LAYER(map, j)->connection = msReplaceSubstring(GET_LAYER(map, j)->connection, tmpstr, mapserv->request->ParamValues[i]); 246 246 if(GET_LAYER(map, j)->filter.string && (strstr(GET_LAYER(map, j)->filter.string, tmpstr) != NULL)) 247 GET_LAYER(map, j)->filter.string = msReplaceSubstring(GET_LAYER(map, j)->filter.string, tmpstr, m sObj->request->ParamValues[i]);247 GET_LAYER(map, j)->filter.string = msReplaceSubstring(GET_LAYER(map, j)->filter.string, tmpstr, mapserv->request->ParamValues[i]); 248 248 for(k=0; k<GET_LAYER(map, j)->numclasses; k++) { 249 249 if(GET_LAYER(map, j)->class[k]->expression.string && (strstr(GET_LAYER(map, j)->class[k]->expression.string, tmpstr) != NULL)) 250 GET_LAYER(map, j)->class[k]->expression.string = msReplaceSubstring(GET_LAYER(map, j)->class[k]->expression.string, tmpstr, m sObj->request->ParamValues[i]);250 GET_LAYER(map, j)->class[k]->expression.string = msReplaceSubstring(GET_LAYER(map, j)->class[k]->expression.string, tmpstr, mapserv->request->ParamValues[i]); 251 251 } 252 252 } … … 259 259 /* is one load it */ 260 260 261 for(i=0;i<m sObj->request->NumParams;i++) {262 if(strcasecmp(m sObj->request->ParamNames[i],"context") == 0) {263 if(m sObj->request->ParamValues[i] && strlen(msObj->request->ParamValues[i]) > 0) {264 if(strncasecmp(m sObj->request->ParamValues[i],"http",4) == 0) {261 for(i=0;i<mapserv->request->NumParams;i++) { 262 if(strcasecmp(mapserv->request->ParamNames[i],"context") == 0) { 263 if(mapserv->request->ParamValues[i] && strlen(mapserv->request->ParamValues[i]) > 0) { 264 if(strncasecmp(mapserv->request->ParamValues[i],"http",4) == 0) { 265 265 if(msGetConfigOption(map, "CGI_CONTEXT_URL")) 266 msLoadMapContextURL(map, m sObj->request->ParamValues[i], MS_FALSE);266 msLoadMapContextURL(map, mapserv->request->ParamValues[i], MS_FALSE); 267 267 } else 268 msLoadMapContext(map, m sObj->request->ParamValues[i], MS_FALSE);268 msLoadMapContext(map, mapserv->request->ParamValues[i], MS_FALSE); 269 269 } 270 270 } … … 277 277 ** Set operation mode. First look in MS_MODE env. var. as a 278 278 ** default value that can be overridden by the mode=... CGI param. 279 ** Returns silently, leaving m sObj->Mode unchanged if mode param not set.279 ** Returns silently, leaving mapserv->Mode unchanged if mode param not set. 280 280 */ 281 281 static int setMode(void) … … 286 286 287 287 mode = getenv("MS_MODE"); 288 for( i=0; i<m sObj->request->NumParams; i++ )288 for( i=0; i<mapserv->request->NumParams; i++ ) 289 289 { 290 if(strcasecmp(m sObj->request->ParamNames[i], "mode") == 0)290 if(strcasecmp(mapserv->request->ParamNames[i], "mode") == 0) 291 291 { 292 mode = m sObj->request->ParamValues[i];292 mode = mapserv->request->ParamValues[i]; 293 293 break; 294 294 } … … 298 298 for(j=0; j<numModes; j++) { 299 299 if(strcasecmp(mode, modeStrings[j]) == 0) { 300 m sObj->Mode = j;300 mapserv->Mode = j; 301 301 break; 302 302 } … … 321 321 int rosa_type=0; 322 322 323 for(i=0;i<m sObj->request->NumParams;i++) { /* now process the rest of the form variables */324 if(strlen(m sObj->request->ParamValues[i]) == 0)323 for(i=0;i<mapserv->request->NumParams;i++) { /* now process the rest of the form variables */ 324 if(strlen(mapserv->request->ParamValues[i]) == 0) 325 325 continue; 326 326 327 327 328 if(strcasecmp(m sObj->request->ParamNames[i],"icon") == 0) {329 m sObj->icon = strdup(msObj->request->ParamValues[i]);330 continue; 331 } 332 333 if(strcasecmp(m sObj->request->ParamNames[i],"queryfile") == 0) {334 QueryFile = strdup(m sObj->request->ParamValues[i]);328 if(strcasecmp(mapserv->request->ParamNames[i],"icon") == 0) { 329 mapserv->icon = strdup(mapserv->request->ParamValues[i]); 330 continue; 331 } 332 333 if(strcasecmp(mapserv->request->ParamNames[i],"queryfile") == 0) { 334 QueryFile = strdup(mapserv->request->ParamValues[i]); 335 335 continue; 336 336 } 337 337 338 if(strcasecmp(m sObj->request->ParamNames[i],"savequery") == 0) {339 m sObj->SaveQuery = MS_TRUE;338 if(strcasecmp(mapserv->request->ParamNames[i],"savequery") == 0) { 339 mapserv->savequery = MS_TRUE; 340 340 continue; 341 341 } 342 342 343 343 /* Insecure as implemented, need to save someplace non accessible by everyone in the universe 344 if(strcasecmp(m sObj->request->ParamNames[i],"savemap") == 0) {345 m sObj->SaveMap = MS_TRUE;344 if(strcasecmp(mapserv->request->ParamNames[i],"savemap") == 0) { 345 mapserv->savemap = MS_TRUE; 346 346 continue; 347 347 } 348 348 */ 349 349 350 if(strcasecmp(m sObj->request->ParamNames[i],"zoom") == 0) {351 m sObj->Zoom = getNumeric(msObj->request->ParamValues[i]);352 if((m sObj->Zoom > MAXZOOM) || (msObj->Zoom < MINZOOM)) {350 if(strcasecmp(mapserv->request->ParamNames[i],"zoom") == 0) { 351 mapserv->Zoom = getNumeric(mapserv->request->ParamValues[i]); 352 if((mapserv->Zoom > MAXZOOM) || (mapserv->Zoom < MINZOOM)) { 353 353 msSetError(MS_WEBERR, "Zoom value out of range.", "loadForm()"); 354 354 writeError(); … … 357 357 } 358 358 359 if(strcasecmp(m sObj->request->ParamNames[i],"zoomdir") == 0) {360 m sObj->ZoomDirection = (int)getNumeric(msObj->request->ParamValues[i]);361 if((m sObj->ZoomDirection != -1) && (msObj->ZoomDirection != 1) && (msObj->ZoomDirection != 0)) {359 if(strcasecmp(mapserv->request->ParamNames[i],"zoomdir") == 0) { 360 mapserv->ZoomDirection = (int)getNumeric(mapserv->request->ParamValues[i]); 361 if((mapserv->ZoomDirection != -1) && (mapserv->ZoomDirection != 1) && (mapserv->ZoomDirection != 0)) { 362 362 msSetError(MS_WEBERR, "Zoom direction must be 1, 0 or -1.", "loadForm()"); 363 363 writeError(); … … 366 366 } 367 367 368 if(strcasecmp(m sObj->request->ParamNames[i],"zoomsize") == 0) { /* absolute zoom magnitude */369 ZoomSize = (int) getNumeric(m sObj->request->ParamValues[i]);368 if(strcasecmp(mapserv->request->ParamNames[i],"zoomsize") == 0) { /* absolute zoom magnitude */ 369 ZoomSize = (int) getNumeric(mapserv->request->ParamValues[i]); 370 370 if((ZoomSize > MAXZOOM) || (ZoomSize < 1)) { 371 371 msSetError(MS_WEBERR, "Invalid zoom size.", "loadForm()"); … … 375 375 } 376 376 377 if(strcasecmp(m sObj->request->ParamNames[i],"imgext") == 0) { /* extent of an existing image in a web application */378 tokens = msStringSplit(m sObj->request->ParamValues[i], ' ', &n);377 if(strcasecmp(mapserv->request->ParamNames[i],"imgext") == 0) { /* extent of an existing image in a web application */ 378 tokens = msStringSplit(mapserv->request->ParamValues[i], ' ', &n); 379 379 380 380 if(!tokens) { … … 388 388 } 389 389 390 m sObj->ImgExt.minx = getNumeric(tokens[0]);391 m sObj->ImgExt.miny = getNumeric(tokens[1]);392 m sObj->ImgExt.maxx = getNumeric(tokens[2]);393 m sObj->ImgExt.maxy = getNumeric(tokens[3]);390 mapserv->ImgExt.minx = getNumeric(tokens[0]); 391 mapserv->ImgExt.miny = getNumeric(tokens[1]); 392 mapserv->ImgExt.maxx = getNumeric(tokens[2]); 393 mapserv->ImgExt.maxy = getNumeric(tokens[3]); 394 394 395 395 msFreeCharArray(tokens, 4); … … 397 397 } 398 398 399 if(strcasecmp(m sObj->request->ParamNames[i],"searchmap") == 0) {399 if(strcasecmp(mapserv->request->ParamNames[i],"searchmap") == 0) { 400 400 SearchMap = MS_TRUE; 401 401 continue; 402 402 } 403 403 404 if(strcasecmp(m sObj->request->ParamNames[i],"id") == 0) {405 strncpy(m sObj->Id, msObj->request->ParamValues[i], IDSIZE);406 continue; 407 } 408 409 if(strcasecmp(m sObj->request->ParamNames[i],"mapext") == 0) { /* extent of the new map or query */410 411 if(strncasecmp(m sObj->request->ParamValues[i],"shape",5) == 0)412 m sObj->UseShapes = MS_TRUE;404 if(strcasecmp(mapserv->request->ParamNames[i],"id") == 0) { 405 strncpy(mapserv->Id, mapserv->request->ParamValues[i], IDSIZE); 406 continue; 407 } 408 409 if(strcasecmp(mapserv->request->ParamNames[i],"mapext") == 0) { /* extent of the new map or query */ 410 411 if(strncasecmp(mapserv->request->ParamValues[i],"shape",5) == 0) 412 mapserv->UseShapes = MS_TRUE; 413 413 else { 414 tokens = msStringSplit(m sObj->request->ParamValues[i], ' ', &n);414 tokens = msStringSplit(mapserv->request->ParamValues[i], ' ', &n); 415 415 416 416 if(!tokens) { … … 424 424 } 425 425 426 m sObj->Map->extent.minx = getNumeric(tokens[0]);427 m sObj->Map->extent.miny = getNumeric(tokens[1]);428 m sObj->Map->extent.maxx = getNumeric(tokens[2]);429 m sObj->Map->extent.maxy = getNumeric(tokens[3]);426 mapserv->map->extent.minx = getNumeric(tokens[0]); 427 mapserv->map->extent.miny = getNumeric(tokens[1]); 428 mapserv->map->extent.maxx = getNumeric(tokens[2]); 429 mapserv->map->extent.maxy = getNumeric(tokens[3]); 430 430 431 431 msFreeCharArray(tokens, 4); … … 441 441 * will ensue. 442 442 */ 443 if(m sObj->Map->projection.proj && !pj_is_latlong(msObj->Map->projection.proj)444 && (m sObj->Map->extent.minx >= -180.0 && msObj->Map->extent.minx <= 180.0)445 && (m sObj->Map->extent.miny >= -90.0 && msObj->Map->extent.miny <= 90.0)446 && (m sObj->Map->extent.maxx >= -180.0 && msObj->Map->extent.maxx <= 180.0)447 && (m sObj->Map->extent.maxy >= -90.0 && msObj->Map->extent.maxy <= 90.0)) {448 msProjectRect(&(m sObj->Map->latlon), &(msObj->Map->projection), &(msObj->Map->extent)); /* extent is a in lat/lon */443 if(mapserv->map->projection.proj && !pj_is_latlong(mapserv->map->projection.proj) 444 && (mapserv->map->extent.minx >= -180.0 && mapserv->map->extent.minx <= 180.0) 445 && (mapserv->map->extent.miny >= -90.0 && mapserv->map->extent.miny <= 90.0) 446 && (mapserv->map->extent.maxx >= -180.0 && mapserv->map->extent.maxx <= 180.0) 447 && (mapserv->map->extent.maxy >= -90.0 && mapserv->map->extent.maxy <= 90.0)) { 448 msProjectRect(&(mapserv->map->latlon), &(mapserv->map->projection), &(mapserv->map->extent)); /* extent is a in lat/lon */ 449 449 } 450 450 #endif 451 451 452 if((m sObj->Map->extent.minx != msObj->Map->extent.maxx) && (msObj->Map->extent.miny != msObj->Map->extent.maxy)) { /* extent seems ok */453 m sObj->CoordSource = FROMUSERBOX;452 if((mapserv->map->extent.minx != mapserv->map->extent.maxx) && (mapserv->map->extent.miny != mapserv->map->extent.maxy)) { /* extent seems ok */ 453 mapserv->CoordSource = FROMUSERBOX; 454 454 QueryCoordSource = FROMUSERBOX; 455 455 } … … 459 459 } 460 460 461 if(strcasecmp(m sObj->request->ParamNames[i],"minx") == 0) { /* extent of the new map, in pieces */462 m sObj->Map->extent.minx = getNumeric(msObj->request->ParamValues[i]);463 continue; 464 } 465 if(strcasecmp(m sObj->request->ParamNames[i],"maxx") == 0) {466 m sObj->Map->extent.maxx = getNumeric(msObj->request->ParamValues[i]);467 continue; 468 } 469 if(strcasecmp(m sObj->request->ParamNames[i],"miny") == 0) {470 m sObj->Map->extent.miny = getNumeric(msObj->request->ParamValues[i]);471 continue; 472 } 473 if(strcasecmp(m sObj->request->ParamNames[i],"maxy") == 0) {474 m sObj->Map->extent.maxy = getNumeric(msObj->request->ParamValues[i]);475 m sObj->CoordSource = FROMUSERBOX;461 if(strcasecmp(mapserv->request->ParamNames[i],"minx") == 0) { /* extent of the new map, in pieces */ 462 mapserv->map->extent.minx = getNumeric(mapserv->request->ParamValues[i]); 463 continue; 464 } 465 if(strcasecmp(mapserv->request->ParamNames[i],"maxx") == 0) { 466 mapserv->map->extent.maxx = getNumeric(mapserv->request->ParamValues[i]); 467 continue; 468 } 469 if(strcasecmp(mapserv->request->ParamNames[i],"miny") == 0) { 470 mapserv->map->extent.miny = getNumeric(mapserv->request->ParamValues[i]); 471 continue; 472 } 473 if(strcasecmp(mapserv->request->ParamNames[i],"maxy") == 0) { 474 mapserv->map->extent.maxy = getNumeric(mapserv->request->ParamValues[i]); 475 mapserv->CoordSource = FROMUSERBOX; 476 476 QueryCoordSource = FROMUSERBOX; 477 477 continue; 478 478 } 479 479 480 if(strcasecmp(m sObj->request->ParamNames[i],"mapxy") == 0) { /* user map coordinate */481 482 if(strncasecmp(m sObj->request->ParamValues[i],"shape",5) == 0) {483 m sObj->UseShapes = MS_TRUE;480 if(strcasecmp(mapserv->request->ParamNames[i],"mapxy") == 0) { /* user map coordinate */ 481 482 if(strncasecmp(mapserv->request->ParamValues[i],"shape",5) == 0) { 483 mapserv->UseShapes = MS_TRUE; 484 484 } else { 485 tokens = msStringSplit(m sObj->request->ParamValues[i], ' ', &n);485 tokens = msStringSplit(mapserv->request->ParamValues[i], ' ', &n); 486 486 487 487 if(!tokens) { … … 495 495 } 496 496 497 m sObj->MapPnt.x = getNumeric(tokens[0]);498 m sObj->MapPnt.y = getNumeric(tokens[1]);497 mapserv->mappnt.x = getNumeric(tokens[0]); 498 mapserv->mappnt.y = getNumeric(tokens[1]); 499 499 500 500 msFreeCharArray(tokens, 2); 501 501 502 502 #ifdef USE_PROJ 503 if(m sObj->Map->projection.proj && !pj_is_latlong(msObj->Map->projection.proj)504 && (m sObj->MapPnt.x >= -180.0 && msObj->MapPnt.x <= 180.0)505 && (m sObj->MapPnt.y >= -90.0 && msObj->MapPnt.y <= 90.0)) {506 msProjectPoint(&(m sObj->Map->latlon), &(msObj->Map->projection), &msObj->MapPnt); /* point is a in lat/lon */503 if(mapserv->map->projection.proj && !pj_is_latlong(mapserv->map->projection.proj) 504 && (mapserv->mappnt.x >= -180.0 && mapserv->mappnt.x <= 180.0) 505 && (mapserv->mappnt.y >= -90.0 && mapserv->mappnt.y <= 90.0)) { 506 msProjectPoint(&(mapserv->map->latlon), &(mapserv->map->projection), &mapserv->mappnt); /* point is a in lat/lon */ 507 507 } 508 508 #endif 509 509 510 if(m sObj->CoordSource == NONE) { /* don't override previous settings (i.e. buffer or scale ) */511 m sObj->CoordSource = FROMUSERPNT;510 if(mapserv->CoordSource == NONE) { /* don't override previous settings (i.e. buffer or scale ) */ 511 mapserv->CoordSource = FROMUSERPNT; 512 512 QueryCoordSource = FROMUSERPNT; 513 513 } … … 516 516 } 517 517 518 if(strcasecmp(m sObj->request->ParamNames[i],"mapshape") == 0) { /* query shape */518 if(strcasecmp(mapserv->request->ParamNames[i],"mapshape") == 0) { /* query shape */ 519 519 lineObj line={0,NULL}; 520 520 char **tmp=NULL; 521 521 int n, j; 522 522 523 tmp = msStringSplit(m sObj->request->ParamValues[i], ' ', &n);523 tmp = msStringSplit(mapserv->request->ParamValues[i], ' ', &n); 524 524 525 525 if((line.point = (pointObj *)malloc(sizeof(pointObj)*(n/2))) == NULL) { … … 529 529 line.numpoints = n/2; 530 530 531 msInitShape(&(m sObj->SelectShape));532 m sObj->SelectShape.type = MS_SHAPE_POLYGON;531 msInitShape(&(mapserv->SelectShape)); 532 mapserv->SelectShape.type = MS_SHAPE_POLYGON; 533 533 534 534 for(j=0; j<n/2; j++) { … … 537 537 538 538 #ifdef USE_PROJ 539 if(m sObj->Map->projection.proj && !pj_is_latlong(msObj->Map->projection.proj)539 if(mapserv->map->projection.proj && !pj_is_latlong(mapserv->map->projection.proj) 540 540 && (line.point[j].x >= -180.0 && line.point[j].x <= 180.0) 541 541 && (line.point[j].y >= -90.0 && line.point[j].y <= 90.0)) { 542 msProjectPoint(&(m sObj->Map->latlon), &(msObj->Map->projection), &line.point[j]); /* point is a in lat/lon */542 msProjectPoint(&(mapserv->map->latlon), &(mapserv->map->projection), &line.point[j]); /* point is a in lat/lon */ 543 543 } 544 544 #endif 545 545 } 546 546 547 if(msAddLine(&m sObj->SelectShape, &line) == -1) writeError();547 if(msAddLine(&mapserv->SelectShape, &line) == -1) writeError(); 548 548 549 549 msFree(line.point); … … 554 554 } 555 555 556 if(strcasecmp(m sObj->request->ParamNames[i],"img.x") == 0) { /* mouse click, in pieces */557 m sObj->ImgPnt.x = getNumeric(msObj->request->ParamValues[i]);558 if((m sObj->ImgPnt.x > (2*msObj->Map->maxsize)) || (msObj->ImgPnt.x < (-2*msObj->Map->maxsize))) {556 if(strcasecmp(mapserv->request->ParamNames[i],"img.x") == 0) { /* mouse click, in pieces */ 557 mapserv->ImgPnt.x = getNumeric(mapserv->request->ParamValues[i]); 558 if((mapserv->ImgPnt.x > (2*mapserv->map->maxsize)) || (mapserv->ImgPnt.x < (-2*mapserv->map->maxsize))) { 559 559 msSetError(MS_WEBERR, "Coordinate out of range.", "loadForm()"); 560 560 writeError(); 561 561 } 562 m sObj->CoordSource = FROMIMGPNT;562 mapserv->CoordSource = FROMIMGPNT; 563 563 QueryCoordSource = FROMIMGPNT; 564 564 continue; 565 565 } 566 if(strcasecmp(m sObj->request->ParamNames[i],"img.y") == 0) {567 m sObj->ImgPnt.y = getNumeric(msObj->request->ParamValues[i]);568 if((m sObj->ImgPnt.y > (2*msObj->Map->maxsize)) || (msObj->ImgPnt.y < (-2*msObj->Map->maxsize))) {566 if(strcasecmp(mapserv->request->ParamNames[i],"img.y") == 0) { 567 mapserv->ImgPnt.y = getNumeric(mapserv->request->ParamValues[i]); 568 if((mapserv->ImgPnt.y > (2*mapserv->map->maxsize)) || (mapserv->ImgPnt.y < (-2*mapserv->map->maxsize))) { 569 569 msSetError(MS_WEBERR, "Coordinate out of range.", "loadForm()"); 570 570 writeError(); 571 571 } 572 m sObj->CoordSource = FROMIMGPNT;572 mapserv->CoordSource = FROMIMGPNT; 573 573 QueryCoordSource = FROMIMGPNT; 574 574 continue; 575 575 } 576 576 577 if(strcasecmp(m sObj->request->ParamNames[i],"imgxy") == 0) { /* mouse click, single variable */578 if(m sObj->CoordSource == FROMIMGPNT)577 if(strcasecmp(mapserv->request->ParamNames[i],"imgxy") == 0) { /* mouse click, single variable */ 578 if(mapserv->CoordSource == FROMIMGPNT) 579 579 continue; 580 580 581 tokens = msStringSplit(m sObj->request->ParamValues[i], ' ', &n);581 tokens = msStringSplit(mapserv->request->ParamValues[i], ' ', &n); 582 582 583 583 if(!tokens) { … … 591 591 } 592 592 593 m sObj->ImgPnt.x = getNumeric(tokens[0]);594 m sObj->ImgPnt.y = getNumeric(tokens[1]);593 mapserv->ImgPnt.x = getNumeric(tokens[0]); 594 mapserv->ImgPnt.y = getNumeric(tokens[1]); 595 595 596 596 msFreeCharArray(tokens, 2); 597 597 598 if((m sObj->ImgPnt.x > (2*msObj->Map->maxsize)) || (msObj->ImgPnt.x < (-2*msObj->Map->maxsize)) || (msObj->ImgPnt.y > (2*msObj->Map->maxsize)) || (msObj->ImgPnt.y < (-2*msObj->Map->maxsize))) {598 if((mapserv->ImgPnt.x > (2*mapserv->map->maxsize)) || (mapserv->ImgPnt.x < (-2*mapserv->map->maxsize)) || (mapserv->ImgPnt.y > (2*mapserv->map->maxsize)) || (mapserv->ImgPnt.y < (-2*mapserv->map->maxsize))) { 599 599 msSetError(MS_WEBERR, "Reference map coordinate out of range.", "loadForm()"); 600 600 writeError(); 601 601 } 602 602 603 if(m sObj->CoordSource == NONE) { /* override nothing since this parameter is usually used to hold a default value */604 m sObj->CoordSource = FROMIMGPNT;603 if(mapserv->CoordSource == NONE) { /* override nothing since this parameter is usually used to hold a default value */ 604 mapserv->CoordSource = FROMIMGPNT; 605 605 QueryCoordSource = FROMIMGPNT; 606 606 } … … 608 608 } 609 609 610 if(strcasecmp(m sObj->request->ParamNames[i],"imgbox") == 0) { /* selection box (eg. mouse drag) */611 tokens = msStringSplit(m sObj->request->ParamValues[i], ' ', &n);610 if(strcasecmp(mapserv->request->ParamNames[i],"imgbox") == 0) { /* selection box (eg. mouse drag) */ 611 tokens = msStringSplit(mapserv->request->ParamValues[i], ' ', &n); 612 612 613 613 if(!tokens) { … … 621 621 } 622 622 623 m sObj->ImgBox.minx = getNumeric(tokens[0]);624 m sObj->ImgBox.miny = getNumeric(tokens[1]);625 m sObj->ImgBox.maxx = getNumeric(tokens[2]);626 m sObj->ImgBox.maxy = getNumeric(tokens[3]);623 mapserv->ImgBox.minx = getNumeric(tokens[0]); 624 mapserv->ImgBox.miny = getNumeric(tokens[1]); 625 mapserv->ImgBox.maxx = getNumeric(tokens[2]); 626 mapserv->ImgBox.maxy = getNumeric(tokens[3]); 627 627 628 628 msFreeCharArray(tokens, 4); 629 629 630 if((m sObj->ImgBox.minx != msObj->ImgBox.maxx) && (msObj->ImgBox.miny != msObj->ImgBox.maxy)) { /* must not degenerate into a point */631 m sObj->CoordSource = FROMIMGBOX;630 if((mapserv->ImgBox.minx != mapserv->ImgBox.maxx) && (mapserv->ImgBox.miny != mapserv->ImgBox.maxy)) { /* must not degenerate into a point */ 631 mapserv->CoordSource = FROMIMGBOX; 632 632 QueryCoordSource = FROMIMGBOX; 633 633 } … … 635 635 } 636 636 637 if(strcasecmp(m sObj->request->ParamNames[i],"imgshape") == 0) { /* shape given in image coordinates */637 if(strcasecmp(mapserv->request->ParamNames[i],"imgshape") == 0) { /* shape given in image coordinates */ 638 638 lineObj line={0,NULL}; 639 639 char **tmp=NULL; 640 640 int n, j; 641 641 642 tmp = msStringSplit(m sObj->request->ParamValues[i], ' ', &n);642 tmp = msStringSplit(mapserv->request->ParamValues[i], ' ', &n); 643 643 644 644 if((line.point = (pointObj *)malloc(sizeof(pointObj)*(n/2))) == NULL) { … … 648 648 line.numpoints = n/2; 649 649 650 msInitShape(&m sObj->SelectShape);651 m sObj->SelectShape.type = MS_SHAPE_POLYGON;650 msInitShape(&mapserv->SelectShape); 651 mapserv->SelectShape.type = MS_SHAPE_POLYGON; 652 652 653 653 for(j=0; j<n/2; j++) { … … 656 656 } 657 657 658 if(msAddLine(&m sObj->SelectShape, &line) == -1) writeError();658 if(msAddLine(&mapserv->SelectShape, &line) == -1) writeError(); 659 659 660 660 msFree(line.point); … … 665 665 } 666 666 667 if(strcasecmp(m sObj->request->ParamNames[i],"ref.x") == 0) { /* mouse click in reference image, in pieces */668 m sObj->RefPnt.x = getNumeric(msObj->request->ParamValues[i]);669 if((m sObj->RefPnt.x > (2*msObj->Map->maxsize)) || (msObj->RefPnt.x < (-2*msObj->Map->maxsize))) {667 if(strcasecmp(mapserv->request->ParamNames[i],"ref.x") == 0) { /* mouse click in reference image, in pieces */ 668 mapserv->RefPnt.x = getNumeric(mapserv->request->ParamValues[i]); 669 if((mapserv->RefPnt.x > (2*mapserv->map->maxsize)) || (mapserv->RefPnt.x < (-2*mapserv->map->maxsize))) { 670 670 msSetError(MS_WEBERR, "Coordinate out of range.", "loadForm()"); 671 671 writeError(); 672 672 } 673 m sObj->CoordSource = FROMREFPNT;674 continue; 675 } 676 if(strcasecmp(m sObj->request->ParamNames[i],"ref.y") == 0) {677 m sObj->RefPnt.y = getNumeric(msObj->request->ParamValues[i]);678 if((m sObj->RefPnt.y > (2*msObj->Map->maxsize)) || (msObj->RefPnt.y < (-2*msObj->Map->maxsize))) {673 mapserv->CoordSource = FROMREFPNT; 674 continue; 675 } 676 if(strcasecmp(mapserv->request->ParamNames[i],"ref.y") == 0) { 677 mapserv->RefPnt.y = getNumeric(mapserv->request->ParamValues[i]); 678 if((mapserv->RefPnt.y > (2*mapserv->map->maxsize)) || (mapserv->RefPnt.y < (-2*mapserv->map->maxsize))) { 679 679 msSetError(MS_WEBERR, "Coordinate out of range.", "loadForm()"); 680 680 writeError(); 681 681 } 682 m sObj->CoordSource = FROMREFPNT;683 continue; 684 } 685 686 if(strcasecmp(m sObj->request->ParamNames[i],"refxy") == 0) { /* mouse click in reference image, single variable */687 tokens = msStringSplit(m sObj->request->ParamValues[i], ' ', &n);682 mapserv->CoordSource = FROMREFPNT; 683 continue; 684 } 685 686 if(strcasecmp(mapserv->request->ParamNames[i],"refxy") == 0) { /* mouse click in reference image, single variable */ 687 tokens = msStringSplit(mapserv->request->ParamValues[i], ' ', &n); 688 688 689 689 if(!tokens) { … … 697 697 } 698 698 699 m sObj->RefPnt.x = getNumeric(tokens[0]);700 m sObj->RefPnt.y = getNumeric(tokens[1]);699 mapserv->RefPnt.x = getNumeric(tokens[0]); 700 mapserv->RefPnt.y = getNumeric(tokens[1]); 701 701 702 702 msFreeCharArray(tokens, 2); 703 703 704 if((m sObj->RefPnt.x > (2*msObj->Map->maxsize)) || (msObj->RefPnt.x < (-2*msObj->Map->maxsize)) || (msObj->RefPnt.y > (2*msObj->Map->maxsize)) || (msObj->RefPnt.y < (-2*msObj->Map->maxsize))) {704 if((mapserv->RefPnt.x > (2*mapserv->map->maxsize)) || (mapserv->RefPnt.x < (-2*mapserv->map->maxsize)) || (mapserv->RefPnt.y > (2*mapserv->map->maxsize)) || (mapserv->RefPnt.y < (-2*mapserv->map->maxsize))) { 705 705 msSetError(MS_WEBERR, "Reference map coordinate out of range.", "loadForm()"); 706 706 writeError(); 707 707 } 708 708 709 m sObj->CoordSource = FROMREFPNT;710 continue; 711 } 712 713 if(strcasecmp(m sObj->request->ParamNames[i],"buffer") == 0) { /* radius (map units), actually 1/2 square side */714 m sObj->Buffer = getNumeric(msObj->request->ParamValues[i]);715 m sObj->CoordSource = FROMBUF;709 mapserv->CoordSource = FROMREFPNT; 710 continue; 711 } 712 713 if(strcasecmp(mapserv->request->ParamNames[i],"buffer") == 0) { /* radius (map units), actually 1/2 square side */ 714 mapserv->Buffer = getNumeric(mapserv->request->ParamValues[i]); 715 mapserv->CoordSource = FROMBUF; 716 716 QueryCoordSource = FROMUSERPNT; 717 717 continue; 718 718 } 719 719 720 if(strcasecmp(m sObj->request->ParamNames[i],"scale") == 0 || strcasecmp(msObj->request->ParamNames[i],"scaledenom") == 0) { /* scale for new map */721 m sObj->ScaleDenom = getNumeric(msObj->request->ParamValues[i]);722 if(m sObj->ScaleDenom <= 0) {720 if(strcasecmp(mapserv->request->ParamNames[i],"scale") == 0 || strcasecmp(mapserv->request->ParamNames[i],"scaledenom") == 0) { /* scale for new map */ 721 mapserv->ScaleDenom = getNumeric(mapserv->request->ParamValues[i]); 722 if(mapserv->ScaleDenom <= 0) { 723 723 msSetError(MS_WEBERR, "Scale out of range.", "loadForm()"); 724 724 writeError(); 725 725 } 726 m sObj->CoordSource = FROMSCALE;726 mapserv->CoordSource = FROMSCALE; 727 727 QueryCoordSource = FROMUSERPNT; 728 728 continue; 729 729 } 730 730 731 if(strcasecmp(m sObj->request->ParamNames[i],"imgsize") == 0) { /* size of existing image (pixels) */732 tokens = msStringSplit(m sObj->request->ParamValues[i], ' ', &n);731 if(strcasecmp(mapserv->request->ParamNames[i],"imgsize") == 0) { /* size of existing image (pixels) */ 732 tokens = msStringSplit(mapserv->request->ParamValues[i], ' ', &n); 733 733 734 734 if(!tokens) { … … 742 742 } 743 743 744 m sObj->ImgCols = (int)getNumeric(tokens[0]);745 m sObj->ImgRows = (int)getNumeric(tokens[1]);744 mapserv->ImgCols = (int)getNumeric(tokens[0]); 745 mapserv->ImgRows = (int)getNumeric(tokens[1]); 746 746 747 747 msFreeCharArray(tokens, 2); 748 748 749 if(m sObj->ImgCols > msObj->Map->maxsize || msObj->ImgRows > msObj->Map->maxsize || msObj->ImgCols < 0 || msObj->ImgRows < 0) {749 if(mapserv->ImgCols > mapserv->map->maxsize || mapserv->ImgRows > mapserv->map->maxsize || mapserv->ImgCols < 0 || mapserv->ImgRows < 0) { 750 750 msSetError(MS_WEBERR, "Image size out of range.", "loadForm()"); 751 751 writeError(); … … 755 755 } 756 756 757 if(strcasecmp(m sObj->request->ParamNames[i],"mapsize") == 0) { /* size of new map (pixels) */758 tokens = msStringSplit(m sObj->request->ParamValues[i], ' ', &n);757 if(strcasecmp(mapserv->request->ParamNames[i],"mapsize") == 0) { /* size of new map (pixels) */ 758 tokens = msStringSplit(mapserv->request->ParamValues[i], ' ', &n); 759 759 760 760 if(!tokens) { … … 768 768 } 769 769 770 m sObj->Map->width = (int)getNumeric(tokens[0]);771 m sObj->Map->height = (int)getNumeric(tokens[1]);770 mapserv->map->width = (int)getNumeric(tokens[0]); 771 mapserv->map->height = (int)getNumeric(tokens[1]); 772 772 773 773 msFreeCharArray(tokens, 2); 774 774 775 if(m sObj->Map->width > msObj->Map->maxsize || msObj->Map->height > msObj->Map->maxsize || msObj->Map->width < 0 || msObj->Map->height < 0) {775 if(mapserv->map->width > mapserv->map->maxsize || mapserv->map->height > mapserv->map->maxsize || mapserv->map->width < 0 || mapserv->map->height < 0) { 776 776 msSetError(MS_WEBERR, "Image size out of range.", "loadForm()"); 777 777 writeError(); … … 780 780 } 781 781 782 if(strncasecmp(m sObj->request->ParamNames[i],"layers", 6) == 0) { /* turn a set of layers, delimited by spaces, on */782 if(strncasecmp(mapserv->request->ParamNames[i],"layers", 6) == 0) { /* turn a set of layers, delimited by spaces, on */ 783 783 784 784 /* If layers=all then turn on all layers */ 785 if (strcasecmp(m sObj->request->ParamValues[i], "all") == 0 && msObj->Map != NULL) {785 if (strcasecmp(mapserv->request->ParamValues[i], "all") == 0 && mapserv->map != NULL) { 786 786 int l; 787 787 788 788 /* Reset NumLayers=0. If individual layers were already selected then free the previous values. */ 789 for(l=0; l<m sObj->NumLayers; l++)790 msFree(m sObj->Layers[l]);791 m sObj->NumLayers=0;792 793 for(m sObj->NumLayers=0; msObj->NumLayers < msObj->Map->numlayers; msObj->NumLayers++) {794 if(msGrowMapservLayers(m sObj) == MS_FAILURE)789 for(l=0; l<mapserv->NumLayers; l++) 790 msFree(mapserv->Layers[l]); 791 mapserv->NumLayers=0; 792 793 for(mapserv->NumLayers=0; mapserv->NumLayers < mapserv->map->numlayers; mapserv->NumLayers++) { 794 if(msGrowMapservLayers(mapserv) == MS_FAILURE) 795 795 writeError(); 796 796 797 if(GET_LAYER(m sObj->Map, msObj->NumLayers)->name) {798 m sObj->Layers[msObj->NumLayers] = strdup(GET_LAYER(msObj->Map, msObj->NumLayers)->name);797 if(GET_LAYER(mapserv->map, mapserv->NumLayers)->name) { 798 mapserv->Layers[mapserv->NumLayers] = strdup(GET_LAYER(mapserv->map, mapserv->NumLayers)->name); 799 799 } else { 800 m sObj->Layers[msObj->NumLayers] = strdup("");800 mapserv->Layers[mapserv->NumLayers] = strdup(""); 801 801 } 802 802 } … … 805 805 char **layers=NULL; 806 806 807 layers = msStringSplit(m sObj->request->ParamValues[i], ' ', &(num_layers));807 layers = msStringSplit(mapserv->request->ParamValues[i], ' ', &(num_layers)); 808 808 for(l=0; l<num_layers; l++) { 809 if(msGrowMapservLayers(m sObj) == MS_FAILURE)809 if(msGrowMapservLayers(mapserv) == MS_FAILURE) 810 810 writeError(); 811 m sObj->Layers[msObj->NumLayers++] = strdup(layers[l]);811 mapserv->Layers[mapserv->NumLayers++] = strdup(layers[l]); 812 812 } 813 813 … … 819 819 } 820 820 821 if(strncasecmp(m sObj->request->ParamNames[i],"layer", 5) == 0) { /* turn a single layer/group on */822 if(msGrowMapservLayers(m sObj) == MS_FAILURE)823 writeError(); 824 m sObj->Layers[msObj->NumLayers] = strdup(msObj->request->ParamValues[i]);825 m sObj->NumLayers++;826 continue; 827 } 828 829 if(strcasecmp(m sObj->request->ParamNames[i],"qlayer") == 0) { /* layer to query (i.e search) */830 QueryLayer = strdup(m sObj->request->ParamValues[i]);831 continue; 832 } 833 834 if(strcasecmp(m sObj->request->ParamNames[i],"qitem") == 0) { /* attribute to query on (optional) */835 QueryItem = strdup(m sObj->request->ParamValues[i]);836 continue; 837 } 838 839 if(strcasecmp(m sObj->request->ParamNames[i],"qstring") == 0) { /* attribute query string */840 QueryString = strdup(m sObj->request->ParamValues[i]);841 continue; 842 } 843 844 if(strcasecmp(m sObj->request->ParamNames[i],"slayer") == 0) { /* layer to select (for feature based search) */845 SelectLayer = strdup(m sObj->request->ParamValues[i]);846 continue; 847 } 848 849 if(strcasecmp(m sObj->request->ParamNames[i],"shapeindex") == 0) { /* used for index queries */850 ShapeIndex = (int)getNumeric(m sObj->request->ParamValues[i]);851 continue; 852 } 853 if(strcasecmp(m sObj->request->ParamNames[i],"tileindex") == 0) {854 TileIndex = (int)getNumeric(m sObj->request->ParamValues[i]);821 if(strncasecmp(mapserv->request->ParamNames[i],"layer", 5) == 0) { /* turn a single layer/group on */ 822 if(msGrowMapservLayers(mapserv) == MS_FAILURE) 823 writeError(); 824 mapserv->Layers[mapserv->NumLayers] = strdup(mapserv->request->ParamValues[i]); 825 mapserv->NumLayers++; 826 continue; 827 } 828 829 if(strcasecmp(mapserv->request->ParamNames[i],"qlayer") == 0) { /* layer to query (i.e search) */ 830 QueryLayer = strdup(mapserv->request->ParamValues[i]); 831 continue; 832 } 833 834 if(strcasecmp(mapserv->request->ParamNames[i],"qitem") == 0) { /* attribute to query on (optional) */ 835 QueryItem = strdup(mapserv->request->ParamValues[i]); 836 continue; 837 } 838 839 if(strcasecmp(mapserv->request->ParamNames[i],"qstring") == 0) { /* attribute query string */ 840 QueryString = strdup(mapserv->request->ParamValues[i]); 841 continue; 842 } 843
