Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 1.22.1 #950

Merged
merged 4 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 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
3 changes: 2 additions & 1 deletion src/layman/upgrade/upgrade_v1_22.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def insert_map_layer_relations():
maps = db_util.run_query(query, (MAP_TYPE, ))

for map_id, workspace, map_name in maps:
logger.info(f' Import map-layer relations for map {workspace}.{map_name}')
map_file_path = os.path.join(settings.LAYMAN_DATA_DIR, 'workspaces', workspace, 'maps', map_name, 'input_file', map_name + '.json')
try:
with open(map_file_path, 'r', encoding="utf-8") as map_file:
Expand All @@ -103,4 +104,4 @@ def insert_map_layer_relations():
insert into {DB_SCHEMA}.map_layer(id_map, layer_workspace, layer_name, layer_index) values (%s, %s, %s, %s);
'''
db_util.run_statement(insert_query, (map_id, layer_workspace, layer_name, layer_index, ))
logger.info(f' Number of imported map-layer relations for map {workspace}.{map_name}: {len(map_layers)}')
logger.info(f' Number of imported relations: {len(map_layers)}')
4 changes: 2 additions & 2 deletions version.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
v1.22.0
2023-10-05T14:00:00Z
v1.22.1
2023-10-12T12:00:00Z
Loading