Skip to content

Commit bc31e3c

Browse files
HaudinFlorencedavidbrochart
authored andcommitted
Revert "Update or add options of the various controls."
This reverts commit 39dafb8.
1 parent 6122381 commit bc31e3c

File tree

6 files changed

+94
-104
lines changed

6 files changed

+94
-104
lines changed

examples/GeoportalControls.ipynb

+21-21
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,26 @@
2828
},
2929
{
3030
"cell_type": "code",
31-
"execution_count": null,
31+
"execution_count": 2,
3232
"id": "3a686d99-c3ca-4596-81aa-24442564bea2",
3333
"metadata": {},
34-
"outputs": [],
34+
"outputs": [
35+
{
36+
"data": {
37+
"application/vnd.jupyter.widget-view+json": {
38+
"model_id": "47bf5fd8b8aa413fb0eacad5627beee6",
39+
"version_major": 2,
40+
"version_minor": 0
41+
},
42+
"text/plain": [
43+
"Map(center=[44.799999, 2.26667], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', '…"
44+
]
45+
},
46+
"execution_count": 2,
47+
"metadata": {},
48+
"output_type": "execute_result"
49+
}
50+
],
3551
"source": [
3652
"#LayerSwitcher control\n",
3753
"m1 = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n",
@@ -59,30 +75,14 @@
5975
},
6076
{
6177
"cell_type": "code",
62-
"execution_count": 2,
78+
"execution_count": null,
6379
"id": "0a7ca855-c96d-4864-9b9c-1873712033bb",
6480
"metadata": {},
65-
"outputs": [
66-
{
67-
"data": {
68-
"application/vnd.jupyter.widget-view+json": {
69-
"model_id": "787604374bd34bbdba450d271c0f60bb",
70-
"version_major": 2,
71-
"version_minor": 0
72-
},
73-
"text/plain": [
74-
"Map(center=[44.799999, 2.26667], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', '…"
75-
]
76-
},
77-
"execution_count": 2,
78-
"metadata": {},
79-
"output_type": "execute_result"
80-
}
81-
],
81+
"outputs": [],
8282
"source": [
8383
"#MousePosition control\n",
8484
"m3 = Map(center=(44.799999, 2.26667), zoom=10, zoom_control=True)\n",
85-
"mouse_position_control = GeoportalMousePosition(display_altitude=True)\n",
85+
"mouse_position_control = GeoportalMousePosition()\n",
8686
"m3.add(mouse_position_control)"
8787
]
8888
},

ipyleaflet/geoportal.py

+39-52
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Distributed under the terms of the Modified BSD License.
33

44

5-
from traitlets import Unicode, Bool, List, Dict, Instance, Any
5+
from traitlets import Unicode, Bool, List, Dict
66
from .leaflet import TileLayer, Control
77

88

@@ -36,17 +36,6 @@ class GeoportalLayerSwitcher(Control):
3636

3737
_view_name = Unicode("LeafletGeoportalLayerSwitcherView").tag(sync=True)
3838
_model_name = Unicode("LeafletGeoportalLayerSwitcherModel").tag(sync=True)
39-
position = Unicode("bottomleft").tag(sync=True, o=True)
40-
collapsed = Bool(False).tag(sync=True, o=True)
41-
layers = List([]).tag(sync=True, o=True)
42-
layer = Instance(TileLayer).tag(sync=True, o=True)
43-
display = Bool(True).tag(sync=True, o=True)
44-
config = Any().tag(sync=True, o=True)
45-
visibility = Unicode("").tag(sync=True, o=True)
46-
title = Unicode("").tag(sync=True, o=True)
47-
description = Unicode("").tag(sync=True, o=True)
48-
quicklook_url = Unicode("").tag(sync=True, o=True)
49-
legends = List([]).tag(sync=True, o=True)
5039

5140

5241
class GeoportalSearchEngine(Control):
@@ -65,6 +54,7 @@ class GeoportalSearchEngine(Control):
6554
collapsed = Bool(True).tag(sync=True, o=True)
6655
zoomTo = Unicode("auto").tag(sync=True, o=True)
6756
displayInfo = Bool(True).tag(sync=True, o=True)
57+
apiKey = Unicode("cartes").tag(sync=True, o=True)
6858
displayAdvancedSearch = Bool(True).tag(sync=True, o=True)
6959
resources = List(["PositionOfInterest", "StreetAddress"]).tag(sync=True, o=True)
7060
advancedSearch = Dict({}).tag(sync=True, o=True)
@@ -79,19 +69,14 @@ class GeoportalRoute(Control):
7969
----------
8070
"""
8171

82-
_view_name = Unicode("LeafletGeoportalRouteView").tag(sync=True, o=True)
83-
_model_name = Unicode("LeafletGeoportalRouteModel").tag(sync=True, o=True)
84-
api_key = Unicode("essentiels").tag(sync=True, o=True)
85-
position = Unicode("bottomleft").tag(sync=True, o=True)
86-
collapsed = Bool(True).tag(sync=True, o=True)
87-
ssl = Bool(True).tag(sync=True, o=True)
88-
disableReverse = Bool(False).tag(sync=True, o=True)
89-
exclusions = Dict({"toll": True, "bridge": False, "tunnel": True}).tag(
90-
sync=True, o=True
91-
)
92-
graphs = List(["Pieton", "Voiture"]).tag(sync=True, o=True)
93-
autocompleteOptions = Dict({}).tag(sync=True, o=True)
94-
routeOptions = Dict({}).tag(sync=True, o=True)
72+
_view_name = Unicode("LeafletGeoportalRouteView").tag(sync=True)
73+
_model_name = Unicode("LeafletGeoportalRouteModel").tag(sync=True)
74+
position = Unicode("bottomleft").tag(sync=True)
75+
collapsed = Bool(True).tag(sync=True)
76+
exclusions = Dict({"toll": True, "bridge": False, "tunnel": True}).tag(sync=True)
77+
graphs = List(["Pieton", "Voiture"]).tag(sync=True)
78+
autocompleteOptions = Dict({}).tag(sync=True)
79+
routeOptions = Dict({}).tag(sync=True)
9580

9681

9782
class GeoportalMousePosition(Control):
@@ -101,17 +86,27 @@ class GeoportalMousePosition(Control):
10186
----------
10287
"""
10388

104-
_view_name = Unicode("LeafletGeoportalMousePositionView").tag(sync=True, o=True)
105-
_model_name = Unicode("LeafletGeoportalMousePositionModel").tag(sync=True, o=True)
106-
api_key = Unicode("essentiels").tag(sync=True, o=True)
107-
position = Unicode("bottomleft").tag(sync=True, o=True)
108-
collapsed = Bool(False).tag(sync=True, o=True)
109-
display_altitude = Bool(False).tag(sync=True, o=True)
110-
display_coordinates = Bool(True).tag(sync=True, o=True)
111-
edit_coordinates = Bool(True).tag(sync=True, o=True)
112-
systems = List([]).tag(sync=True, o=True)
113-
altitude = Any([]).tag(sync=True, o=True)
114-
units = List([]).tag(sync=True, o=True)
89+
_view_name = Unicode("LeafletGeoportalMousePositionView").tag(sync=True)
90+
_model_name = Unicode("LeafletGeoportalMousePositionModel").tag(sync=True)
91+
position = Unicode("bottomleft").tag(sync=True)
92+
collapsed = Bool(False).tag(sync=True)
93+
displayAltitude = Bool(True).tag(sync=True)
94+
displayCoordinates = Bool(True).tag(sync=True)
95+
editCoordinates = Bool(False).tag(sync=True)
96+
altitude = Dict({}).tag(sync=True)
97+
serviceOptions = Dict({})
98+
crs = Unicode().tag(sync=True)
99+
label = Unicode().tag(sync=True)
100+
selectedtype = Unicode().tag(sync=True)
101+
systems = (
102+
List(
103+
[
104+
{crs: "", label: "Lon,Lat", selectedtype: "Geographical"},
105+
{crs: "", label: "Lambert 93", selectedtype: "Metric"},
106+
]
107+
).tag(sync=True),
108+
)
109+
units = List(["DEC", "DMS"]).tag(sync=True)
115110

116111

117112
class GeoportalElevationPath(Control):
@@ -123,13 +118,6 @@ class GeoportalElevationPath(Control):
123118

124119
_view_name = Unicode("LeafletGeoportalElevationPathView").tag(sync=True)
125120
_model_name = Unicode("LeafletGeoportalElevationPathModel").tag(sync=True)
126-
api_key = Unicode("essentiels").tag(sync=True, o=True)
127-
position = Unicode("bottomleft").tag(sync=True, o=True)
128-
openssl = Bool(True).tag(sync=True, o=True)
129-
active = Bool(False).tag(sync=True, o=True)
130-
stylesOptions = Unicode("DEFAULT_STYLES").tag(sync=True, o=True)
131-
elevationPathOptions = Dict({}).tag(sync=True, o=True)
132-
displayProfileOptions = Dict({}).tag(sync=True, o=True)
133121

134122

135123
class GeoportalIsocurve(Control):
@@ -139,12 +127,11 @@ class GeoportalIsocurve(Control):
139127
----------
140128
"""
141129

142-
_view_name = Unicode("LeafletGeoportalIsocurveView").tag(sync=True, o=True)
143-
_model_name = Unicode("LeafletGeoportalIsocurveModel").tag(sync=True, o=True)
144-
api_key = Unicode("essentiels").tag(sync=True, o=True)
145-
collapsed = Bool(False).tag(sync=True, o=True)
146-
methods = List(["time", "distance"]).tag(sync=True, o=True)
147-
exclusions = Dict({}).tag(sync=True).tag(sync=True, o=True)
148-
graphs = List(["Pieton", "Voiture"]).tag(sync=True, o=True)
149-
isocurveOptions = Dict({}).tag(sync=True, o=True)
150-
autocompleteOptions = Dict({}).tag(sync=True).tag(sync=True, o=True)
130+
_view_name = Unicode("LeafletGeoportalIsocurveView").tag(sync=True)
131+
_model_name = Unicode("LeafletGeoportalIsocurveModel").tag(sync=True)
132+
collapsed = (Bool(False).tag(sync=True),)
133+
methods = (List(["time", "distance"]).tag(sync=True),)
134+
exclusions = (Dict({}).tag(sync=True),)
135+
graphs = (List(["Pieton", "Voiture"]).tag(sync=True),)
136+
isocurveOptions = (Dict({}).tag(sync=True),)
137+
autocompleteOptions = Dict({}).tag(sync=True)

js/src/controls/GeoportalControls.js

+34-28
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
99
defaults() {
1010
return {
1111
...super.defaults(),
12-
_view_name: 'LeafletGeoportalLayerSwitcherView',
13-
_model_name: 'LeafletGeoportalLayerSwitcherModel',
14-
position : "bottomleft",
15-
collapsed : false,
16-
layers : []
12+
_view_name: 'LeafletGeoportalLayerSwitcherView',
13+
_model_name: 'LeafletGeoportalLayerSwitcherModel'
1714
};
1815
}
1916
}
@@ -24,7 +21,7 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
2421
this.map_view = this.options.map_view;
2522
}
2623
create_obj() {
27-
this.obj = L.geoportalControl.LayerSwitcher(this.get_options())
24+
this.obj = L.geoportalControl.LayerSwitcher()
2825
}
2926
}
3027

@@ -34,11 +31,11 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
3431
...super.defaults(),
3532
_view_name: 'LeafletGeoportalSearchEngineView',
3633
_model_name: 'LeafletGeoportalSearchEngineModel',
37-
apiKey : 'essentiels',
3834
position : 'topleft',
3935
collapsed : true,
4036
zoomTo : 'auto',
4137
displayInfo : true,
38+
apiKey : 'cartes',
4239
displayAdvancedSearch : true,
4340
resources : ["PositionOfInterest", "StreetAddress"],
4441
advancedSearch : {},
@@ -64,11 +61,8 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
6461
...super.defaults(),
6562
_view_name: 'LeafletGeoportalRouteView',
6663
_model_name: 'LeafletGeoportalRouteModel',
67-
apiKey : 'essentiels',
6864
position : "bottomleft",
6965
collapsed : true,
70-
ssl : true,
71-
disableReverse : false,
7266
exclusions : {"toll" : true,
7367
"bridge" : false,
7468
"tunnel" : true
@@ -96,15 +90,35 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
9690
...super.defaults(),
9791
_view_name: 'LeafletGeoportalMousePositionView',
9892
_model_name: 'LeafletGeoportalMousePositionModel',
99-
apiKey : 'essentiels',
10093
position : 'bottomleft',
10194
collapsed : false,
102-
displayAltitude : false,
95+
displayAltitude : true,
10396
displayCoordinates : true,
104-
editCoordinates : true,
105-
altitude : {},
106-
systems : [],
107-
units : []
97+
editCoordinates : false,
98+
crs : '',
99+
label : '',
100+
selectedtype: '',
101+
altitude : {
102+
triggerDelay : 100,
103+
responseDelay : 500,
104+
noDataValue : -99999,
105+
noDataValueTolerance : 90000,
106+
serviceOptions : {}
107+
},
108+
systems : [
109+
{
110+
crs : L.CRS.EPSG4326,
111+
label : "Lon,Lat",
112+
selectedtype : "Geographical"
113+
},
114+
{
115+
crs : L.geoportalCRS.EPSG2154,
116+
label : "Lambert 93",
117+
selectedtype : "Metric"
118+
}
119+
],
120+
units : ["DEC", "DMS"]
121+
108122
};
109123
}
110124
}
@@ -115,23 +129,16 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
115129
this.map_view = this.options.map_view;
116130
}
117131
create_obj() {
118-
this.obj = L.geoportalControl.MousePosition(this.get_options())
132+
this.obj = L.geoportalControl.MousePosition({})
119133
}
120134
}
121135

122136
export class LeafletGeoportalElevationPathModel extends control.LeafletControlModel {
123137
defaults() {
124138
return {
125139
...super.defaults(),
126-
_view_name: 'LeafletGeoportalElevationPathView',
127-
_model_name: 'LeafletGeoportalElevationPathModel',
128-
apiKey : 'essentiels',
129-
position : 'bottomleft',
130-
openssl : true,
131-
active : false,
132-
stylesOptions : 'DEFAULT_STYLES',
133-
elevationPathOptions: {},
134-
displayProfileOptions : {},
140+
_view_name: 'LeafletGeoportalElevationPathView',
141+
_model_name: 'LeafletGeoportalElevationPathModel'
135142
};
136143
}
137144
}
@@ -142,7 +149,7 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
142149
this.map_view = this.options.map_view;
143150
}
144151
create_obj() {
145-
this.obj = L.geoportalControl.ElevationPath(this.get_options())
152+
this.obj = L.geoportalControl.ElevationPath({})
146153
}
147154
}
148155

@@ -152,7 +159,6 @@ export class LeafletGeoportalLayerSwitcherModel extends control.LeafletControlMo
152159
...super.defaults(),
153160
_view_name: 'LeafletGeoportalIsocurve',
154161
_model_name: 'LeafletGeoportalIsocurveModel',
155-
apiKey : 'essentiels',
156162
collapsed : false,
157163
methods : ["time", "distance"],
158164
exclusions : {
Binary file not shown.

ui-tests/playwright-report/index.html

-3
This file was deleted.

0 commit comments

Comments
 (0)