|
33 | 33 |
|
34 | 34 |
|
35 | 35 | config_by_key: Dict[str, Dict[str, Any]] = defaultdict(dict) |
36 | | -for (config_id, config_source) in config["sources"].items(): |
| 36 | +for config_id, config_source in config["sources"].items(): |
37 | 37 | config_by_key[config_source["key"]][config_id] = config_source |
38 | 38 |
|
39 | 39 | style_by_key: Dict[str, Dict[str, Any]] = defaultdict(dict) |
40 | | -for (config_id, config_source) in config["sources"].items(): |
41 | | - for (style_id, style_config) in (config_source.get("styles") or {}).items(): |
| 40 | +for config_id, config_source in config["sources"].items(): |
| 41 | + for style_id, style_config in (config_source.get("styles") or {}).items(): |
42 | 42 | style_by_key[config_source["key"]][style_id] = { |
43 | 43 | "config_id": config_id, |
44 | 44 | "style_config": style_config, |
@@ -105,8 +105,8 @@ class MergeConfig(object): |
105 | 105 |
|
106 | 106 |
|
107 | 107 | merge_config: Dict[str, Dict[str, Any]] = defaultdict(dict) |
108 | | -for (key, source_id_confs) in config_by_key.items(): |
109 | | - for (source_id, source_conf) in source_id_confs.items(): |
| 108 | +for key, source_id_confs in config_by_key.items(): |
| 109 | + for source_id, source_conf in source_id_confs.items(): |
110 | 110 | try: |
111 | 111 | tile_in_poly = None |
112 | 112 | polygon_path = config_path + source_id + ".geojson" |
@@ -241,20 +241,22 @@ async def style(style_id: str, key: str, request: Request): |
241 | 241 |
|
242 | 242 | style_gl = StyleGL( |
243 | 243 | url=style_config["url"], |
244 | | - overwrite={ |
245 | | - "sources": { |
246 | | - style_config["merged_source"]: { |
247 | | - "type": "vector", |
248 | | - "url": public_url(request) |
249 | | - + public_base_path |
250 | | - + app.url_path_for("tilejson", data_id=id) |
251 | | - + "?" |
252 | | - + str(request.query_params), |
| 244 | + overwrite=( |
| 245 | + { |
| 246 | + "sources": { |
| 247 | + style_config["merged_source"]: { |
| 248 | + "type": "vector", |
| 249 | + "url": public_url(request) |
| 250 | + + public_base_path |
| 251 | + + app.url_path_for("tilejson", data_id=id) |
| 252 | + + "?" |
| 253 | + + str(request.query_params), |
| 254 | + } |
253 | 255 | } |
254 | 256 | } |
255 | | - } |
256 | | - if style_config.get("merged_source") |
257 | | - else {}, |
| 257 | + if style_config.get("merged_source") |
| 258 | + else {} |
| 259 | + ), |
258 | 260 | ) |
259 | 261 |
|
260 | 262 | if style_config.get("sprite"): |
|
0 commit comments