@@ -65,20 +65,20 @@ void _mapcache_source_wms_render_map(mapcache_context *ctx, mapcache_source *pso
6565 apr_table_setn (params ,"SRS" ,map -> grid_link -> grid -> srs );
6666
6767 apr_table_overlap (params ,wms -> getmap_params ,APR_OVERLAP_TABLES_SET );
68-
68+
6969 if (map -> dimensions && map -> dimensions -> nelts > 0 ) {
7070 int i ;
7171 for (i = 0 ; i < map -> dimensions -> nelts ; i ++ ) {
7272 mapcache_requested_dimension * rdim = APR_ARRAY_IDX (map -> dimensions ,i ,mapcache_requested_dimension * );
7373 /* set both DIM_key=val and key=val KVP params */
74- apr_table_setn (params ,rdim -> dimension -> name ,rdim -> requested_value );
74+ apr_table_setn (params ,rdim -> dimension -> name ,rdim -> cached_value ? rdim -> cached_value : rdim -> requested_value );
7575 if (strcasecmp (rdim -> dimension -> name ,"TIME" ) && strcasecmp (rdim -> dimension -> name ,"ELEVATION" )) {
7676 char * dim_name = apr_pstrcat (ctx -> pool ,"DIM_" ,rdim -> dimension -> name ,NULL );
77- apr_table_setn (params ,dim_name ,rdim -> requested_value );
77+ apr_table_setn (params ,dim_name ,rdim -> cached_value ? rdim -> cached_value : rdim -> requested_value );
7878 }
7979 }
8080 }
81-
81+
8282 /* if the source has no LAYERS parameter defined, then use the tileset name
8383 * as the LAYERS to request. When using mirror-mode, the source has no layers
8484 * defined, it is added based on the incoming request
@@ -119,7 +119,7 @@ void _mapcache_source_wms_query(mapcache_context *ctx, mapcache_source *source,
119119 apr_table_setn (params ,"INFO_FORMAT" ,fi -> format );
120120
121121 apr_table_overlap (params ,wms -> getfeatureinfo_params ,0 );
122-
122+
123123 if (map -> dimensions && map -> dimensions -> nelts > 0 ) {
124124 int i ;
125125 for (i = 0 ; i < map -> dimensions -> nelts ; i ++ ) {
0 commit comments