示例#1
0
int msSetConfigOption( mapObj *map, const char *key, const char *value)

{
  /* We have special "early" handling of this so that it will be */
  /* in effect when the projection blocks are parsed and pj_init is called. */
  if( strcasecmp(key,"PROJ_LIB") == 0 ) {
    /* value may be relative to map path */
    msSetPROJ_LIB( value, map->mappath );
  }

  /* Same for MS_ERRORFILE, we want it to kick in as early as possible
   * to catch parsing errors.
   * Value can be relative to mapfile, unless it's already absolute
   */
  if( strcasecmp(key,"MS_ERRORFILE") == 0 ) {
    if (msSetErrorFile( value, map->mappath ) != MS_SUCCESS)
      return MS_FAILURE;
  }

  if( msLookupHashTable( &(map->configoptions), key ) != NULL )
    msRemoveHashTable( &(map->configoptions), key );
  msInsertHashTable( &(map->configoptions), key, value );

  return MS_SUCCESS;
}
示例#2
0
static void msTileResetMetatileLevel(mapObj *map) {
  hashTableObj *meta = &(map->web.metadata); 
  const char *zero = "0";
  const char *value = NULL;

  /*  Is the tile_metatile_levetl set... */
  if((value = msLookupHashTable(meta, "tile_metatile_level")) != NULL) {
    msRemoveHashTable(meta, "tile_metatile_level");
    msInsertHashTable(meta, "tile_metatile_level", zero);
  }
  /* No tile_metatile_level value. */
  else {
    msInsertHashTable(meta, "tile_metatile_level", zero);
  }
}
示例#3
0
int mapObj_removeMetaData(mapObj *self, char *name) {
    return(msRemoveHashTable(&(self->web.metadata), name));
}