** Initialize, load and free a mapObj structure ** ** This really belongs in mapobject.c, but currently it also depends on ** lots of other init methods in this file. */
| 5006 | ** lots of other init methods in this file. |
| 5007 | */ |
| 5008 | int initMap(mapObj *map) |
| 5009 | { |
| 5010 | int i=0; |
| 5011 | MS_REFCNT_INIT(map); |
| 5012 | |
| 5013 | map->debug = (int)msGetGlobalDebugLevel(); |
| 5014 | |
| 5015 | /* Set maxlayers = 0, layers[] and layerorder[] will be allocated as needed, |
| 5016 | * on the first call to msGrowMapLayers() |
| 5017 | */ |
| 5018 | map->numlayers = 0; |
| 5019 | map->maxlayers = 0; |
| 5020 | map->layers = NULL; |
| 5021 | map->layerorder = NULL; /* used to modify the order in which the layers are drawn */ |
| 5022 | |
| 5023 | map->status = MS_ON; |
| 5024 | map->name = msStrdup("MS"); |
| 5025 | map->extent.minx = map->extent.miny = map->extent.maxx = map->extent.maxy = -1.0; |
| 5026 | |
| 5027 | map->scaledenom = -1.0; |
| 5028 | map->resolution = MS_DEFAULT_RESOLUTION; /* pixels per inch */ |
| 5029 | map->defresolution = MS_DEFAULT_RESOLUTION; /* pixels per inch */ |
| 5030 | |
| 5031 | map->height = map->width = -1; |
| 5032 | map->maxsize = MS_MAXIMAGESIZE_DEFAULT; |
| 5033 | |
| 5034 | map->gt.need_geotransform = MS_FALSE; |
| 5035 | map->gt.rotation_angle = 0.0; |
| 5036 | |
| 5037 | map->units = MS_METERS; |
| 5038 | map->cellsize = 0; |
| 5039 | map->shapepath = NULL; |
| 5040 | map->mappath = NULL; |
| 5041 | |
| 5042 | MS_INIT_COLOR(map->imagecolor, 255,255,255,255); /* white */ |
| 5043 | |
| 5044 | map->numoutputformats = 0; |
| 5045 | map->outputformatlist = NULL; |
| 5046 | map->outputformat = NULL; |
| 5047 | |
| 5048 | /* map->configoptions = msCreateHashTable();; */ |
| 5049 | initHashTable(&(map->configoptions)); |
| 5050 | |
| 5051 | map->imagetype = NULL; |
| 5052 | |
| 5053 | map->palette.numcolors = 0; |
| 5054 | |
| 5055 | map->transparent = MS_NOOVERRIDE; |
| 5056 | map->interlace = MS_NOOVERRIDE; |
| 5057 | map->imagequality = MS_NOOVERRIDE; |
| 5058 | |
| 5059 | for(i=0; i<MS_MAX_LABEL_PRIORITY; i++) { |
| 5060 | map->labelcache.slots[i].labels = NULL; /* cache is initialize at draw time */ |
| 5061 | map->labelcache.slots[i].cachesize = 0; |
| 5062 | map->labelcache.slots[i].numlabels = 0; |
| 5063 | map->labelcache.slots[i].markers = NULL; |
| 5064 | map->labelcache.slots[i].markercachesize = 0; |
| 5065 | map->labelcache.slots[i].nummarkers = 0; |
no test coverage detected