Skip to content

Commit 62a2e07

Browse files
committed
some fixes to get ruleset up and running
1 parent 43c3732 commit 62a2e07

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

include/mapcache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,7 @@ mapcache_ruleset *mapcache_configuration_get_ruleset(mapcache_cfg *config, const
899899
void mapcache_configuration_add_image_format(mapcache_cfg *config, mapcache_image_format *format, const char * key);
900900
void mapcache_configuration_add_source(mapcache_cfg *config, mapcache_source *source, const char * key);
901901
void mapcache_configuration_add_grid(mapcache_cfg *config, mapcache_grid *grid, const char * key);
902+
void mapcache_configuration_add_ruleset(mapcache_cfg *config, mapcache_ruleset *ruleset, const char * key);
902903
void mapcache_configuration_add_tileset(mapcache_cfg *config, mapcache_tileset *tileset, const char * key);
903904
void mapcache_configuration_add_cache(mapcache_cfg *config, mapcache_cache *cache, const char * key);
904905

lib/configuration.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ void mapcache_configuration_add_grid(mapcache_cfg *config, mapcache_grid *grid,
271271
apr_hash_set(config->grids, key, APR_HASH_KEY_STRING, (void*)grid);
272272
}
273273

274+
void mapcache_configuration_add_ruleset(mapcache_cfg *config, mapcache_ruleset *ruleset, const char * key)
275+
{
276+
apr_hash_set(config->rulesets, key, APR_HASH_KEY_STRING, (void*)ruleset);
277+
}
278+
274279
void mapcache_configuration_add_tileset(mapcache_cfg *config, mapcache_tileset *tileset, const char * key)
275280
{
276281
tileset->config = config;

lib/configuration_xml.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ void parseRuleset(mapcache_context *ctx, ezxml_t node, mapcache_cfg *config)
244244
APR_ARRAY_PUSH(ruleset->rules, mapcache_rule*) = clone_rule;
245245
}
246246
}
247+
mapcache_configuration_add_ruleset(config,ruleset,ruleset->name);
247248
}
248249

249250
void parseGrid(mapcache_context *ctx, ezxml_t node, mapcache_cfg *config)
@@ -803,6 +804,7 @@ void parseTileset(mapcache_context *ctx, ezxml_t node, mapcache_cfg *config)
803804
if(rule) {
804805
mapcache_rule *rule_clone = mapcache_ruleset_rule_clone(ctx->pool, rule);
805806
if(rule->visible_extent) {
807+
rule_clone->visible_limits = apr_pcalloc(ctx->pool, sizeof(mapcache_extent_i));
806808
mapcache_grid_compute_limits_at_level(grid,rule_clone->visible_extent,rule_clone->visible_limits,tolerance,i);
807809
}
808810
APR_ARRAY_PUSH(gridlink->rules, mapcache_rule*) = rule_clone;

0 commit comments

Comments
 (0)