-
Notifications
You must be signed in to change notification settings - Fork 360
Integrate geoportal extensions leaflet #1042
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
Open
HaudinFlorence
wants to merge
31
commits into
jupyter-widgets:master
Choose a base branch
from
HaudinFlorence:integrate_geoportal_extensions_leaflet
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 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 73b052a
Simplify Geoportal.js.
HaudinFlorence 01de98b
Fix flake8 formatting issue.
HaudinFlorence 784d987
Add an example in Geoportal notebook.
HaudinFlorence ecbd305
Remove WMS related classes in geoportal.py and Geoportal.js.
HaudinFlorence 7b899f0
Change apiKey to api_key for the Python side, change layer_name to la…
HaudinFlorence c70fb9d
Add the attribute format to enable to set the format of the image of …
HaudinFlorence 1ef06d9
Add the LayerSwitcher control.
HaudinFlorence 6395e6f
Add SearchEngine control.
HaudinFlorence 72b7067
Fix flake8 linting issue.
HaudinFlorence 79b7fde
Add Route control.
HaudinFlorence 6993f0d
Add MousePosition control.
HaudinFlorence f77f1fe
Add ElevationPath control.
HaudinFlorence db52eb3
Add Isocurve control.
HaudinFlorence 9a580e8
Separate Geoportal.js between 2 separate files for layers and control…
HaudinFlorence 1c07d05
Update ipyleaflet/geoportal.py
HaudinFlorence 6fe69e9
Update ipyleaflet/geoportal.py
HaudinFlorence 7d4ef08
Update ipyleaflet/geoportal.py
HaudinFlorence b5d9da4
Update ipyleaflet/geoportal.py
HaudinFlorence 50b00f3
Update ipyleaflet/geoportal.py
HaudinFlorence 74ce5f6
Update ipyleaflet/geoportal.py
HaudinFlorence c6f76de
Update ipyleaflet/geoportal.py
HaudinFlorence 172d88c
Update ipyleaflet/geoportal.py
HaudinFlorence 3c05e88
Update js/src/controls/GeoportalControls.js
HaudinFlorence 39dafb8
Update or add options of the various controls.
HaudinFlorence 231dacc
Revert "Update or add options of the various controls."
HaudinFlorence 70fe8d6
Update the options of the controls.
HaudinFlorence 3791744
Update options of various controls.
HaudinFlorence 793b1cf
Add ReverseGeoCode control.
HaudinFlorence 6d756c4
Re try CI test
HaudinFlorence a1585e4
Fix flake8 failingtest.
HaudinFlorence File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"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": null, | ||
"id": "119aacd7-fb6b-4bf5-9a97-ac8301eabfed", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from ipyleaflet import *\n", | ||
"from ipyleaflet.geoportal import GeoportalWMTS\n", | ||
"m1 = Map(center=(48.799999, 2.26667), zoom=10, zoom_control=True)\n", | ||
"layer1 = GeoportalWMTS() #default\n", | ||
"m1.add(layer1)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "2936c8dc-1546-4f13-8c18-6984aaf1c0e3", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"m2 = Map(center=(44.400002, 3.36667), zoom=8, zoom_control=True)\n", | ||
"layer2 = GeoportalWMTS(layer_name = 'ELEVATION.SLOPES', apiKey = 'altimetrie')\n", | ||
"m2.add(layer2)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "cfeff952-288f-4e56-9dd7-4b7e160e6305", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"m3 = Map(center=(48.799999, 2.26667), zoom=10, zoom_control=True)\n", | ||
"layer3 = GeoportalWMTS(layer_name = 'GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2', apiKey = 'cartes')\n", | ||
HaudinFlorence marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"m3.add(layer3)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "24a0dda1-4d07-437e-9c39-396176d5fa53", | ||
"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 | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
# | ||
HaudinFlorence marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
from traitlets import Unicode | ||
from .leaflet import TileLayer | ||
|
||
|
||
class GeoportalWMTS(TileLayer): | ||
"""GeoportalWMTS class, with TileLayer as parent class | ||
|
||
|
||
Attributes | ||
---------- | ||
layer_name: string, default "ORTHOIMAGERY.ORTHOPHOTOS" | ||
name of the layer to show. | ||
apiKey: string, default "essentiels" | ||
key to access a given ressource, detailed correspondances are given here : https://geoservices.ign.fr/documentation/services/tableau_ressources | ||
""" | ||
|
||
_view_name = Unicode('LeafletGeoportalWMTSView').tag(sync=True) | ||
_model_name = Unicode('LeafletGeoportalWMTSModel').tag(sync=True) | ||
layer_name = Unicode("ORTHOIMAGERY.ORTHOPHOTOS").tag(sync=True, o=True) | ||
apiKey = Unicode("essentiels").tag(sync=True, o=True) | ||
HaudinFlorence marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
|
||
const L = require('../leaflet.js'); | ||
const layer = require('./TileLayer.js'); | ||
const utils = require('../utils'); | ||
|
||
export class LeafletGeoportalWMTSModel extends layer.LeafletTileLayerModel { | ||
defaults() { | ||
return { | ||
...super.defaults(), | ||
_view_name: 'LeafletGeoportalWMTSView', | ||
_model_name: 'LeafletGeoportalWMTSModel', | ||
layer_name : "ORTHOIMAGERY.ORTHOPHOTOS", | ||
HaudinFlorence marked this conversation as resolved.
Show resolved
Hide resolved
|
||
apiKey : "essentiels" | ||
}; | ||
} | ||
} | ||
|
||
export class LeafletGeoportalWMTSView extends layer.LeafletTileLayerView { | ||
create_obj() { | ||
this.obj = L.geoportalLayer.WMTS({layer : this.model.get('layer_name'), apiKey : this.model.get('apiKey')}) | ||
HaudinFlorence marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.