diff --git a/examples/GeoportalControls.ipynb b/examples/GeoportalControls.ipynb new file mode 100644 index 000000000..4e90cb3f2 --- /dev/null +++ b/examples/GeoportalControls.ipynb @@ -0,0 +1,134 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "6bb0dd68-f96d-45c5-b3de-48c2092f2690", + "metadata": {}, + "outputs": [], + "source": [ + "from ipyleaflet import *\n", + "from ipyleaflet.geoportal import GeoportalLayerSwitcher, GeoportalSearchEngine, GeoportalRoute, GeoportalMousePosition, GeoportalElevationPath, GeoportalIsocurve, GeoportalReverseGeocode" + ] + }, + { + "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": null, + "id": "3a686d99-c3ca-4596-81aa-24442564bea2", + "metadata": {}, + "outputs": [], + "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": "2df03824-68cf-47a0-bd54-57d409d0cd75", + "metadata": {}, + "outputs": [], + "source": [ + "#ReverseGeocode control\n", + "m6 = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n", + "reverse_geocode_control = GeoportalReverseGeocode()\n", + "m6.add(reverse_geocode_control)" + ] + } + ], + "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 +} diff --git a/examples/GeoportalLayers.ipynb b/examples/GeoportalLayers.ipynb new file mode 100644 index 000000000..20d39fd53 --- /dev/null +++ b/examples/GeoportalLayers.ipynb @@ -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 +} diff --git a/ipyleaflet/geoportal.py b/ipyleaflet/geoportal.py new file mode 100644 index 000000000..f16ad12e0 --- /dev/null +++ b/ipyleaflet/geoportal.py @@ -0,0 +1,160 @@ +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. + + +from traitlets import Unicode, Bool, List, Dict, Any +from .leaflet import TileLayer, Control + + +class GeoportalWMTS(TileLayer): + """GeoportalWMTS class, with TileLayer as parent class + + + Attributes + ---------- + layer_name: string, default "ORTHOIMAGERY.ORTHOPHOTOS" + name of the layer to show. + api_key: string, default "essentiels" + key to access a given ressource, detailed correspondances are given here : https://geoservices.ign.fr/documentation/services/tableau_ressources + format: string, default "image/png" + format of the image + """ + + _view_name = Unicode("LeafletGeoportalWMTSView").tag(sync=True) + _model_name = Unicode("LeafletGeoportalWMTSModel").tag(sync=True) + layer = Unicode("ORTHOIMAGERY.ORTHOPHOTOS").tag(sync=True, o=True) + api_key = Unicode("essentiels").tag(sync=True, o=True) + format = Unicode("image/jpeg").tag(sync=True, o=True) + + +class GeoportalLayerSwitcher(Control): + """GeoportalLayerSwitcher class, with Control as parent class + + Attributes + ---------- + """ + + _view_name = Unicode("LeafletGeoportalLayerSwitcherView").tag(sync=True) + _model_name = Unicode("LeafletGeoportalLayerSwitcherModel").tag(sync=True) + position = Unicode("topright").tag(sync=True, o=True) + collapsed = Bool(False).tag(sync=True, o=True) + layers = List([]).tag(sync=True, o=True) + + +class GeoportalSearchEngine(Control): + """GeoportalSearchEngine class, with Control as parent class + + Attributes + ---------- + """ + + _view_name = Unicode("LeafletGeoportalSearchEngineView").tag(sync=True) + _model_name = Unicode("LeafletGeoportalSearchEngineModel").tag(sync=True) + layer = Unicode("ORTHOIMAGERY.ORTHOPHOTOS").tag(sync=True, o=True) + api_key = Unicode("essentiels").tag(sync=True, o=True) + format = Unicode("image/jpeg").tag(sync=True, o=True) + position = Unicode("topleft").tag(sync=True, o=True) + collapsed = Bool(True).tag(sync=True, o=True) + zoomTo = Unicode("auto").tag(sync=True, o=True) + displayInfo = Bool(True).tag(sync=True, o=True) + displayAdvancedSearch = Bool(True).tag(sync=True, o=True) + resources = List(["PositionOfInterest", "StreetAddress"]).tag(sync=True, o=True) + advancedSearch = Dict({}).tag(sync=True, o=True) + geocodeOptions = Dict({}).tag(sync=True, o=True) + autocompleteOptions = Dict({}).tag(sync=True, o=True) + + +class GeoportalRoute(Control): + """GeoportalRoute class, with Control as parent class + + Attributes + ---------- + """ + + _view_name = Unicode("LeafletGeoportalRouteView").tag(sync=True, o=True) + _model_name = Unicode("LeafletGeoportalRouteModel").tag(sync=True, o=True) + api_key = Unicode("essentiels").tag(sync=True, o=True) + position = Unicode("bottomleft").tag(sync=True, o=True) + collapsed = Bool(True).tag(sync=True, o=True) + ssl = Bool(True).tag(sync=True, o=True) + disableReverse = Bool(False).tag(sync=True, o=True) + exclusions = Dict({"toll": True, "bridge": False, "tunnel": True}).tag( + sync=True, o=True + ) + graphs = List(["Pieton", "Voiture"]).tag(sync=True, o=True) + autocompleteOptions = Dict({}).tag(sync=True, o=True) + routeOptions = Dict({}).tag(sync=True, o=True) + + +class GeoportalMousePosition(Control): + """GeoportalMousePosition class, with Control as parent class + + Attributes + ---------- + """ + + _view_name = Unicode("LeafletGeoportalMousePositionView").tag(sync=True, o=True) + _model_name = Unicode("LeafletGeoportalMousePositionModel").tag(sync=True, o=True) + api_key = Unicode("essentiels").tag(sync=True, o=True) + position = Unicode("bottomleft").tag(sync=True, o=True) + collapsed = Bool(False).tag(sync=True, o=True) + display_altitude = Bool(False).tag(sync=True, o=True) + display_coordinates = Bool(True).tag(sync=True, o=True) + edit_coordinates = Bool(True).tag(sync=True, o=True) + systems = List([]).tag(sync=True, o=True) + altitude = Any([]).tag(sync=True, o=True) + units = List([]).tag(sync=True, o=True) + + +class GeoportalElevationPath(Control): + """GeoportalElevationPath class, with Control as parent class + + Attributes + ---------- + """ + + _view_name = Unicode("LeafletGeoportalElevationPathView").tag(sync=True) + _model_name = Unicode("LeafletGeoportalElevationPathModel").tag(sync=True) + api_key = Unicode("essentiels").tag(sync=True, o=True) + position = Unicode("bottomleft").tag(sync=True, o=True) + openssl = Bool(True).tag(sync=True, o=True) + active = Bool(False).tag(sync=True, o=True) + stylesOptions = Unicode("DEFAULT_STYLES").tag(sync=True, o=True) + elevationPathOptions = Dict({}).tag(sync=True, o=True) + displayProfileOptions = Dict({}).tag(sync=True, o=True) + + +class GeoportalIsocurve(Control): + """GeoportalIsocurve class, with Control as parent class + + Attributes + ---------- + """ + + _view_name = Unicode("LeafletGeoportalIsocurveView").tag(sync=True, o=True) + _model_name = Unicode("LeafletGeoportalIsocurveModel").tag(sync=True, o=True) + api_key = Unicode("essentiels").tag(sync=True, o=True) + collapsed = Bool(False).tag(sync=True, o=True) + methods = List(["time", "distance"]).tag(sync=True, o=True) + exclusions = Dict({}).tag(sync=True).tag(sync=True, o=True) + graphs = List(["Pieton", "Voiture"]).tag(sync=True, o=True) + isocurveOptions = Dict({}).tag(sync=True, o=True) + autocompleteOptions = Dict({}).tag(sync=True).tag(sync=True, o=True) + + +class GeoportalReverseGeocode(Control): + """GeoportalReverseGeocode class, with Control as parent class + + Attributes + ---------- + """ + + _view_name = Unicode("LeafletGeoportalReverseGeocodeView").tag(sync=True, o=True) + _model_name = Unicode("LeafletGeoportalReverseGeocodeModel").tag(sync=True, o=True) + api_key = Unicode("essentiels").tag(sync=True, o=True) + position = Unicode("bottomleft").tag(sync=True, o=True) + collapsed = Bool(False).tag(sync=True, o=True) + ssl = Bool(True).tag(sync=True, o=True) + resources = List([]).tag(sync=True, o=True) + delimitations = List([]).tag(sync=True, o=True) + ReverseGeocodeOptions = Dict({}).tag(sync=True).tag(sync=True, o=True) diff --git a/js/package.json b/js/package.json index 948004151..f14d62d72 100644 --- a/js/package.json +++ b/js/package.json @@ -28,6 +28,7 @@ "@jupyter-widgets/base": "^2 || ^3 || ^4.0.0", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0", + "geoportal-extensions-leaflet": "^2.2.4", "leaflet": "^1.7.1", "leaflet-ant-path": "^1.3.0", "leaflet-defaulticon-compatibility": "^0.1.1", diff --git a/js/src/controls/GeoportalControls.js b/js/src/controls/GeoportalControls.js new file mode 100644 index 000000000..1fdd21d94 --- /dev/null +++ b/js/src/controls/GeoportalControls.js @@ -0,0 +1,207 @@ +// Copyright (c) Jupyter Development Team. +// Distributed under the terms of the Modified BSD License. + +const L = require('../leaflet.js'); +const control = require('../controls/Control.js'); + + +export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlModel { + defaults() { + return { + ...super.defaults(), + _view_name: 'LeafletGeoportalLayerSwitcherView', + _model_name: 'LeafletGeoportalLayerSwitcherModel', + position : "topright", + collapsed : false, + layers : [] + }; + } + } + + export class LeafletGeoportalLayerSwitcherView extends control.LeafletControlView { + initialize(parameters) { + super.initialize(parameters); + this.map_view = this.options.map_view; + } + create_obj() { + this.obj = L.geoportalControl.LayerSwitcher(this.get_options()) + } + } + + export class LeafletGeoportalSearchEngineModel extends control.LeafletControlModel { + defaults() { + return { + ...super.defaults(), + _view_name: 'LeafletGeoportalSearchEngineView', + _model_name: 'LeafletGeoportalSearchEngineModel', + apiKey : 'essentiels', + position : 'topleft', + collapsed : true, + zoomTo : 'auto', + displayInfo : true, + displayAdvancedSearch : true, + resources : ["PositionOfInterest", "StreetAddress"], + advancedSearch : {}, + geocodeOptions : {}, + autocompleteOptions : {} + }; + } + } + + export class LeafletGeoportalSearchEngineView extends control.LeafletControlView { + initialize(parameters) { + super.initialize(parameters); + this.map_view = this.options.map_view; + } + create_obj() { + this.obj = L.geoportalControl.SearchEngine(this.get_options()) + } + } + + export class LeafletGeoportalRouteModel extends control.LeafletControlModel { + defaults() { + return { + ...super.defaults(), + _view_name: 'LeafletGeoportalRouteView', + _model_name: 'LeafletGeoportalRouteModel', + apiKey : 'essentiels', + position : "bottomleft", + collapsed : true, + ssl : true, + disableReverse : false, + exclusions : {"toll" : true, + "bridge" : false, + "tunnel" : true + }, + graphs : ['Pieton', 'Voiture'], + autocompleteOptions : {}, + routeOptions : {} + }; + } + } + + export class LeafletGeoportalRouteView extends control.LeafletControlView { + initialize(parameters) { + super.initialize(parameters); + this.map_view = this.options.map_view; + } + create_obj() { + this.obj = L.geoportalControl.Route(this.get_options()) + } + } + + export class LeafletGeoportalMousePositionModel extends control.LeafletControlModel { + defaults() { + return { + ...super.defaults(), + _view_name: 'LeafletGeoportalMousePositionView', + _model_name: 'LeafletGeoportalMousePositionModel', + apiKey : 'essentiels', + position : 'bottomleft', + collapsed : false, + displayAltitude : false, + displayCoordinates : true, + editCoordinates : true, + altitude : {}, + systems : [], + units : [] + }; + } + } + + export class LeafletGeoportalMousePositionView extends control.LeafletControlView { + initialize(parameters) { + super.initialize(parameters); + this.map_view = this.options.map_view; + } + create_obj() { + this.obj = L.geoportalControl.MousePosition(this.get_options()) + } + } + + export class LeafletGeoportalElevationPathModel extends control.LeafletControlModel { + defaults() { + return { + ...super.defaults(), + _view_name: 'LeafletGeoportalElevationPathView', + _model_name: 'LeafletGeoportalElevationPathModel', + apiKey : 'essentiels', + position : 'bottomleft', + openssl : true, + active : false, + stylesOptions : 'DEFAULT_STYLES', + elevationPathOptions: {}, + displayProfileOptions : {}, + }; + } + } + + export class LeafletGeoportalElevationPathView extends control.LeafletControlView { + initialize(parameters) { + super.initialize(parameters); + this.map_view = this.options.map_view; + } + create_obj() { + this.obj = L.geoportalControl.ElevationPath(this.get_options()) + } + } + + export class LeafletGeoportalIsocurveModel extends control.LeafletControlModel { + defaults() { + return { + ...super.defaults(), + _view_name: 'LeafletGeoportalIsocurve', + _model_name: 'LeafletGeoportalIsocurveModel', + apiKey : 'essentiels', + collapsed : false, + methods : ["time", "distance"], + exclusions : { + toll : true, + bridge : false, + tunnel : true + }, + graphs : ["Pieton", "Voiture"], + isocurveOptions : {}, + autocompleteOptions : {} + + } + } + } + + export class LeafletGeoportalIsocurveView extends control.LeafletControlView { + initialize(parameters) { + super.initialize(parameters); + this.map_view = this.options.map_view; + } + create_obj() { + this.obj = L.geoportalControl.Isocurve(this.get_options()) + } + } + + + export class LeafletGeoportalReverseGeocodeModel extends control.LeafletControlModel { + defaults() { + return { + ...super.defaults(), + _view_name: 'LeafletGeoportalReverseGeocodeView', + _model_name: 'LeafletGeoportalReverseGeocodeModel', + apiKey : 'essentiels', + position : 'bottomleft', + collapsed : false, + ssl : true, + resources : [], + delimitations : [], + ReverseGeocodeOptions : {} + } + } + } + + export class LeafletGeoportalReverseGeocodeView extends control.LeafletControlView { + initialize(parameters) { + super.initialize(parameters); + this.map_view = this.options.map_view; + } + create_obj() { + this.obj = L.geoportalControl.ReverseGeocode(this.get_options()) + } + } diff --git a/js/src/jupyter-leaflet.js b/js/src/jupyter-leaflet.js index badc6b042..3d7b08073 100644 --- a/js/src/jupyter-leaflet.js +++ b/js/src/jupyter-leaflet.js @@ -30,6 +30,7 @@ export * from './layers/LayerGroup.js'; export * from './layers/FeatureGroup.js'; export * from './layers/GeoJSON.js'; export * from './layers/DivIcon.js'; +export * from './layers/GeoportalLayers.js'; //Controls export * from './controls/AttributionControl.js'; @@ -44,6 +45,7 @@ export * from './controls/ZoomControl.js'; export * from './controls/ScaleControl.js'; export * from './controls/LegendControl.js'; export * from './controls/SearchControl.js'; +export * from './controls/GeoportalControls.js'; //Map export * from './Map.js'; @@ -60,3 +62,6 @@ require('leaflet.awesome-markers/dist/leaflet.awesome-markers.css'); require('spin.js/spin.css'); require('./jupyter-leaflet.css'); require('leaflet-search/dist/leaflet-search.src.css'); +require('geoportal-extensions-leaflet/dist/GpPluginLeaflet-map.css'); +require('geoportal-extensions-leaflet/dist/GpPluginLeaflet-src.css'); +require('geoportal-extensions-leaflet/dist/GpPluginLeaflet.css'); diff --git a/js/src/layers/GeoportalLayers.js b/js/src/layers/GeoportalLayers.js new file mode 100644 index 000000000..cd2a91db5 --- /dev/null +++ b/js/src/layers/GeoportalLayers.js @@ -0,0 +1,26 @@ +// 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 : 'ORTHOIMAGERY.ORTHOPHOTOS', + apiKey : 'essentiels', + format : 'image/jpeg' + }; + } +} + +export class LeafletGeoportalWMTSView extends layer.LeafletTileLayerView { + create_obj() { + this.obj = L.geoportalLayer.WMTS({layer : this.model.get('layer'), apiKey : this.model.get('api_key')}, {format : this.model.get('format')}) + } +} + diff --git a/js/src/leaflet.js b/js/src/leaflet.js index 65b0027d9..6fbb75525 100644 --- a/js/src/leaflet.js +++ b/js/src/leaflet.js @@ -15,6 +15,7 @@ require('leaflet-fullscreen'); require('leaflet-transform'); require('leaflet.awesome-markers'); require('leaflet-search'); +require('geoportal-extensions-leaflet') // Monkey patch GridLayer for smoother URL updates L.patchGridLayer = function (layer) {