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

Integrate geoportal extensions leaflet #1042

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7f75233
Integrate geoportal-extensions-leaflet and start with adding a Geopor…
HaudinFlorence Aug 19, 2022
73b052a
Simplify Geoportal.js.
HaudinFlorence Aug 19, 2022
01de98b
Fix flake8 formatting issue.
HaudinFlorence Aug 22, 2022
784d987
Add an example in Geoportal notebook.
HaudinFlorence Aug 22, 2022
ecbd305
Remove WMS related classes in geoportal.py and Geoportal.js.
HaudinFlorence Aug 22, 2022
7b899f0
Change apiKey to api_key for the Python side, change layer_name to la…
HaudinFlorence Aug 23, 2022
c70fb9d
Add the attribute format to enable to set the format of the image of …
HaudinFlorence Aug 23, 2022
1ef06d9
Add the LayerSwitcher control.
HaudinFlorence Aug 23, 2022
6395e6f
Add SearchEngine control.
HaudinFlorence Aug 24, 2022
72b7067
Fix flake8 linting issue.
HaudinFlorence Sep 7, 2022
79b7fde
Add Route control.
HaudinFlorence Sep 7, 2022
6993f0d
Add MousePosition control.
HaudinFlorence Sep 7, 2022
f77f1fe
Add ElevationPath control.
HaudinFlorence Sep 8, 2022
db52eb3
Add Isocurve control.
HaudinFlorence Sep 9, 2022
9a580e8
Separate Geoportal.js between 2 separate files for layers and control…
HaudinFlorence Sep 12, 2022
1c07d05
Update ipyleaflet/geoportal.py
HaudinFlorence Sep 13, 2022
6fe69e9
Update ipyleaflet/geoportal.py
HaudinFlorence Sep 13, 2022
7d4ef08
Update ipyleaflet/geoportal.py
HaudinFlorence Sep 13, 2022
b5d9da4
Update ipyleaflet/geoportal.py
HaudinFlorence Sep 13, 2022
50b00f3
Update ipyleaflet/geoportal.py
HaudinFlorence Sep 13, 2022
74ce5f6
Update ipyleaflet/geoportal.py
HaudinFlorence Sep 13, 2022
c6f76de
Update ipyleaflet/geoportal.py
HaudinFlorence Sep 13, 2022
172d88c
Update ipyleaflet/geoportal.py
HaudinFlorence Sep 13, 2022
3c05e88
Update js/src/controls/GeoportalControls.js
HaudinFlorence Sep 13, 2022
39dafb8
Update or add options of the various controls.
HaudinFlorence Sep 13, 2022
231dacc
Revert "Update or add options of the various controls."
HaudinFlorence Sep 14, 2022
70fe8d6
Update the options of the controls.
HaudinFlorence Sep 14, 2022
3791744
Update options of various controls.
HaudinFlorence Sep 14, 2022
793b1cf
Add ReverseGeoCode control.
HaudinFlorence Sep 14, 2022
6d756c4
Re try CI test
HaudinFlorence Sep 15, 2022
a1585e4
Fix flake8 failingtest.
HaudinFlorence Sep 16, 2022
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
145 changes: 145 additions & 0 deletions examples/GeoportalControls.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "6bb0dd68-f96d-45c5-b3de-48c2092f2690",
"metadata": {},
"outputs": [],
"source": [
"from ipyleaflet import *\n",
"from ipyleaflet.geoportal import GeoportalLayerSwitcher, GeoportalSearchEngine, GeoportalRoute, GeoportalMousePosition, GeoportalElevationPath, GeoportalIsocurve"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fdeacb8e-3113-453d-ab63-a5ab639bf0c8",
"metadata": {},
"outputs": [],
"source": [
"#Route control for itinerary calculation\n",
"layer = basemap_to_tiles(basemaps.GeoportailFrance.plan)\n",
"m = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n",
"m.add(layer)\n",
"route_control = GeoportalRoute()\n",
"m.add(route_control)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "3a686d99-c3ca-4596-81aa-24442564bea2",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "47bf5fd8b8aa413fb0eacad5627beee6",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[44.799999, 2.26667], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', '…"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#LayerSwitcher control\n",
"m1 = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n",
"layer1 = basemap_to_tiles(basemaps.GeoportailFrance.plan)\n",
"layer2 = basemap_to_tiles(basemaps.GeoportailFrance.orthos)\n",
"m1.add(layer1)\n",
"m1.add(layer2)\n",
"layer_control = GeoportalLayerSwitcher()\n",
"m1.add(layer_control)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "57062455-fe86-4e3b-8eaf-94e996b44830",
"metadata": {},
"outputs": [],
"source": [
"#SearchEngine control\n",
"m2 = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n",
"#layer1 = GeoportalWMTS() #default\n",
"search_control = GeoportalSearchEngine()\n",
"m2.add(search_control)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0a7ca855-c96d-4864-9b9c-1873712033bb",
"metadata": {},
"outputs": [],
"source": [
"#MousePosition control\n",
"m3 = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n",
"mouse_position_control = GeoportalMousePosition()\n",
"m3.add(mouse_position_control)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "17a9e9bb-f3a5-40e5-90ea-8d57049cda5f",
"metadata": {},
"outputs": [],
"source": [
"#ElevationPath control\n",
"m4 = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n",
"elevation_path_control = GeoportalElevationPath()\n",
"m4.add(elevation_path_control)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "88acf040-74f1-419d-a3b8-766b9a538d43",
"metadata": {},
"outputs": [],
"source": [
"#Isocurve control\n",
"m5 = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n",
"isocurve_control = GeoportalIsocurve()\n",
"m5.add(isocurve_control)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b6ca529f-62dd-4464-ba19-e2f4b5b15df5",
"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.9.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
158 changes: 158 additions & 0 deletions examples/GeoportalLayers.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "121b2e3e-faa5-4f53-87c9-9a3112440e98",
"metadata": {},
"outputs": [],
"source": [
"# Set up for JupyterLite\n",
"try:\n",
" import piplite\n",
" await piplite.install('ipyleaflet')\n",
"except ImportError:\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "68a99b3b-58f1-4251-a724-f5135ac72be1",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "417572db6a764f559a34856fb1306fcc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[44.799999, 2.26667], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', '…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from ipyleaflet import *\n",
"from ipyleaflet.geoportal import GeoportalWMTS\n",
"m1 = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n",
"layer1 = GeoportalWMTS() #default\n",
"m1.add(layer1)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "9452eaf1-38ff-463f-b272-95baa8f840a5",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a0f3cb258b4a4769b7fb30cca72df05c",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[44.400002, 3.36667], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', '…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m2 = Map(center=(44.400002, 3.36667), zoom=10, zoom_control=True)\n",
"layer2 = GeoportalWMTS(layer = 'ELEVATION.SLOPES', api_key = 'altimetrie')\n",
"m2.add(layer2)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "69d5a707-f501-4d5c-a22e-3e59e2656aaf",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "bdc4d761ead245b3842ff2be4f5a600a",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[44.799999, 2.26667], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', '…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m3 = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n",
"layer3 = GeoportalWMTS(layer = 'GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2', api_key = 'cartes', format = 'image/png')\n",
"m3.add(layer3)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "2936c8dc-1546-4f13-8c18-6984aaf1c0e3",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "902bb6b777a14cae8d2e377e514ed5e8",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[44.400002, 3.36667], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', '…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m4 = Map(center=(44.400002, 3.36667), zoom=10, zoom_control=True)\n",
"layer4 = GeoportalWMTS(layer = 'HYDROGRAPHY.BCAE.LATEST', api_key = 'agriculture', format = 'image/png')\n",
"m4.add(layer4)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ee4e38eb-0ac7-47d4-bc7d-be74a7e761c7",
"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.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading