Skip to content

Commit

Permalink
Fix get_layers_from_json for external className
Browse files Browse the repository at this point in the history
  • Loading branch information
index-git committed Oct 12, 2023
1 parent a5a6ebd commit 4677c57
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
#### Data migrations
### Changes

## v1.22.1
2023-10-12
### Changes
- [#949](https://github.com/LayerManager/layman/issues/949) Fix reading map-layer relations from map composition that includes also other than WMS and Vector layers.

## v1.22.0
2023-10-05
### Upgrade requirements
Expand Down
23 changes: 23 additions & 0 deletions sample/layman.map/internal_url.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,29 @@
"title": "Hranice",
"visibility": false,
"wmsMaxScale": 0
},
{
"metadata": {},
"visibility": true,
"opacity": 1.0,
"title": "OpenStreetMap",
"className": "XYZ",
"singleTile": false,
"greyscale": false,
"base": false,
"wmsMaxScale": 0,
"maxResolution": null,
"minResolution": 0,
"url": "https://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png",
"params": {
"LAYERS": "",
"INFO_FORMAT": "application/vnd.ogc.gml",
"FORMAT": "",
"VERSION": "1.3.0"
},
"ratio": 1.5,
"dimensions": {},
"path": ""
}
]
}
2 changes: 2 additions & 0 deletions src/layman/map/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ def get_layers_from_json(map_json, *, x_forwarded_items=None):
'WMS': _get_layer_url_from_wms_json,
'Vector': _get_layer_url_from_vector_json,
}.get(class_name)
if not layer_url_getter:
continue
layer_url = layer_url_getter(map_layer)
if not layer_url:
continue
Expand Down

0 comments on commit 4677c57

Please sign in to comment.