Skip to content

Commit

Permalink
Revert "Update or add options of the various controls."
Browse files Browse the repository at this point in the history
This reverts commit 39dafb8.
  • Loading branch information
HaudinFlorence authored and davidbrochart committed Sep 14, 2022
1 parent 6122381 commit bc31e3c
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 104 deletions.
42 changes: 21 additions & 21 deletions examples/GeoportalControls.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "3a686d99-c3ca-4596-81aa-24442564bea2",
"metadata": {},
"outputs": [],
"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",
Expand Down Expand Up @@ -59,30 +75,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "0a7ca855-c96d-4864-9b9c-1873712033bb",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "787604374bd34bbdba450d271c0f60bb",
"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"
}
],
"outputs": [],
"source": [
"#MousePosition control\n",
"m3 = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n",
"mouse_position_control = GeoportalMousePosition(display_altitude=True)\n",
"mouse_position_control = GeoportalMousePosition()\n",
"m3.add(mouse_position_control)"
]
},
Expand Down
91 changes: 39 additions & 52 deletions ipyleaflet/geoportal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Distributed under the terms of the Modified BSD License.


from traitlets import Unicode, Bool, List, Dict, Instance, Any
from traitlets import Unicode, Bool, List, Dict
from .leaflet import TileLayer, Control


Expand Down Expand Up @@ -36,17 +36,6 @@ class GeoportalLayerSwitcher(Control):

_view_name = Unicode("LeafletGeoportalLayerSwitcherView").tag(sync=True)
_model_name = Unicode("LeafletGeoportalLayerSwitcherModel").tag(sync=True)
position = Unicode("bottomleft").tag(sync=True, o=True)
collapsed = Bool(False).tag(sync=True, o=True)
layers = List([]).tag(sync=True, o=True)
layer = Instance(TileLayer).tag(sync=True, o=True)
display = Bool(True).tag(sync=True, o=True)
config = Any().tag(sync=True, o=True)
visibility = Unicode("").tag(sync=True, o=True)
title = Unicode("").tag(sync=True, o=True)
description = Unicode("").tag(sync=True, o=True)
quicklook_url = Unicode("").tag(sync=True, o=True)
legends = List([]).tag(sync=True, o=True)


class GeoportalSearchEngine(Control):
Expand All @@ -65,6 +54,7 @@ class GeoportalSearchEngine(Control):
collapsed = Bool(True).tag(sync=True, o=True)
zoomTo = Unicode("auto").tag(sync=True, o=True)
displayInfo = Bool(True).tag(sync=True, o=True)
apiKey = Unicode("cartes").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)
Expand All @@ -79,19 +69,14 @@ class GeoportalRoute(Control):
----------
"""

_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)
_view_name = Unicode("LeafletGeoportalRouteView").tag(sync=True)
_model_name = Unicode("LeafletGeoportalRouteModel").tag(sync=True)
position = Unicode("bottomleft").tag(sync=True)
collapsed = Bool(True).tag(sync=True)
exclusions = Dict({"toll": True, "bridge": False, "tunnel": True}).tag(sync=True)
graphs = List(["Pieton", "Voiture"]).tag(sync=True)
autocompleteOptions = Dict({}).tag(sync=True)
routeOptions = Dict({}).tag(sync=True)


class GeoportalMousePosition(Control):
Expand All @@ -101,17 +86,27 @@ class GeoportalMousePosition(Control):
----------
"""

_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)
_view_name = Unicode("LeafletGeoportalMousePositionView").tag(sync=True)
_model_name = Unicode("LeafletGeoportalMousePositionModel").tag(sync=True)
position = Unicode("bottomleft").tag(sync=True)
collapsed = Bool(False).tag(sync=True)
displayAltitude = Bool(True).tag(sync=True)
displayCoordinates = Bool(True).tag(sync=True)
editCoordinates = Bool(False).tag(sync=True)
altitude = Dict({}).tag(sync=True)
serviceOptions = Dict({})
crs = Unicode().tag(sync=True)
label = Unicode().tag(sync=True)
selectedtype = Unicode().tag(sync=True)
systems = (
List(
[
{crs: "", label: "Lon,Lat", selectedtype: "Geographical"},
{crs: "", label: "Lambert 93", selectedtype: "Metric"},
]
).tag(sync=True),
)
units = List(["DEC", "DMS"]).tag(sync=True)


class GeoportalElevationPath(Control):
Expand All @@ -123,13 +118,6 @@ class GeoportalElevationPath(Control):

_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):
Expand All @@ -139,12 +127,11 @@ class GeoportalIsocurve(Control):
----------
"""

_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)
_view_name = Unicode("LeafletGeoportalIsocurveView").tag(sync=True)
_model_name = Unicode("LeafletGeoportalIsocurveModel").tag(sync=True)
collapsed = (Bool(False).tag(sync=True),)
methods = (List(["time", "distance"]).tag(sync=True),)
exclusions = (Dict({}).tag(sync=True),)
graphs = (List(["Pieton", "Voiture"]).tag(sync=True),)
isocurveOptions = (Dict({}).tag(sync=True),)
autocompleteOptions = Dict({}).tag(sync=True)
62 changes: 34 additions & 28 deletions js/src/controls/GeoportalControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
defaults() {
return {
...super.defaults(),
_view_name: 'LeafletGeoportalLayerSwitcherView',
_model_name: 'LeafletGeoportalLayerSwitcherModel',
position : "bottomleft",
collapsed : false,
layers : []
_view_name: 'LeafletGeoportalLayerSwitcherView',
_model_name: 'LeafletGeoportalLayerSwitcherModel'
};
}
}
Expand All @@ -24,7 +21,7 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
this.map_view = this.options.map_view;
}
create_obj() {
this.obj = L.geoportalControl.LayerSwitcher(this.get_options())
this.obj = L.geoportalControl.LayerSwitcher()
}
}

Expand All @@ -34,11 +31,11 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
...super.defaults(),
_view_name: 'LeafletGeoportalSearchEngineView',
_model_name: 'LeafletGeoportalSearchEngineModel',
apiKey : 'essentiels',
position : 'topleft',
collapsed : true,
zoomTo : 'auto',
displayInfo : true,
apiKey : 'cartes',
displayAdvancedSearch : true,
resources : ["PositionOfInterest", "StreetAddress"],
advancedSearch : {},
Expand All @@ -64,11 +61,8 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
...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
Expand Down Expand Up @@ -96,15 +90,35 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
...super.defaults(),
_view_name: 'LeafletGeoportalMousePositionView',
_model_name: 'LeafletGeoportalMousePositionModel',
apiKey : 'essentiels',
position : 'bottomleft',
collapsed : false,
displayAltitude : false,
displayAltitude : true,
displayCoordinates : true,
editCoordinates : true,
altitude : {},
systems : [],
units : []
editCoordinates : false,
crs : '',
label : '',
selectedtype: '',
altitude : {
triggerDelay : 100,
responseDelay : 500,
noDataValue : -99999,
noDataValueTolerance : 90000,
serviceOptions : {}
},
systems : [
{
crs : L.CRS.EPSG4326,
label : "Lon,Lat",
selectedtype : "Geographical"
},
{
crs : L.geoportalCRS.EPSG2154,
label : "Lambert 93",
selectedtype : "Metric"
}
],
units : ["DEC", "DMS"]

};
}
}
Expand All @@ -115,23 +129,16 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
this.map_view = this.options.map_view;
}
create_obj() {
this.obj = L.geoportalControl.MousePosition(this.get_options())
this.obj = L.geoportalControl.MousePosition({})
}
}

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 : {},
_view_name: 'LeafletGeoportalElevationPathView',
_model_name: 'LeafletGeoportalElevationPathModel'
};
}
}
Expand All @@ -142,7 +149,7 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
this.map_view = this.options.map_view;
}
create_obj() {
this.obj = L.geoportalControl.ElevationPath(this.get_options())
this.obj = L.geoportalControl.ElevationPath({})
}
}

Expand All @@ -152,7 +159,6 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
...super.defaults(),
_view_name: 'LeafletGeoportalIsocurve',
_model_name: 'LeafletGeoportalIsocurveModel',
apiKey : 'essentiels',
collapsed : false,
methods : ["time", "distance"],
exclusions : {
Expand Down
Binary file not shown.
3 changes: 0 additions & 3 deletions ui-tests/playwright-report/index.html

This file was deleted.

Binary file not shown.

0 comments on commit bc31e3c

Please sign in to comment.