diff --git a/examples/test.jGIS b/examples/test.jGIS index 973ddd16..b2442787 100644 --- a/examples/test.jGIS +++ b/examples/test.jGIS @@ -1,40 +1,69 @@ { + "layerTree": [ + "a0044fd7-f167-445f-b3d1-620a8f94b498", + { + "layers": [ + "2467576f-b527-4cb7-998d-fa1d056fb8a1", + { + "layers": [ + "57ef55ef-facb-48a2-ae1d-c9c824be3e8a" + ], + "name": "level 2 group" + } + ], + "name": "level 1 group" + } + ], "layers": { + "2467576f-b527-4cb7-998d-fa1d056fb8a1": { + "name": "Open Street Map", + "parameters": { + "source": "699facc9-e7c4-4f38-acf1-1fd7f02d9f36" + }, + "type": "RasterLayer", + "visible": true + }, "57ef55ef-facb-48a2-ae1d-c9c824be3e8a": { + "name": "Regions France", "parameters": { - "source": "7d082e75-69d5-447a-82d8-b05cca5945ba", - "type": "line", "color": "#e66100", - "opacity": 0.6 + "opacity": 0.6, + "source": "7d082e75-69d5-447a-82d8-b05cca5945ba", + "type": "line" }, - "name": "Regions France", - "visible": true, - "type": "VectorLayer" + "type": "VectorLayer", + "visible": true }, "a0044fd7-f167-445f-b3d1-620a8f94b498": { - "type": "RasterLayer", - "visible": true, "name": "Open Topo Map", "parameters": { "source": "5fd42e3b-4681-4607-b15d-65c3a3e89b32" - } - }, - "2467576f-b527-4cb7-998d-fa1d056fb8a1": { - "parameters": { - "source": "699facc9-e7c4-4f38-acf1-1fd7f02d9f36" }, "type": "RasterLayer", - "name": "Open Street Map", "visible": true } }, + "options": { + "latitude": 45.83799886047626, + "longitude": 1.195999428191726, + "zoom": 4.075821017792898 + }, "sources": { "5fd42e3b-4681-4607-b15d-65c3a3e89b32": { "name": "Open Topo Map", "parameters": { + "maxZoom": 24.0, "minZoom": 0.0, - "url": "https://tile.opentopomap.org/{z}/{x}/{y}.png ", - "maxZoom": 24.0 + "url": "https://tile.opentopomap.org/{z}/{x}/{y}.png " + }, + "type": "RasterSource" + }, + "699facc9-e7c4-4f38-acf1-1fd7f02d9f36": { + "name": "Open Street Map", + "parameters": { + "maxZoom": 24.0, + "minZoom": 0.0, + "url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png" }, "type": "RasterSource" }, @@ -45,35 +74,6 @@ "valid": true }, "type": "GeoJSONSource" - }, - "699facc9-e7c4-4f38-acf1-1fd7f02d9f36": { - "type": "RasterSource", - "name": "Open Street Map", - "parameters": { - "minZoom": 0.0, - "maxZoom": 24.0, - "url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png" - } - } - }, - "options": { - "latitude": 0, - "longitude": 0, - "zoom": 0 - }, - "layerTree": [ - "a0044fd7-f167-445f-b3d1-620a8f94b498", - { - "name": "level 1 group", - "layers": [ - "2467576f-b527-4cb7-998d-fa1d056fb8a1", - { - "name": "level 2 group", - "layers": [ - "57ef55ef-facb-48a2-ae1d-c9c824be3e8a" - ] - } - ] } - ] -} + } +} \ No newline at end of file diff --git a/python/jupytergis_core/jupytergis_core/jgis_ydoc.py b/python/jupytergis_core/jupytergis_core/jgis_ydoc.py index ad7c002d..2843e045 100644 --- a/python/jupytergis_core/jupytergis_core/jgis_ydoc.py +++ b/python/jupytergis_core/jupytergis_core/jgis_ydoc.py @@ -29,6 +29,7 @@ def get(self) -> str: layers_tree = self._ylayerTree.to_py() return json.dumps( dict(layers=layers, sources=sources, options=options, layerTree=layers_tree), + sort_keys=True, indent=2, ) diff --git a/ui-tests/tests/left-panel.spec.ts-snapshots/top-layer-hidden-linux.png b/ui-tests/tests/left-panel.spec.ts-snapshots/top-layer-hidden-linux.png index b9bc0910..b786e3f0 100644 Binary files a/ui-tests/tests/left-panel.spec.ts-snapshots/top-layer-hidden-linux.png and b/ui-tests/tests/left-panel.spec.ts-snapshots/top-layer-hidden-linux.png differ diff --git a/ui-tests/tests/left-panel.spec.ts-snapshots/top-layer-not-hidden-linux.png b/ui-tests/tests/left-panel.spec.ts-snapshots/top-layer-not-hidden-linux.png index 1afd85db..d63ad9fd 100644 Binary files a/ui-tests/tests/left-panel.spec.ts-snapshots/top-layer-not-hidden-linux.png and b/ui-tests/tests/left-panel.spec.ts-snapshots/top-layer-not-hidden-linux.png differ diff --git a/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jGIS-linux.png b/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jGIS-linux.png index 24575f30..257894aa 100644 Binary files a/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jGIS-linux.png and b/ui-tests/tests/ui.spec.ts-snapshots/Render-test-jGIS-linux.png differ