From feec5950ac8f09e7c0271d5c6e05de9e898f1a1c Mon Sep 17 00:00:00 2001 From: Nour-Cheour10 Date: Wed, 14 Aug 2024 15:14:15 +0200 Subject: [PATCH] added test notebooks --- docs/source/examples/fullscreen.nblink | 3 - docs/source/examples/geojson.nblink | 3 - docs/source/examples/geotiff.nblink | 3 - docs/source/examples/heatmap.nblink | 3 - docs/source/examples/imageoverlay.nblink | 3 - docs/source/examples/index.rst | 17 - docs/source/examples/mouseposition.nblink | 3 - docs/source/examples/popupoverlay.nblink | 3 - docs/source/examples/rastertilelayer.nblink | 3 - docs/source/examples/scaleline.nblink | 3 - docs/source/examples/vectortilelayer.nblink | 3 - docs/source/examples/videooverlay.nblink | 3 - docs/source/examples/zoomslider.nblink | 3 - examples/GeojsonLayer.ipynb | 497 ------------------ examples/RasterLayer.ipynb | 133 ----- examples/VectorTileLayer.ipynb | 329 ------------ .../notebooks/FullScreenControl_update.ipynb | 0 .../notebooks/GeoTIFFTileLayer_update.ipynb | 27 +- .../tests/notebooks/GeojsonLayer_update.ipynb | 175 ++++++ .../tests/notebooks/HeatmapLayer_update.ipynb | 40 +- .../tests/notebooks/ImageOverlay_update.ipynb | 35 +- .../MousePositionControl_update.ipynb | 0 .../tests/notebooks/PopupOverlay_update.ipynb | 27 +- .../tests/notebooks/RasterLayer_update.ipynb | 53 ++ .../notebooks/ScaleLineControl_update.ipynb | 0 .../tests/notebooks/VideoOverlay_update.ipynb | 47 +- .../notebooks/ZoomSliderControl_update.ipynb | 0 27 files changed, 239 insertions(+), 1177 deletions(-) delete mode 100644 docs/source/examples/fullscreen.nblink delete mode 100644 docs/source/examples/geojson.nblink delete mode 100644 docs/source/examples/geotiff.nblink delete mode 100644 docs/source/examples/heatmap.nblink delete mode 100644 docs/source/examples/imageoverlay.nblink delete mode 100644 docs/source/examples/index.rst delete mode 100644 docs/source/examples/mouseposition.nblink delete mode 100644 docs/source/examples/popupoverlay.nblink delete mode 100644 docs/source/examples/rastertilelayer.nblink delete mode 100644 docs/source/examples/scaleline.nblink delete mode 100644 docs/source/examples/vectortilelayer.nblink delete mode 100644 docs/source/examples/videooverlay.nblink delete mode 100644 docs/source/examples/zoomslider.nblink delete mode 100644 examples/GeojsonLayer.ipynb delete mode 100644 examples/RasterLayer.ipynb delete mode 100644 examples/VectorTileLayer.ipynb rename examples/FullScreenControl.ipynb => ui-tests/tests/notebooks/FullScreenControl_update.ipynb (100%) rename examples/GeoTIFFTileLayer.ipynb => ui-tests/tests/notebooks/GeoTIFFTileLayer_update.ipynb (76%) create mode 100644 ui-tests/tests/notebooks/GeojsonLayer_update.ipynb rename examples/HeatmapLayer.ipynb => ui-tests/tests/notebooks/HeatmapLayer_update.ipynb (76%) rename examples/ImageOverlay.ipynb => ui-tests/tests/notebooks/ImageOverlay_update.ipynb (70%) rename examples/MousePositionControl.ipynb => ui-tests/tests/notebooks/MousePositionControl_update.ipynb (100%) rename examples/PopupOverlay.ipynb => ui-tests/tests/notebooks/PopupOverlay_update.ipynb (67%) create mode 100644 ui-tests/tests/notebooks/RasterLayer_update.ipynb rename examples/ScaleLineControl.ipynb => ui-tests/tests/notebooks/ScaleLineControl_update.ipynb (100%) rename examples/VideoOverlay.ipynb => ui-tests/tests/notebooks/VideoOverlay_update.ipynb (52%) rename examples/ZoomSliderControl.ipynb => ui-tests/tests/notebooks/ZoomSliderControl_update.ipynb (100%) diff --git a/docs/source/examples/fullscreen.nblink b/docs/source/examples/fullscreen.nblink deleted file mode 100644 index 620b7fc..0000000 --- a/docs/source/examples/fullscreen.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/FullScreenControl.ipynb" -} \ No newline at end of file diff --git a/docs/source/examples/geojson.nblink b/docs/source/examples/geojson.nblink deleted file mode 100644 index 7c8b770..0000000 --- a/docs/source/examples/geojson.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/GeojsonLayer.ipynb" -} \ No newline at end of file diff --git a/docs/source/examples/geotiff.nblink b/docs/source/examples/geotiff.nblink deleted file mode 100644 index 2c66287..0000000 --- a/docs/source/examples/geotiff.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/GeoTIFFTileLayer.ipynb" -} \ No newline at end of file diff --git a/docs/source/examples/heatmap.nblink b/docs/source/examples/heatmap.nblink deleted file mode 100644 index fba5a6b..0000000 --- a/docs/source/examples/heatmap.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/HeatmapLayer.ipynb" -} \ No newline at end of file diff --git a/docs/source/examples/imageoverlay.nblink b/docs/source/examples/imageoverlay.nblink deleted file mode 100644 index 6840783..0000000 --- a/docs/source/examples/imageoverlay.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/ImageOverlay.ipynb" -} \ No newline at end of file diff --git a/docs/source/examples/index.rst b/docs/source/examples/index.rst deleted file mode 100644 index 5147cde..0000000 --- a/docs/source/examples/index.rst +++ /dev/null @@ -1,17 +0,0 @@ - -Examples -======== - -This section contains several examples generated from Jupyter notebooks. -The widgets have been embedded into the page for demonstrative purposes. - -.. todo:: - - Add links to notebooks in examples folder similar to the initial - one. This is a manual step to ensure only those examples that - are suited for inclusion are used. - -.. toctree:: - :glob: - - * diff --git a/docs/source/examples/mouseposition.nblink b/docs/source/examples/mouseposition.nblink deleted file mode 100644 index f803686..0000000 --- a/docs/source/examples/mouseposition.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/MousePositionControl.ipynb" -} \ No newline at end of file diff --git a/docs/source/examples/popupoverlay.nblink b/docs/source/examples/popupoverlay.nblink deleted file mode 100644 index 63fb28a..0000000 --- a/docs/source/examples/popupoverlay.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/PopupOverlay.ipynb" -} \ No newline at end of file diff --git a/docs/source/examples/rastertilelayer.nblink b/docs/source/examples/rastertilelayer.nblink deleted file mode 100644 index 6dd4380..0000000 --- a/docs/source/examples/rastertilelayer.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/RasterLayer.ipynb" -} \ No newline at end of file diff --git a/docs/source/examples/scaleline.nblink b/docs/source/examples/scaleline.nblink deleted file mode 100644 index f5e7c4f..0000000 --- a/docs/source/examples/scaleline.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/ScaleLineControl.ipynb" -} \ No newline at end of file diff --git a/docs/source/examples/vectortilelayer.nblink b/docs/source/examples/vectortilelayer.nblink deleted file mode 100644 index e381e0e..0000000 --- a/docs/source/examples/vectortilelayer.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/VectorTileLayer.ipynb" -} \ No newline at end of file diff --git a/docs/source/examples/videooverlay.nblink b/docs/source/examples/videooverlay.nblink deleted file mode 100644 index 90846e3..0000000 --- a/docs/source/examples/videooverlay.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/VideoOverlay.ipynb" -} \ No newline at end of file diff --git a/docs/source/examples/zoomslider.nblink b/docs/source/examples/zoomslider.nblink deleted file mode 100644 index 776c706..0000000 --- a/docs/source/examples/zoomslider.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../../examples/ZoomSliderControl.ipynb" -} \ No newline at end of file diff --git a/examples/GeojsonLayer.ipynb b/examples/GeojsonLayer.ipynb deleted file mode 100644 index 19a3c62..0000000 --- a/examples/GeojsonLayer.ipynb +++ /dev/null @@ -1,497 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "07567690-279d-4a51-a3b8-3e78966e5a3a", - "metadata": {}, - "source": [ - "# GeoJson Layer" - ] - }, - { - "cell_type": "code", - "execution_count": 35, - "id": "9c7bb99b-68dc-404f-aced-81ad043c2df2", - "metadata": {}, - "outputs": [], - "source": [ - "from ipyopenlayers import Map,GeoJSON, ZoomSlider\n", - "import os\n", - "import requests\n", - "import json" - ] - }, - { - "cell_type": "code", - "execution_count": 62, - "id": "5bbf9a36-083d-43f1-85ed-a392424447a4", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "451b9d4f57c343ea9d8afc52cf214e6a", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Map(center=[-77.03534004873038, 34.587039008217644], zoom=10.0)" - ] - }, - "execution_count": 62, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "m = Map(center=[-77.03534004873038, 34.587039008217644], zoom=10)\n", - "m" - ] - }, - { - "cell_type": "code", - "execution_count": 63, - "id": "6564da20-a54b-482a-ab27-a521ccea8ce4", - "metadata": {}, - "outputs": [], - "source": [ - "import json\n", - "\n", - "with open(\"demo.json\") as f:\n", - " data = json.load(f)\n", - "\n", - "g = GeoJSON(data=data)\n", - "m.add_layer(g)" - ] - }, - { - "cell_type": "code", - "execution_count": 64, - "id": "8ecc1b16-7bf9-4487-ba70-1e1af6b49b27", - "metadata": { - "jupyter": { - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "g.style = {\n", - " 'strokeColor': '#1966ad', \n", - " 'strokeWidth': 2, \n", - " 'pointRadius': 7, \n", - " 'fillColor': '#e3eef8', \n", - " 'pointFillColor': '#8cc0dd',\n", - " 'pointStrokeColor': '#084b93',\n", - " 'pointStrokeWidth': 1.5 \n", - "}\n" - ] - }, - { - "cell_type": "code", - "execution_count": 59, - "id": "31789e86-94e3-4952-834d-17e2f400c8d3", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "09f73e3ffc004fa8a0dea52539df62e5", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Map(center=[12.930664347487689, 34.39178723145926], zoom=5.8)" - ] - }, - "execution_count": 59, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "map = Map(center=[12.930664347487689, 34.39178723145926], zoom=5.8)\n", - "map" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "id": "e4d4a16f-fdbe-455b-912a-55ee206706b6", - "metadata": {}, - "outputs": [], - "source": [ - "zoom_slider = ZoomSlider()\n", - "map.add_control(zoom_slider)" - ] - }, - { - "cell_type": "code", - "execution_count": 60, - "id": "efa97fc4-5fdf-4ef8-a224-de9f41f7da11", - "metadata": { - "jupyter": { - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "geo=GeoJSON(data={\n", - " \"type\": \"FeatureCollection\",\n", - " \"features\": [\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia0\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.1815, 36.8065]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Tunis\",\n", - " \"value\": 18.25\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia1\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [9.5375, 33.8869]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Kairouan\",\n", - " \"value\": 17.92\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia2\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.0732, 36.7949]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"La Marsa\",\n", - " \"value\": 17.54\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia3\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.6370, 35.8256]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Monastir\",\n", - " \"value\": 17.30\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia4\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.3023, 36.7278]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Ariana\",\n", - " \"value\": 17.15\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia5\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.5474, 36.3650]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Hammamet\",\n", - " \"value\": 16.89\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia6\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [11.0732, 33.5035]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Djerba\",\n", - " \"value\": 16.63\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia7\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.7603, 34.7406]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Sfax\",\n", - " \"value\": 16.52\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia8\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.1647, 36.8665]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Carthage\",\n", - " \"value\": 16.35\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia9\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.6204, 36.4330]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Nabeul\",\n", - " \"value\": 16.12\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia10\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.0963, 35.6781]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Sousse\",\n", - " \"value\": 15.95\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia11\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [9.8739, 37.2760]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Bizerte\",\n", - " \"value\": 15.72\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia12\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.0464, 36.8164]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Le Bardo\",\n", - " \"value\": 15.55\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia13\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.1007, 35.6717]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Mahdia\",\n", - " \"value\": 15.48\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia14\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.4503, 32.9330]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Gabès\",\n", - " \"value\": 15.29\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia15\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.6477, 35.6780]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"El Jem\",\n", - " \"value\": 15.18\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia16\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.7070, 34.7407]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Thyna\",\n", - " \"value\": 14.94\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia17\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.4563, 35.0081]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Ksar Hellal\",\n", - " \"value\": 14.77\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia18\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.1002, 33.8878]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"Zarzis\",\n", - " \"value\": 14.63\n", - " }\n", - " },\n", - " {\n", - " \"type\": \"Feature\",\n", - " \"id\": \"tunisia19\",\n", - " \"geometry\": {\n", - " \"type\": \"Point\",\n", - " \"coordinates\": [10.0768, 36.8014]\n", - " },\n", - " \"properties\": {\n", - " \"name\": \"La Goulette\",\n", - " \"value\": 14.50\n", - " }\n", - " }\n", - " ]\n", - "})\n", - "map.add_layer(geo)" - ] - }, - { - "cell_type": "code", - "execution_count": 61, - "id": "c53d7c1f-ba1d-486a-941e-f42da9b03c71", - "metadata": { - "jupyter": { - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "geo.style={ \n", - " 'pointRadius': 7, \n", - " 'fillColor': '#FFB6C1', \n", - " 'pointFillColor': '#98FB98', \n", - " 'pointStrokeColor': '#8A2BE2',\n", - " 'pointStrokeWidth': 1.5\n", - "}" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "id": "27ba2afb-6330-47ce-97eb-ab5c73c4924d", - "metadata": { - "jupyter": { - "source_hidden": true - } - }, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "b10b3f4ade45456e85bf9bcd41793a28", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Map(center=[2.292993630573249, 49.62376705148722], zoom=0.0)" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# the GeoJSON file\n", - "if not os.path.exists('europe_110.geo.json'):\n", - " url = 'https://raw.githubusercontent.com/jupyter-widgets/ipyleaflet/master/examples/europe_110.geo.json'\n", - " r = requests.get(url)\n", - " with open('europe_110.geo.json', 'w') as f:\n", - " f.write(r.content.decode(\"utf-8\"))\n", - "\n", - "# Read the GeoJSON file\n", - "with open('europe_110.geo.json', 'r') as f:\n", - " data = json.load(f)\n", - "\n", - "# Create a map with coordinates centered on Europe\n", - "euro_map = Map(center=[2.292993630573249, 49.62376705148722], zoom=0) # Note the coordinate order: [latitude, longitude]\n", - "\n", - "# Add the GeoJSON layer with the defined style\n", - "geo_json = GeoJSON(\n", - " data=data\n", - ")\n", - "# Add the GeoJSON layer to the map\n", - "euro_map.add_layer(geo_json)\n", - "euro_map" - ] - }, - { - "cell_type": "code", - "execution_count": 44, - "id": "cc4610dc-efff-455f-b6fa-20be67b626e0", - "metadata": { - "jupyter": { - "source_hidden": true - } - }, - "outputs": [], - "source": [ - "geo_json.style = {\n", - " 'strokeColor': '#004d40', \n", - " 'strokeWidth': 2, \n", - " 'pointRadius': 7, \n", - " 'fillColor': '#80cbc4'\n", - "}" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.14" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/examples/RasterLayer.ipynb b/examples/RasterLayer.ipynb deleted file mode 100644 index 4bc12af..0000000 --- a/examples/RasterLayer.ipynb +++ /dev/null @@ -1,133 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Introduction" - ] - }, - { - "cell_type": "code", - "execution_count": 37, - "metadata": {}, - "outputs": [], - "source": [ - "from ipyopenlayers import Map, RasterTileLayer" - ] - }, - { - "cell_type": "code", - "execution_count": 38, - "metadata": {}, - "outputs": [], - "source": [ - "import configparser\n", - "config = configparser.ConfigParser()\n", - "config.read('.config.ini')\n", - "key = config['DEFAULT']['key']" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [], - "source": [ - "layere=RasterTileLayer(url=\"https://{a-c}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png\")" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": {}, - "outputs": [], - "source": [ - "m.add_layer(layere) " - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [], - "source": [ - "attributions = '© MapTiler ' +'© OpenStreetMap contributors';\n", - "\n", - "raster = RasterTileLayer(attributions=attributions,url='https://api.maptiler.com/maps/dataviz-dark/{z}/{x}/{y}.png?key=' + key,\n", - " tileSize= 512)\n", - "m.add_layer(raster) " - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "scrolled": true - }, - "outputs": [], - "source": [ - "m.remove_layer(raster)" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [], - "source": [ - "attributions = [\n", - " '© MapTiler',\n", - " '© OpenStreetMap contributors'\n", - "]\n", - "\n", - "rasterlay = RasterTileLayer(url=f'https://api.maptiler.com/maps/satellite/{{z}}/{{x}}/{{y}}.jpg?key={key}',attributions=attributions,tileSize=512,maxZoom=20)\n", - "m.add_layer(rasterlay)" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [], - "source": [ - "m.remove_layer(rasterlay)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.14" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/examples/VectorTileLayer.ipynb b/examples/VectorTileLayer.ipynb deleted file mode 100644 index 48458ea..0000000 --- a/examples/VectorTileLayer.ipynb +++ /dev/null @@ -1,329 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "3e872bf4-ebce-4bf9-a693-45bbe7296b50", - "metadata": {}, - "outputs": [], - "source": [ - "from ipyopenlayers import Map, VectorTileLayer, RasterTileLayer" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "b86d142b-3904-4340-ab94-285b25998834", - "metadata": {}, - "outputs": [], - "source": [ - "import configparser\n", - "config = configparser.ConfigParser()\n", - "config.read('.config.ini')\n", - "key = config['DEFAULT']['key']" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "7fa3311c-d409-4c46-9493-5d99cc92bd49", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "6a4b7520245b424a970250173d482205", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Map(center=[4.299875503991089, 46.85012303279379], zoom=0.0)" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "m = Map(center=[4.299875503991089, 46.85012303279379], zoom=0)\n", - "m" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "45bcff0e-d17e-45c1-8ae3-cde10b6936a8", - "metadata": {}, - "outputs": [], - "source": [ - "raster=RasterTileLayer()\n", - "m.add_layer(raster) " - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "925df5fd-5165-4e6f-a2bd-aa9c875c3b42", - "metadata": {}, - "outputs": [], - "source": [ - "#TopoJSON\n", - "vector_layer = VectorTileLayer(\n", - " url='https://unpkg.com/world-atlas@1.1.4/world/50m.json',\n", - " source_format={\n", - " 'type': 'TopoJSON',\n", - " }\n", - ")\n", - "m.add_layer(vector_layer)" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "52a18ec7-981b-4182-846f-91c372aeac98", - "metadata": {}, - "outputs": [], - "source": [ - "m.remove_layer(vector_layer)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "2a617173-7a1e-4e9a-a9db-3b3d6085b5ea", - "metadata": {}, - "outputs": [], - "source": [ - "#MVT\n", - "layer = VectorTileLayer(\n", - " url='https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/tile/{z}/{y}/{x}.pbf',\n", - " source_format={\n", - " 'type': 'MVT',\n", - " }\n", - ")\n", - "# Configuration des autres propriétés du layer\n", - "layer.attribution = '© MapTiler ' + '© OpenStreetMap contributors'\n", - "layer.opacity = 0.8\n", - "layer.min_zoom = 1\n", - "layer.max_zoom = 20\n", - "m.add_layer(layer)" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "ba96582e-a837-49df-b98d-aa1f2fa9ada5", - "metadata": {}, - "outputs": [], - "source": [ - "style = {\n", - " 'strokeColor': '#1E90FF', # Dodger Blue for stroke\n", - " 'strokeWidth': 2, # Moderate width for visibility\n", - " 'pointRadius': 7, # Medium radius for points\n", - " 'fillColor': '#FFB6C1', # Light Pink for fill\n", - " 'pointFillColor': '#98FB98', # Pale Green for point fill\n", - " 'pointStrokeColor': '#8A2BE2', # Blue Violet for point stroke\n", - " 'pointStrokeWidth': 1.5 # Slightly increased width for point stroke\n", - "}" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "cc12097b-8d4c-4cc1-a43e-126137249db8", - "metadata": {}, - "outputs": [], - "source": [ - "layer.style=style" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "afc43b3c-805f-4144-97a1-43c9987e9558", - "metadata": {}, - "outputs": [], - "source": [ - "m.remove_layer(layer)" - ] - }, - { - "cell_type": "code", - "execution_count": 47, - "id": "5b8fe6af-f413-4244-b94d-88bcf114bb0d", - "metadata": {}, - "outputs": [], - "source": [ - "#GeoJSON\n", - "layer_Geo = VectorTileLayer(\n", - " url='https://openlayers.org/data/vector/ecoregions.json',\n", - " source_format={\n", - " 'type': 'GeoJSON',\n", - " #'geometry_name': '', \n", - " #'layer_name': '', \n", - " #'layers': ['', ''], \n", - " }\n", - ")\n", - "layer_Geo.attribution = \"© OpenStreetMap contributors\"\n", - "layer_Geo.opacity = 0.8\n", - "layer_Geo.min_zoom = 1\n", - "layer_Geo.max_zoom = 20\n", - "m.add_layer(layer_Geo)" - ] - }, - { - "cell_type": "code", - "execution_count": 34, - "id": "1bd06741-2430-42f6-a97a-ce73d73eb9e1", - "metadata": {}, - "outputs": [], - "source": [ - "m.remove_layer(layer_Geo)" - ] - }, - { - "cell_type": "code", - "execution_count": 35, - "id": "b6538136-72ca-4bf7-b534-43d99c1f06ba", - "metadata": {}, - "outputs": [], - "source": [ - "#MVT\n", - "layer_mvt = VectorTileLayer(\n", - " url='https://ahocevar.com/geoserver/gwc/service/tms/1.0.0/' +'ne:ne_10m_admin_0_countries@EPSG%3A900913@pbf/{z}/{x}/{-y}.pbf',\n", - " source_format={\n", - " 'type': 'MVT',\n", - " #'geometry_name': '', \n", - " #'layer_name': '', \n", - " #'layers': ['', ''],\n", - " }\n", - ")\n", - "layer_mvt.attribution = \"© OpenStreetMap contributors\"\n", - "layer_mvt.opacity = 0.8\n", - "layer_mvt.min_zoom = 1\n", - "layer_mvt.max_zoom = 20\n", - "m.add_layer(layer_mvt)" - ] - }, - { - "cell_type": "code", - "execution_count": 36, - "id": "b7b77d74-d657-4109-b892-5a0823faf59c", - "metadata": {}, - "outputs": [], - "source": [ - "style = {\n", - " 'strokeColor': '#FF4500', # Orange Red for stroke\n", - " 'strokeWidth': 2, # Moderate width for visibility\n", - " 'pointRadius': 8, # Medium radius for points\n", - " 'fillColor': '#2E8B57', # Sea Green for fill\n", - " 'pointFillColor': '#FFD700', # Gold for point fill\n", - " 'pointStrokeColor': '#4B0082', # Indigo for point stroke\n", - " 'pointStrokeWidth': 1.5 # Slightly increased width for point stroke\n", - "}" - ] - }, - { - "cell_type": "code", - "execution_count": 37, - "id": "476f7a69-2efa-4c78-9ea5-f4483a820cbb", - "metadata": {}, - "outputs": [], - "source": [ - "layer_mvt.style=style" - ] - }, - { - "cell_type": "code", - "execution_count": 38, - "id": "ad320792-4cbd-412d-927d-212c9129fbce", - "metadata": {}, - "outputs": [], - "source": [ - "layer_mvt.url='https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/tile/{z}/{y}/{x}.pbf'\n" - ] - }, - { - "cell_type": "code", - "execution_count": 39, - "id": "dc29f47d-6517-4ecf-97f6-3606f6c568bd", - "metadata": {}, - "outputs": [], - "source": [ - "m.remove_layer(layer_mvt)" - ] - }, - { - "cell_type": "code", - "execution_count": 40, - "id": "93efaf21-c8a0-43cb-9e6b-efe7851ef9b1", - "metadata": {}, - "outputs": [], - "source": [ - "layer_mvt.source_format={\n", - " 'type': 'GeoJSON'}" - ] - }, - { - "cell_type": "code", - "execution_count": 42, - "id": "84fcf518-e268-4836-a675-b628e731ba3b", - "metadata": {}, - "outputs": [], - "source": [ - "layer_mvt.url='https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson'\n", - "m.add_layer(layer_mvt)" - ] - }, - { - "cell_type": "code", - "execution_count": 44, - "id": "6bf30428-a7c8-4798-b4fc-1b9ebb50edcd", - "metadata": {}, - "outputs": [], - "source": [ - "layer_mvt.opacity = 0.1" - ] - }, - { - "cell_type": "code", - "execution_count": 45, - "id": "4a9f7252-456c-4d0e-ba73-1a1af144bab0", - "metadata": {}, - "outputs": [], - "source": [ - "m.remove_layer(layer_mvt)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0e330880-0e63-409f-8d96-1bd77d8d41b9", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.14" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/examples/FullScreenControl.ipynb b/ui-tests/tests/notebooks/FullScreenControl_update.ipynb similarity index 100% rename from examples/FullScreenControl.ipynb rename to ui-tests/tests/notebooks/FullScreenControl_update.ipynb diff --git a/examples/GeoTIFFTileLayer.ipynb b/ui-tests/tests/notebooks/GeoTIFFTileLayer_update.ipynb similarity index 76% rename from examples/GeoTIFFTileLayer.ipynb rename to ui-tests/tests/notebooks/GeoTIFFTileLayer_update.ipynb index bec70b6..a889b7e 100644 --- a/examples/GeoTIFFTileLayer.ipynb +++ b/ui-tests/tests/notebooks/GeoTIFFTileLayer_update.ipynb @@ -15,7 +15,9 @@ "metadata": {}, "outputs": [], "source": [ - "from ipyopenlayers import Map,GeoTIFFTileLayer,ZoomSlider" + "from ipyopenlayers import Map,GeoTIFFTileLayer,\n", + "m = Map(center=[5.314329221346643, 16.3625002926901], zoom=9)\n", + "m" ] }, { @@ -40,33 +42,10 @@ "output_type": "execute_result" } ], - "source": [ - "m = Map(center=[5.314329221346643, 16.3625002926901], zoom=9)\n", - "zoom=ZoomSlider()\n", - "m.add_control(zoom)\n", - "m" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "47078b2b-d1f5-4c50-9ec2-c8a7c49cf5bd", - "metadata": {}, - "outputs": [], "source": [ "geo_tiff_layer = GeoTIFFTileLayer(url='https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/36/Q/WD/2020/7/S2A_36QWD_20200701_0_L2A/TCI.tif')\n", "m.add_layer(geo_tiff_layer)" ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "afae85da-2dd0-4a48-b5c5-a24f7ee6119a", - "metadata": {}, - "outputs": [], - "source": [ - "m.remove_layer(geo_tiff_layer)" - ] } ], "metadata": { diff --git a/ui-tests/tests/notebooks/GeojsonLayer_update.ipynb b/ui-tests/tests/notebooks/GeojsonLayer_update.ipynb new file mode 100644 index 0000000..d1a887b --- /dev/null +++ b/ui-tests/tests/notebooks/GeojsonLayer_update.ipynb @@ -0,0 +1,175 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "07567690-279d-4a51-a3b8-3e78966e5a3a", + "metadata": {}, + "source": [ + "# GeoJson Layer" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "9c7bb99b-68dc-404f-aced-81ad043c2df2", + "metadata": {}, + "outputs": [], + "source": [ + "from ipyopenlayers import Map, GeoJSON\n", + "\n", + "# Create a map centered at the specified coordinates with a zoom level of 4\n", + "m = Map(center=[-75.05936205186516, 41.214094701931344], zoom=4)\n", + "\n", + "# Define GeoJSON data and style\n", + "geojson_data = {\n", + " 'type': 'FeatureCollection',\n", + " 'features': [\n", + " # Point feature\n", + " {\n", + " 'type': 'Feature',\n", + " 'geometry': {\n", + " 'type': 'Point',\n", + " 'coordinates': [-74.006, 40.7128], # Longitude, Latitude for New York City\n", + " },\n", + " 'properties': {\n", + " 'name': 'New York City',\n", + " 'population': 8419000,\n", + " 'description': 'The largest city in the United States by population.',\n", + " },\n", + " },\n", + " # LineString feature\n", + " {\n", + " 'type': 'Feature',\n", + " 'geometry': {\n", + " 'type': 'LineString',\n", + " 'coordinates': [\n", + " [-74.006, 40.7128], # Start point (New York City)\n", + " [-118.2437, 34.0522] # End point (Los Angeles)\n", + " ],\n", + " },\n", + " 'properties': {\n", + " 'name': 'Route from NYC to LA',\n", + " 'distance_km': 3940,\n", + " },\n", + " },\n", + " # Polygon feature\n", + " {\n", + " 'type': 'Feature',\n", + " 'geometry': {\n", + " 'type': 'Polygon',\n", + " 'coordinates': [\n", + " [\n", + " [-73.935242, 40.730610], # Point A\n", + " [-73.935242, 40.800610], # Point B\n", + " [-73.865242, 40.800610], # Point C\n", + " [-73.865242, 40.730610], # Point D\n", + " [-73.935242, 40.730610], # Point A (closed loop)\n", + " ]\n", + " ],\n", + " },\n", + " 'properties': {\n", + " 'name': 'Sample Polygon Area',\n", + " 'type': 'Park',\n", + " 'description': 'A polygon representing a park area.',\n", + " },\n", + " },\n", + " # MultiPolygon feature\n", + " {\n", + " 'type': 'Feature',\n", + " 'geometry': {\n", + " 'type': 'MultiPolygon',\n", + " 'coordinates': [\n", + " [\n", + " [\n", + " [-73.945242, 40.710610], # Polygon 1\n", + " [-73.945242, 40.780610],\n", + " [-73.875242, 40.780610],\n", + " [-73.875242, 40.710610],\n", + " [-73.945242, 40.710610],\n", + " ]\n", + " ],\n", + " [\n", + " [\n", + " [-74.015242, 40.710610], # Polygon 2\n", + " [-74.015242, 40.780610],\n", + " [-73.945242, 40.780610],\n", + " [-73.945242, 40.710610],\n", + " [-74.015242, 40.710610],\n", + " ]\n", + " ],\n", + " ],\n", + " },\n", + " 'properties': {\n", + " 'name': 'MultiPolygon Example',\n", + " 'description': 'An example of a MultiPolygon feature.',\n", + " },\n", + " },\n", + " ],\n", + "}\n", + "\n", + "\n", + "geojson_style = {\n", + " 'Point': {\n", + " 'radius': 8,\n", + " 'fillColor': '#ff7800',\n", + " 'color': '#000',\n", + " 'weight': 2,\n", + " 'opacity': 1,\n", + " 'fillOpacity': 0.8,\n", + " },\n", + " 'LineString': {\n", + " 'color': '#00f',\n", + " 'weight': 3,\n", + " 'opacity': 0.8,\n", + " },\n", + " 'Polygon': {\n", + " 'strokeColor': '#00f',\n", + " 'strokeWidth': 2,\n", + " 'strokeOpacity': 0.8,\n", + " 'fillColor': '#ff7800',\n", + " 'fillOpacity': 0.5,\n", + " },\n", + " 'MultiPolygon': {\n", + " 'strokeColor': '#f00',\n", + " 'strokeWidth': 2,\n", + " 'strokeOpacity': 0.8,\n", + " 'fillColor': '#0f0',\n", + " 'fillOpacity': 0.4,\n", + " },\n", + "}\n", + "\n", + "# Create and add a GeoJSON layer to the map\n", + "widget = GeoJSON(\n", + " data=geojson_data,\n", + " style=geojson_style,\n", + " visible=True\n", + ")\n", + "m.add_layer(widget)\n", + "\n", + "# Display the map\n", + "m" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.14" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/examples/HeatmapLayer.ipynb b/ui-tests/tests/notebooks/HeatmapLayer_update.ipynb similarity index 76% rename from examples/HeatmapLayer.ipynb rename to ui-tests/tests/notebooks/HeatmapLayer_update.ipynb index 6b0f97d..bd3b8de 100644 --- a/examples/HeatmapLayer.ipynb +++ b/ui-tests/tests/notebooks/HeatmapLayer_update.ipynb @@ -15,32 +15,7 @@ "metadata": {}, "outputs": [], "source": [ - "from ipyopenlayers import Map,HeatmapLayer,ZoomSlider" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "c4d1fa6b-ea9f-4d3b-9f50-54f977895423", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "996dab9f9de5482d9482a6813ebca7d6", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Map(center=[9.993566065893873, 47.226106632719905], zoom=5.0)" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ + "from ipyopenlayers import Map,HeatmapLayer,\n", "m = Map(center=[9.993566065893873, 47.226106632719905], zoom=5)\n", "m" ] @@ -83,18 +58,9 @@ " [43.6109, 3.8772, 12.35], # Hérault \n", " [50.6292, 3.0573, 12.30], # Nord \n", " [48.8534, 2.3488, 12.25], # Paris \n", - "]\n" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "6d462300-edf2-4fe1-a8ff-4b934f707a41", - "metadata": {}, - "outputs": [], - "source": [ + "]\n", "heatmap_layer = HeatmapLayer(blur=20, radius=15, points=points_data_france)\n", - "m.add_layer(heatmap_layer)\n" + "m.add_layer(heatmap_layer)" ] } ], diff --git a/examples/ImageOverlay.ipynb b/ui-tests/tests/notebooks/ImageOverlay_update.ipynb similarity index 70% rename from examples/ImageOverlay.ipynb rename to ui-tests/tests/notebooks/ImageOverlay_update.ipynb index 2edfba6..12fb1cd 100644 --- a/examples/ImageOverlay.ipynb +++ b/ui-tests/tests/notebooks/ImageOverlay_update.ipynb @@ -15,7 +15,9 @@ "metadata": {}, "outputs": [], "source": [ - "from ipyopenlayers import Map, ImageOverlay\n" + "from ipyopenlayers import Map, ImageOverlay\n", + "m = Map(center=[8.988, -0.686], zoom=3)\n", + "m\n" ] }, { @@ -40,41 +42,10 @@ "output_type": "execute_result" } ], - "source": [ - "m = Map(center=[8.988, -0.686], zoom=3)\n", - "m" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "id": "eaebfb8e-587a-4edd-953a-ca81366cdaef", - "metadata": {}, - "outputs": [], "source": [ "image=ImageOverlay(image_url=\"https://i.imgur.com/06Q1fSz.png\")\n", "m.add_overlay(image)" ] - }, - { - "cell_type": "code", - "execution_count": 24, - "id": "a31f5fce-39c1-4b21-8652-1f66fc444ad9", - "metadata": {}, - "outputs": [], - "source": [ - "image.position=[-40,60]" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "id": "a42116dc-a283-477e-ba9a-c9a985972e17", - "metadata": {}, - "outputs": [], - "source": [ - "m.remove_overlay(image)" - ] } ], "metadata": { diff --git a/examples/MousePositionControl.ipynb b/ui-tests/tests/notebooks/MousePositionControl_update.ipynb similarity index 100% rename from examples/MousePositionControl.ipynb rename to ui-tests/tests/notebooks/MousePositionControl_update.ipynb diff --git a/examples/PopupOverlay.ipynb b/ui-tests/tests/notebooks/PopupOverlay_update.ipynb similarity index 67% rename from examples/PopupOverlay.ipynb rename to ui-tests/tests/notebooks/PopupOverlay_update.ipynb index 1aad95b..fe1c04b 100644 --- a/examples/PopupOverlay.ipynb +++ b/ui-tests/tests/notebooks/PopupOverlay_update.ipynb @@ -15,32 +15,7 @@ "metadata": {}, "outputs": [], "source": [ - "from ipyopenlayers import Map, TileLayer, PopupOverlay\n" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "896e4087-820d-4e7b-88cf-9c19938a8476", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "8142e9c773f446209ee9ff0afd5a458d", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Map(center=[-11.844178003179724, 37.31477334221525], zoom=0.0)" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ + "from ipyopenlayers import Map, TileLayer, PopupOverlay\n", "m = Map(center=[-11.844178003179724, 37.31477334221525], zoom=0)\n", "m\n" ] diff --git a/ui-tests/tests/notebooks/RasterLayer_update.ipynb b/ui-tests/tests/notebooks/RasterLayer_update.ipynb new file mode 100644 index 0000000..dea9cb5 --- /dev/null +++ b/ui-tests/tests/notebooks/RasterLayer_update.ipynb @@ -0,0 +1,53 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Introduction" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [], + "source": [ + "from ipyopenlayers import Map, RasterTileLayer\n", + "m=Map()\n", + "m" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "layere=RasterTileLayer(url=\"https://{a-c}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png\")\n", + "m.add_layer(layere) " + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.14" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/examples/ScaleLineControl.ipynb b/ui-tests/tests/notebooks/ScaleLineControl_update.ipynb similarity index 100% rename from examples/ScaleLineControl.ipynb rename to ui-tests/tests/notebooks/ScaleLineControl_update.ipynb diff --git a/examples/VideoOverlay.ipynb b/ui-tests/tests/notebooks/VideoOverlay_update.ipynb similarity index 52% rename from examples/VideoOverlay.ipynb rename to ui-tests/tests/notebooks/VideoOverlay_update.ipynb index c1b7934..c79e91f 100644 --- a/examples/VideoOverlay.ipynb +++ b/ui-tests/tests/notebooks/VideoOverlay_update.ipynb @@ -15,32 +15,7 @@ "metadata": {}, "outputs": [], "source": [ - "from ipyopenlayers import Map, ImageOverlay, VideoOverlay,PopupOverlay\n" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "f6be2475-b1a0-47f9-b3d5-0ee70f4acd8b", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "a2c30ae7d5e44e33932854739232dccb", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Map(center=[0.0, 0.0], zoom=2.0)" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ + "from ipyopenlayers import Map, VideoOverlay\n", "m = Map(center=[0.0, 0.0], zoom=2)\n", "m" ] @@ -55,26 +30,6 @@ "video=VideoOverlay(video_url=\"https://www.mapbox.com/bites/00188/patricia_nasa.webm\")\n", "m.add_overlay(video)\n" ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "cb100484-37c4-46c1-a891-07dcc6c3cd29", - "metadata": {}, - "outputs": [], - "source": [ - "video.position=[-70,70]\n" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "9395a2af-f495-444f-9121-8879bd75b2e3", - "metadata": {}, - "outputs": [], - "source": [ - "m.remove_overlay(video)\n" - ] } ], "metadata": { diff --git a/examples/ZoomSliderControl.ipynb b/ui-tests/tests/notebooks/ZoomSliderControl_update.ipynb similarity index 100% rename from examples/ZoomSliderControl.ipynb rename to ui-tests/tests/notebooks/ZoomSliderControl_update.ipynb