* class extensions for layerObj, always within the context of a map **********************************************************************/
| 409 | * class extensions for layerObj, always within the context of a map |
| 410 | **********************************************************************/ |
| 411 | layerObj *layerObj_new(mapObj *map) { |
| 412 | if(msGrowMapLayers(map) == NULL) |
| 413 | return(NULL); |
| 414 | |
| 415 | if(initLayer((map->layers[map->numlayers]), map) == -1) |
| 416 | return(NULL); |
| 417 | |
| 418 | map->layers[map->numlayers]->index = map->numlayers; |
| 419 | //Update the layer order list with the layer's index. |
| 420 | map->layerorder[map->numlayers] = map->numlayers; |
| 421 | |
| 422 | map->numlayers++; |
| 423 | |
| 424 | return (map->layers[map->numlayers-1]); |
| 425 | } |
| 426 | |
| 427 | void layerObj_destroy(layerObj *self) { |
| 428 | /* if the layer has a parent_map, let's the map object destroy it */ |
no test coverage detected