umap-project 2.6.0b0__py3-none-any.whl → 2.6.0b2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- umap/__init__.py +1 -1
- umap/locale/en/LC_MESSAGES/django.po +3 -3
- umap/locale/hu/LC_MESSAGES/django.mo +0 -0
- umap/locale/hu/LC_MESSAGES/django.po +18 -18
- umap/settings/base.py +6 -0
- umap/static/umap/js/modules/autocomplete.js +5 -9
- umap/static/umap/js/modules/data/features.js +6 -12
- umap/static/umap/js/modules/importers/overpass.js +22 -8
- umap/static/umap/js/modules/rendering/ui.js +41 -4
- umap/static/umap/js/modules/rules.js +16 -3
- umap/static/umap/js/modules/schema.js +1 -1
- umap/static/umap/js/umap.controls.js +2 -1
- umap/static/umap/js/umap.forms.js +9 -5
- umap/static/umap/js/umap.js +7 -2
- umap/static/umap/locale/am_ET.js +8 -2
- umap/static/umap/locale/am_ET.json +8 -2
- umap/static/umap/locale/ar.js +8 -2
- umap/static/umap/locale/ar.json +8 -2
- umap/static/umap/locale/ast.js +8 -2
- umap/static/umap/locale/ast.json +8 -2
- umap/static/umap/locale/bg.js +8 -2
- umap/static/umap/locale/bg.json +8 -2
- umap/static/umap/locale/br.js +8 -2
- umap/static/umap/locale/br.json +8 -2
- umap/static/umap/locale/ca.js +18 -12
- umap/static/umap/locale/ca.json +18 -12
- umap/static/umap/locale/cs_CZ.js +8 -2
- umap/static/umap/locale/cs_CZ.json +8 -2
- umap/static/umap/locale/da.js +8 -2
- umap/static/umap/locale/da.json +8 -2
- umap/static/umap/locale/de.js +8 -2
- umap/static/umap/locale/de.json +8 -2
- umap/static/umap/locale/el.js +8 -2
- umap/static/umap/locale/el.json +8 -2
- umap/static/umap/locale/en.js +4 -2
- umap/static/umap/locale/en.json +4 -2
- umap/static/umap/locale/en_US.json +8 -2
- umap/static/umap/locale/es.js +8 -2
- umap/static/umap/locale/es.json +8 -2
- umap/static/umap/locale/et.js +8 -2
- umap/static/umap/locale/et.json +8 -2
- umap/static/umap/locale/eu.js +344 -338
- umap/static/umap/locale/eu.json +344 -338
- umap/static/umap/locale/fa_IR.js +368 -362
- umap/static/umap/locale/fa_IR.json +368 -362
- umap/static/umap/locale/fi.js +8 -2
- umap/static/umap/locale/fi.json +8 -2
- umap/static/umap/locale/fr.js +4 -2
- umap/static/umap/locale/fr.json +4 -2
- umap/static/umap/locale/gl.js +8 -2
- umap/static/umap/locale/gl.json +8 -2
- umap/static/umap/locale/he.js +8 -2
- umap/static/umap/locale/he.json +8 -2
- umap/static/umap/locale/hr.js +8 -2
- umap/static/umap/locale/hr.json +8 -2
- umap/static/umap/locale/hu.js +31 -23
- umap/static/umap/locale/hu.json +31 -23
- umap/static/umap/locale/id.js +8 -2
- umap/static/umap/locale/id.json +8 -2
- umap/static/umap/locale/is.js +8 -2
- umap/static/umap/locale/is.json +8 -2
- umap/static/umap/locale/it.js +8 -2
- umap/static/umap/locale/it.json +8 -2
- umap/static/umap/locale/ja.js +8 -2
- umap/static/umap/locale/ja.json +8 -2
- umap/static/umap/locale/ko.js +8 -2
- umap/static/umap/locale/ko.json +8 -2
- umap/static/umap/locale/lt.js +8 -2
- umap/static/umap/locale/lt.json +8 -2
- umap/static/umap/locale/ms.js +8 -2
- umap/static/umap/locale/ms.json +8 -2
- umap/static/umap/locale/nl.js +8 -2
- umap/static/umap/locale/nl.json +8 -2
- umap/static/umap/locale/no.js +8 -2
- umap/static/umap/locale/no.json +8 -2
- umap/static/umap/locale/pl.js +54 -48
- umap/static/umap/locale/pl.json +54 -48
- umap/static/umap/locale/pl_PL.json +8 -2
- umap/static/umap/locale/pt.js +8 -2
- umap/static/umap/locale/pt.json +8 -2
- umap/static/umap/locale/pt_BR.js +8 -2
- umap/static/umap/locale/pt_BR.json +8 -2
- umap/static/umap/locale/pt_PT.js +8 -2
- umap/static/umap/locale/pt_PT.json +8 -2
- umap/static/umap/locale/ro.js +8 -2
- umap/static/umap/locale/ro.json +8 -2
- umap/static/umap/locale/ru.js +8 -2
- umap/static/umap/locale/ru.json +8 -2
- umap/static/umap/locale/sk_SK.js +8 -2
- umap/static/umap/locale/sk_SK.json +8 -2
- umap/static/umap/locale/sl.js +8 -2
- umap/static/umap/locale/sl.json +8 -2
- umap/static/umap/locale/sr.js +8 -2
- umap/static/umap/locale/sr.json +8 -2
- umap/static/umap/locale/sv.js +8 -2
- umap/static/umap/locale/sv.json +8 -2
- umap/static/umap/locale/th_TH.js +8 -2
- umap/static/umap/locale/th_TH.json +8 -2
- umap/static/umap/locale/tr.js +8 -2
- umap/static/umap/locale/tr.json +8 -2
- umap/static/umap/locale/uk_UA.js +8 -2
- umap/static/umap/locale/uk_UA.json +8 -2
- umap/static/umap/locale/vi.js +8 -2
- umap/static/umap/locale/vi.json +8 -2
- umap/static/umap/locale/vi_VN.json +8 -2
- umap/static/umap/locale/zh.js +8 -2
- umap/static/umap/locale/zh.json +8 -2
- umap/static/umap/locale/zh_CN.json +8 -2
- umap/static/umap/locale/zh_TW.Big5.json +8 -2
- umap/static/umap/locale/zh_TW.js +102 -96
- umap/static/umap/locale/zh_TW.json +102 -96
- umap/static/umap/map.css +4 -4
- umap/static/umap/vars.css +1 -0
- umap/static/umap/vendors/editable/Leaflet.Editable.js +2079 -1937
- umap/static/umap/vendors/markercluster/MarkerCluster.Default.css +1 -1
- umap/templates/umap/content_footer.html +1 -1
- umap/templates/umap/map_list.html +3 -1
- umap/tests/integration/test_conditional_rules.py +102 -17
- umap/tests/integration/test_draw_polygon.py +28 -0
- umap/tests/integration/test_edit_datalayer.py +2 -2
- umap/tests/integration/test_import.py +60 -0
- umap/tests/integration/test_querystring.py +7 -0
- {umap_project-2.6.0b0.dist-info → umap_project-2.6.0b2.dist-info}/METADATA +6 -6
- {umap_project-2.6.0b0.dist-info → umap_project-2.6.0b2.dist-info}/RECORD +127 -127
- {umap_project-2.6.0b0.dist-info → umap_project-2.6.0b2.dist-info}/WHEEL +0 -0
- {umap_project-2.6.0b0.dist-info → umap_project-2.6.0b2.dist-info}/entry_points.txt +0 -0
- {umap_project-2.6.0b0.dist-info → umap_project-2.6.0b2.dist-info}/licenses/LICENSE +0 -0
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
{% for language in languages %}
|
|
15
15
|
<option value="{{ language.code }}"
|
|
16
16
|
{% if language.code == LANGUAGE_CODE %}selected="selected"{% endif %}>
|
|
17
|
-
{{ language.name_local }}
|
|
17
|
+
{{ language.name_local }} ({{ language.code }})
|
|
18
18
|
</option>
|
|
19
19
|
{% endfor %}
|
|
20
20
|
</select>
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
<div class="legend">
|
|
8
8
|
<a href="{{ map_inst.get_absolute_url }}">{{ map_inst.name }}</a>
|
|
9
9
|
{% with author=map_inst.get_author %}
|
|
10
|
-
|
|
10
|
+
{% if author %}
|
|
11
|
+
<em>{% trans "by" %} <a href="{{ author.get_url }}">{{ author }}</a></em>
|
|
12
|
+
{% endif %}
|
|
11
13
|
{% endwith %}
|
|
12
14
|
</div>
|
|
13
15
|
</div>
|
|
@@ -24,6 +24,7 @@ DATALAYER_DATA1 = {
|
|
|
24
24
|
"mynumber": 10,
|
|
25
25
|
"myboolean": True,
|
|
26
26
|
"mydate": "2024/04/14 12:19:17",
|
|
27
|
+
"maybeempty": "not empty",
|
|
27
28
|
},
|
|
28
29
|
"geometry": {"type": "Point", "coordinates": [0.065918, 48.385442]},
|
|
29
30
|
},
|
|
@@ -35,6 +36,7 @@ DATALAYER_DATA1 = {
|
|
|
35
36
|
"mynumber": 12,
|
|
36
37
|
"myboolean": False,
|
|
37
38
|
"mydate": "2024/03/13 12:20:20",
|
|
39
|
+
"maybeempty": "",
|
|
38
40
|
},
|
|
39
41
|
"geometry": {"type": "Point", "coordinates": [3.55957, 49.767074]},
|
|
40
42
|
},
|
|
@@ -56,6 +58,7 @@ DATALAYER_DATA2 = {
|
|
|
56
58
|
"mynumber": 10,
|
|
57
59
|
"myboolean": "true",
|
|
58
60
|
"mydate": "2024/08/18 13:14:15",
|
|
61
|
+
"maybeempty": None,
|
|
59
62
|
},
|
|
60
63
|
"geometry": {"type": "Point", "coordinates": [0.856934, 45.290347]},
|
|
61
64
|
},
|
|
@@ -69,6 +72,18 @@ DATALAYER_DATA2 = {
|
|
|
69
72
|
},
|
|
70
73
|
"geometry": {"type": "Point", "coordinates": [4.372559, 47.945786]},
|
|
71
74
|
},
|
|
75
|
+
{
|
|
76
|
+
"type": "Feature",
|
|
77
|
+
"properties": {
|
|
78
|
+
"mytype": "odd",
|
|
79
|
+
"name": "Point 5",
|
|
80
|
+
"mynumber": 10,
|
|
81
|
+
"mydate": "2024-04-14T10:19:17.000Z",
|
|
82
|
+
"myboolean": "notaboolean",
|
|
83
|
+
"maybeempty": "foo",
|
|
84
|
+
},
|
|
85
|
+
"geometry": {"type": "Point", "coordinates": [4.1, 47.3]},
|
|
86
|
+
},
|
|
72
87
|
],
|
|
73
88
|
"_umap_options": {
|
|
74
89
|
"name": "Calque 2",
|
|
@@ -85,9 +100,9 @@ def test_simple_equal_rule_at_load(live_server, page, map):
|
|
|
85
100
|
DataLayerFactory(map=map, data=DATALAYER_DATA2)
|
|
86
101
|
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
|
|
87
102
|
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
88
|
-
expect(markers).to_have_count(
|
|
103
|
+
expect(markers).to_have_count(5)
|
|
89
104
|
colors = getColors(markers)
|
|
90
|
-
assert colors.count("rgb(240, 248, 255)") ==
|
|
105
|
+
assert colors.count("rgb(240, 248, 255)") == 3
|
|
91
106
|
|
|
92
107
|
|
|
93
108
|
def test_simple_not_equal_rule_at_load(live_server, page, map):
|
|
@@ -99,9 +114,9 @@ def test_simple_not_equal_rule_at_load(live_server, page, map):
|
|
|
99
114
|
DataLayerFactory(map=map, data=DATALAYER_DATA2)
|
|
100
115
|
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
|
|
101
116
|
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
102
|
-
expect(markers).to_have_count(
|
|
117
|
+
expect(markers).to_have_count(5)
|
|
103
118
|
colors = getColors(markers)
|
|
104
|
-
assert colors.count("rgb(240, 248, 255)") ==
|
|
119
|
+
assert colors.count("rgb(240, 248, 255)") == 3
|
|
105
120
|
|
|
106
121
|
|
|
107
122
|
def test_gt_rule_with_number_at_load(live_server, page, map):
|
|
@@ -113,7 +128,7 @@ def test_gt_rule_with_number_at_load(live_server, page, map):
|
|
|
113
128
|
DataLayerFactory(map=map, data=DATALAYER_DATA2)
|
|
114
129
|
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
|
|
115
130
|
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
116
|
-
expect(markers).to_have_count(
|
|
131
|
+
expect(markers).to_have_count(5)
|
|
117
132
|
colors = getColors(markers)
|
|
118
133
|
assert colors.count("rgb(240, 248, 255)") == 2
|
|
119
134
|
|
|
@@ -127,9 +142,9 @@ def test_lt_rule_with_number_at_load(live_server, page, map):
|
|
|
127
142
|
DataLayerFactory(map=map, data=DATALAYER_DATA2)
|
|
128
143
|
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
|
|
129
144
|
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
130
|
-
expect(markers).to_have_count(
|
|
145
|
+
expect(markers).to_have_count(5)
|
|
131
146
|
colors = getColors(markers)
|
|
132
|
-
assert colors.count("rgb(240, 248, 255)") ==
|
|
147
|
+
assert colors.count("rgb(240, 248, 255)") == 4
|
|
133
148
|
|
|
134
149
|
|
|
135
150
|
def test_lt_rule_with_float_at_load(live_server, page, map):
|
|
@@ -141,9 +156,9 @@ def test_lt_rule_with_float_at_load(live_server, page, map):
|
|
|
141
156
|
DataLayerFactory(map=map, data=DATALAYER_DATA2)
|
|
142
157
|
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
|
|
143
158
|
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
144
|
-
expect(markers).to_have_count(
|
|
159
|
+
expect(markers).to_have_count(5)
|
|
145
160
|
colors = getColors(markers)
|
|
146
|
-
assert colors.count("rgb(240, 248, 255)") ==
|
|
161
|
+
assert colors.count("rgb(240, 248, 255)") == 4
|
|
147
162
|
|
|
148
163
|
|
|
149
164
|
def test_equal_rule_with_boolean_at_load(live_server, page, map):
|
|
@@ -155,7 +170,77 @@ def test_equal_rule_with_boolean_at_load(live_server, page, map):
|
|
|
155
170
|
DataLayerFactory(map=map, data=DATALAYER_DATA2)
|
|
156
171
|
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
|
|
157
172
|
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
158
|
-
expect(markers).to_have_count(
|
|
173
|
+
expect(markers).to_have_count(5)
|
|
174
|
+
colors = getColors(markers)
|
|
175
|
+
assert colors.count("rgb(240, 248, 255)") == 2
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def test_equal_rule_with_boolean_not_true_at_load(live_server, page, map):
|
|
179
|
+
map.settings["properties"]["rules"] = [
|
|
180
|
+
{"condition": "myboolean!=true", "options": {"color": "aliceblue"}}
|
|
181
|
+
]
|
|
182
|
+
map.save()
|
|
183
|
+
DataLayerFactory(map=map, data=DATALAYER_DATA1)
|
|
184
|
+
DataLayerFactory(map=map, data=DATALAYER_DATA2)
|
|
185
|
+
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
|
|
186
|
+
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
187
|
+
expect(markers).to_have_count(5)
|
|
188
|
+
colors = getColors(markers)
|
|
189
|
+
assert colors.count("rgb(240, 248, 255)") == 3
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def test_equal_rule_with_boolean_false_at_load(live_server, page, map):
|
|
193
|
+
map.settings["properties"]["rules"] = [
|
|
194
|
+
{"condition": "myboolean=false", "options": {"color": "aliceblue"}}
|
|
195
|
+
]
|
|
196
|
+
map.save()
|
|
197
|
+
DataLayerFactory(map=map, data=DATALAYER_DATA1)
|
|
198
|
+
DataLayerFactory(map=map, data=DATALAYER_DATA2)
|
|
199
|
+
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
|
|
200
|
+
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
201
|
+
expect(markers).to_have_count(5)
|
|
202
|
+
colors = getColors(markers)
|
|
203
|
+
assert colors.count("rgb(240, 248, 255)") == 1
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
def test_equal_rule_with_boolean_not_false_at_load(live_server, page, map):
|
|
207
|
+
map.settings["properties"]["rules"] = [
|
|
208
|
+
{"condition": "myboolean!=false", "options": {"color": "aliceblue"}}
|
|
209
|
+
]
|
|
210
|
+
map.save()
|
|
211
|
+
DataLayerFactory(map=map, data=DATALAYER_DATA1)
|
|
212
|
+
DataLayerFactory(map=map, data=DATALAYER_DATA2)
|
|
213
|
+
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
|
|
214
|
+
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
215
|
+
expect(markers).to_have_count(5)
|
|
216
|
+
colors = getColors(markers)
|
|
217
|
+
assert colors.count("rgb(240, 248, 255)") == 4
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def test_empty_rule_at_load(live_server, page, map):
|
|
221
|
+
map.settings["properties"]["rules"] = [
|
|
222
|
+
{"condition": "maybeempty=", "options": {"color": "aliceblue"}}
|
|
223
|
+
]
|
|
224
|
+
map.save()
|
|
225
|
+
DataLayerFactory(map=map, data=DATALAYER_DATA1)
|
|
226
|
+
DataLayerFactory(map=map, data=DATALAYER_DATA2)
|
|
227
|
+
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
|
|
228
|
+
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
229
|
+
expect(markers).to_have_count(5)
|
|
230
|
+
colors = getColors(markers)
|
|
231
|
+
assert colors.count("rgb(240, 248, 255)") == 3
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def test_not_empty_rule_at_load(live_server, page, map):
|
|
235
|
+
map.settings["properties"]["rules"] = [
|
|
236
|
+
{"condition": "maybeempty!=", "options": {"color": "aliceblue"}}
|
|
237
|
+
]
|
|
238
|
+
map.save()
|
|
239
|
+
DataLayerFactory(map=map, data=DATALAYER_DATA1)
|
|
240
|
+
DataLayerFactory(map=map, data=DATALAYER_DATA2)
|
|
241
|
+
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
|
|
242
|
+
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
243
|
+
expect(markers).to_have_count(5)
|
|
159
244
|
colors = getColors(markers)
|
|
160
245
|
assert colors.count("rgb(240, 248, 255)") == 2
|
|
161
246
|
|
|
@@ -165,7 +250,7 @@ def test_can_create_new_rule(live_server, page, openmap):
|
|
|
165
250
|
DataLayerFactory(map=openmap, data=DATALAYER_DATA2)
|
|
166
251
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}#6/48.948/1.670")
|
|
167
252
|
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
168
|
-
expect(markers).to_have_count(
|
|
253
|
+
expect(markers).to_have_count(5)
|
|
169
254
|
page.get_by_role("button", name="Edit").click()
|
|
170
255
|
page.get_by_role("link", name="Map advanced properties").click()
|
|
171
256
|
page.get_by_text("Conditional style rules").click()
|
|
@@ -175,7 +260,7 @@ def test_can_create_new_rule(live_server, page, openmap):
|
|
|
175
260
|
page.locator(".umap-field-color .define").first.click()
|
|
176
261
|
page.get_by_title("AliceBlue").first.click()
|
|
177
262
|
colors = getColors(markers)
|
|
178
|
-
assert colors.count("rgb(240, 248, 255)") ==
|
|
263
|
+
assert colors.count("rgb(240, 248, 255)") == 3
|
|
179
264
|
|
|
180
265
|
|
|
181
266
|
def test_can_deactive_rule_from_list(live_server, page, openmap):
|
|
@@ -187,9 +272,9 @@ def test_can_deactive_rule_from_list(live_server, page, openmap):
|
|
|
187
272
|
DataLayerFactory(map=openmap, data=DATALAYER_DATA2)
|
|
188
273
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}#6/48.948/1.670")
|
|
189
274
|
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
190
|
-
expect(markers).to_have_count(
|
|
275
|
+
expect(markers).to_have_count(5)
|
|
191
276
|
colors = getColors(markers)
|
|
192
|
-
assert colors.count("rgb(240, 248, 255)") ==
|
|
277
|
+
assert colors.count("rgb(240, 248, 255)") == 3
|
|
193
278
|
page.get_by_role("button", name="Edit").click()
|
|
194
279
|
page.get_by_role("link", name="Map advanced properties").click()
|
|
195
280
|
page.get_by_text("Conditional style rules").click()
|
|
@@ -198,7 +283,7 @@ def test_can_deactive_rule_from_list(live_server, page, openmap):
|
|
|
198
283
|
assert colors.count("rgb(240, 248, 255)") == 0
|
|
199
284
|
page.get_by_role("button", name="Show/hide layer").click()
|
|
200
285
|
colors = getColors(markers)
|
|
201
|
-
assert colors.count("rgb(240, 248, 255)") ==
|
|
286
|
+
assert colors.count("rgb(240, 248, 255)") == 3
|
|
202
287
|
|
|
203
288
|
|
|
204
289
|
def test_autocomplete_datalist(live_server, page, openmap):
|
|
@@ -209,9 +294,9 @@ def test_autocomplete_datalist(live_server, page, openmap):
|
|
|
209
294
|
page.get_by_role("button", name="Add rule").click()
|
|
210
295
|
panel = page.locator(".panel.right.on")
|
|
211
296
|
datalist = panel.locator(".umap-field-condition datalist option")
|
|
212
|
-
expect(datalist).to_have_count(
|
|
297
|
+
expect(datalist).to_have_count(6)
|
|
213
298
|
values = {option.inner_text() for option in datalist.all()}
|
|
214
|
-
assert values == {"myboolean", "mytype", "mynumber", "mydate", "name"}
|
|
299
|
+
assert values == {"myboolean", "mytype", "mynumber", "mydate", "name", "maybeempty"}
|
|
215
300
|
page.get_by_placeholder("key=value or key!=value").fill("mytype")
|
|
216
301
|
expect(datalist).to_have_count(4)
|
|
217
302
|
values = {option.inner_text() for option in datalist.all()}
|
|
@@ -464,3 +464,31 @@ def test_can_draw_a_polygon_and_invert_it(live_server, page, tilelayer, settings
|
|
|
464
464
|
# Click elsewhere on the map, it should now show the popup
|
|
465
465
|
map.click(position={"x": 250, "y": 250})
|
|
466
466
|
expect(popup).to_be_visible()
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
def test_vertexmarker_not_shown_if_too_many(live_server, map, page, settings):
|
|
470
|
+
geojson = '{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[3.350602,48.438077],[3.349287,48.438082],[3.34921,48.438124],[3.348519,48.438108],[3.34546,48.437416],[3.343752,48.436955],[3.339092,48.435705],[3.333756,48.434278],[3.330224,48.433336],[3.326293,48.43229],[3.323154,48.430374],[3.32129,48.429238],[3.321234,48.429191],[3.321164,48.429221],[3.320893,48.429117],[3.320766,48.42912],[3.320575,48.429213],[3.320289,48.429303],[3.320042,48.429427],[3.319659,48.429542],[3.319215,48.429622],[3.318547,48.429691],[3.317845,48.429671],[3.317751,48.429698],[3.316503,48.430404],[3.316247,48.430481],[3.316101,48.431152],[3.316181,48.431164],[3.315466,48.432852],[3.315229,48.432981],[3.314785,48.433076],[3.314588,48.432699],[3.314474,48.432376],[3.314197,48.431965],[3.313812,48.431626],[3.313264,48.431253],[3.312393,48.430865],[3.311687,48.43069],[3.311471,48.430693],[3.311199,48.430622],[3.310632,48.430628],[3.30879,48.430373],[3.307032,48.430298],[3.306597,48.430211],[3.306301,48.430213],[3.306137,48.430161],[3.305651,48.430165],[3.304839,48.430046],[3.303726,48.429803],[3.302861,48.42972],[3.302237,48.429635],[3.300559,48.429488],[3.300396,48.429435],[3.299502,48.429335],[3.298528,48.429198],[3.298176,48.429201],[3.296263,48.429039],[3.296267,48.429307],[3.296237,48.429425],[3.295882,48.429848],[3.295665,48.429789],[3.295397,48.430056],[3.295377,48.430132],[3.295186,48.430421],[3.295198,48.430531],[3.295344,48.430735],[3.296077,48.431333],[3.295938,48.431617],[3.29576,48.43168],[3.294082,48.431442],[3.292288,48.431198],[3.292303,48.431101],[3.29082,48.431007],[3.29043,48.430975],[3.290451,48.431129],[3.290115,48.431105],[3.289097,48.430993],[3.289185,48.430805],[3.288545,48.430699],[3.288311,48.430684],[3.287686,48.430687],[3.287456,48.431129],[3.287465,48.43122],[3.288277,48.431574],[3.28896,48.431915],[3.288937,48.431969],[3.289431,48.432499],[3.289672,48.43292],[3.289871,48.433156],[3.29036,48.433602],[3.290557,48.433724],[3.290781,48.433809],[3.291035,48.433857],[3.291537,48.434024],[3.291819,48.434151],[3.292118,48.434341],[3.292479,48.434677],[3.292929,48.435388],[3.293207,48.435792],[3.293881,48.43672],[3.293762,48.436772],[3.294056,48.437209],[3.294117,48.437385],[3.294618,48.437579],[3.294465,48.437764],[3.294424,48.438087],[3.294357,48.438293],[3.293776,48.438817],[3.293308,48.439323],[3.292929,48.439844],[3.292671,48.440235],[3.29233,48.440924],[3.291807,48.441432],[3.29161,48.441661],[3.291402,48.44196],[3.291265,48.442663],[3.291255,48.442806],[3.291328,48.443126],[3.291407,48.443202],[3.291574,48.443473],[3.292253,48.444495],[3.292329,48.444596],[3.293056,48.445276],[3.293138,48.445309],[3.293368,48.445628],[3.293661,48.445985],[3.29374,48.446117],[3.29396,48.446372],[3.294304,48.446627],[3.294761,48.446912],[3.295881,48.447668],[3.295849,48.447688],[3.296837,48.448338],[3.297547,48.44891],[3.297465,48.44892],[3.297188,48.449195],[3.297597,48.449543],[3.297753,48.449701],[3.297845,48.449851],[3.298264,48.450055],[3.298478,48.450121],[3.298946,48.450221],[3.299309,48.450317],[3.299359,48.450237],[3.300493,48.450461],[3.301087,48.450674],[3.301703,48.45101],[3.301995,48.451197],[3.3024,48.451534],[3.302702,48.45174],[3.303329,48.452007],[3.304029,48.452197],[3.304569,48.452446],[3.304803,48.452502],[3.305096,48.452877],[3.30567,48.453409],[3.305998,48.453617],[3.306329,48.453567],[3.306999,48.453359],[3.307147,48.453453],[3.307452,48.453162],[3.307621,48.452853],[3.307637,48.452428],[3.307707,48.452345],[3.307741,48.452152],[3.307605,48.451823],[3.307551,48.45153],[3.307474,48.451395],[3.307218,48.451316],[3.307069,48.45119],[3.307261,48.450528],[3.307483,48.449868],[3.307603,48.449365],[3.30774,48.448909],[3.307598,48.448808],[3.307761,48.448604],[3.307863,48.447956],[3.307886,48.447645],[3.307972,48.447245],[3.308239,48.446362],[3.308306,48.446042],[3.308487,48.445329],[3.308442,48.444844],[3.308479,48.444713],[3.308967,48.443542],[3.309235,48.442927],[3.309464,48.442289],[3.309372,48.442046],[3.309621,48.441616],[3.310152,48.441065],[3.310213,48.440729],[3.310237,48.440329],[3.310167,48.439906],[3.31076,48.439111],[3.31118,48.438009],[3.311161,48.437961],[3.311906,48.437902],[3.312261,48.437839],[3.312486,48.437744],[3.31306,48.437674],[3.312613,48.438361],[3.312487,48.43883],[3.312493,48.439136],[3.312443,48.439388],[3.312598,48.440393],[3.312739,48.440752],[3.312879,48.440985],[3.313263,48.441305],[3.313916,48.441515],[3.314457,48.441565],[3.315105,48.44156],[3.31581,48.441607],[3.317056,48.441849],[3.318361,48.442198],[3.319041,48.442408],[3.319287,48.442604],[3.319343,48.442711],[3.320216,48.443117],[3.320709,48.443437],[3.32126,48.444007],[3.321788,48.444776],[3.322181,48.445618],[3.322479,48.445616],[3.32283,48.445577],[3.323344,48.445663],[3.324048,48.445693],[3.324695,48.445562],[3.324992,48.445559],[3.325558,48.445482],[3.325963,48.445479],[3.327479,48.445592],[3.327939,48.445678],[3.328502,48.445481],[3.328942,48.445392],[3.329169,48.44538],[3.330112,48.445466],[3.330715,48.445575],[3.330881,48.44557],[3.332155,48.445373],[3.33243,48.445375],[3.332727,48.445438],[3.3332,48.445588],[3.333358,48.445683],[3.333737,48.446027],[3.333998,48.446169],[3.334135,48.446334],[3.334611,48.447294],[3.33488,48.447909],[3.334992,48.447959],[3.335297,48.448013],[3.336516,48.448161],[3.336874,48.44825],[3.337258,48.448531],[3.337442,48.448737],[3.337525,48.448936],[3.337649,48.448967],[3.338263,48.448902],[3.33836,48.44894],[3.338765,48.44921],[3.339281,48.449513],[3.339464,48.449515],[3.339877,48.448856],[3.339867,48.448673],[3.340611,48.447311],[3.341744,48.447535],[3.343846,48.447943],[3.345266,48.448152],[3.345478,48.447345],[3.345816,48.446774],[3.345976,48.446809],[3.346142,48.44657],[3.346,48.446493],[3.346043,48.446099],[3.346047,48.445835],[3.346203,48.44558],[3.34717,48.444977],[3.347471,48.444638],[3.347571,48.444466],[3.347583,48.444183],[3.347678,48.443989],[3.348162,48.443428],[3.348326,48.443259],[3.348351,48.443136],[3.34831,48.442736],[3.348141,48.442484],[3.348246,48.442411],[3.348271,48.442293],[3.348097,48.442202],[3.347875,48.442142],[3.347773,48.441997],[3.34751,48.441531],[3.347394,48.441212],[3.349317,48.441364],[3.349478,48.441055],[3.349528,48.44103],[3.350119,48.441039],[3.350252,48.440793],[3.35052,48.440779],[3.350618,48.440612],[3.35069,48.440129],[3.350806,48.43921],[3.350792,48.439037],[3.350698,48.438594],[3.350566,48.438327],[3.350602,48.438077]]]},"properties":{"nom":"Grisy-sur-Seine","code":"77218","codeDepartement":"77","siren":"217702182","codeEpci":"200040251","codeRegion":"11","codesPostaux":["77480"],"population":107},"id":"g0OTg"}'
|
|
471
|
+
settings.UMAP_ALLOW_ANONYMOUS = True
|
|
472
|
+
page.goto(f"{live_server.url}/en/map/new/#15/48.4395/3.3189")
|
|
473
|
+
page.get_by_title("Import data").click()
|
|
474
|
+
page.locator(".umap-upload textarea").fill(geojson)
|
|
475
|
+
page.locator('select[name="format"]').select_option("geojson")
|
|
476
|
+
page.get_by_role("button", name="Import data", exact=True).click()
|
|
477
|
+
page.locator("path").click()
|
|
478
|
+
page.get_by_role("link", name="Toggle edit mode (⇧+Click)").click()
|
|
479
|
+
expect(page.locator("#umap-tooltip-container")).to_contain_text(
|
|
480
|
+
"Please zoom in to edit the geometry"
|
|
481
|
+
)
|
|
482
|
+
expect(page.locator(".leaflet-vertex-icon")).to_be_hidden()
|
|
483
|
+
page.get_by_label("Zoom in").click()
|
|
484
|
+
expect(page.locator("#umap-tooltip-container")).to_contain_text(
|
|
485
|
+
"Please zoom in to edit the geometry"
|
|
486
|
+
)
|
|
487
|
+
page.get_by_label("Zoom in").click()
|
|
488
|
+
page.wait_for_timeout(500)
|
|
489
|
+
page.get_by_label("Zoom out").click()
|
|
490
|
+
page.wait_for_timeout(500)
|
|
491
|
+
expect(page.locator(".leaflet-vertex-icon")).to_be_hidden()
|
|
492
|
+
expect(page.locator("#umap-tooltip-container")).to_contain_text(
|
|
493
|
+
"Please zoom in to edit the geometry"
|
|
494
|
+
)
|
|
@@ -114,7 +114,7 @@ def test_can_change_icon_class(live_server, openmap, page):
|
|
|
114
114
|
|
|
115
115
|
def test_can_change_name(live_server, openmap, page, datalayer):
|
|
116
116
|
page.goto(
|
|
117
|
-
f"{live_server.url}{openmap.get_absolute_url()}?edit&
|
|
117
|
+
f"{live_server.url}{openmap.get_absolute_url()}?edit&onLoadPanel=databrowser"
|
|
118
118
|
)
|
|
119
119
|
page.get_by_role("link", name="Manage layers").click()
|
|
120
120
|
page.locator(".panel.right").get_by_title("Edit", exact=True).click()
|
|
@@ -133,7 +133,7 @@ def test_can_change_name(live_server, openmap, page, datalayer):
|
|
|
133
133
|
|
|
134
134
|
def test_can_create_new_datalayer(live_server, openmap, page, datalayer):
|
|
135
135
|
page.goto(
|
|
136
|
-
f"{live_server.url}{openmap.get_absolute_url()}?edit&
|
|
136
|
+
f"{live_server.url}{openmap.get_absolute_url()}?edit&onLoadPanel=databrowser"
|
|
137
137
|
)
|
|
138
138
|
page.get_by_role("link", name="Manage layers").click()
|
|
139
139
|
page.get_by_role("button", name="Add a layer").click()
|
|
@@ -579,6 +579,66 @@ def test_overpass_import_with_bbox(page, live_server, tilelayer, settings):
|
|
|
579
579
|
)
|
|
580
580
|
|
|
581
581
|
|
|
582
|
+
def test_overpass_import_retains_boundary(page, live_server, tilelayer, settings):
|
|
583
|
+
settings.UMAP_IMPORTERS = {
|
|
584
|
+
"overpass": {
|
|
585
|
+
"url": "https://my.overpass.io/interpreter",
|
|
586
|
+
"searchUrl": "https://foobar.io/api?q={q}",
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
def handle(route):
|
|
591
|
+
route.fulfill(
|
|
592
|
+
json={
|
|
593
|
+
"features": [
|
|
594
|
+
{
|
|
595
|
+
"geometry": {
|
|
596
|
+
"coordinates": [3.2394035, 48.4149956],
|
|
597
|
+
"type": "Point",
|
|
598
|
+
},
|
|
599
|
+
"type": "Feature",
|
|
600
|
+
"properties": {
|
|
601
|
+
"osm_type": "R",
|
|
602
|
+
"osm_id": 1393025,
|
|
603
|
+
"extent": [3.2290211, 48.4268302, 3.2623032, 48.4041636],
|
|
604
|
+
"country": "France",
|
|
605
|
+
"osm_key": "place",
|
|
606
|
+
"countrycode": "FR",
|
|
607
|
+
"osm_value": "village",
|
|
608
|
+
"postcode": "77480",
|
|
609
|
+
"name": "Bray-sur-Seine",
|
|
610
|
+
"county": "Seine-et-Marne",
|
|
611
|
+
"state": "Île-de-France",
|
|
612
|
+
"type": "city",
|
|
613
|
+
},
|
|
614
|
+
}
|
|
615
|
+
],
|
|
616
|
+
"type": "FeatureCollection",
|
|
617
|
+
}
|
|
618
|
+
)
|
|
619
|
+
|
|
620
|
+
# Intercept the route
|
|
621
|
+
page.route(re.compile("https://foobar.io/api.*"), handle)
|
|
622
|
+
page.goto(f"{live_server.url}/map/new/")
|
|
623
|
+
page.get_by_role("link", name="Import data").click()
|
|
624
|
+
page.get_by_role("button", name="Overpass").click()
|
|
625
|
+
page.get_by_placeholder("amenity=drinking_water").fill("building")
|
|
626
|
+
page.get_by_placeholder("Type area name, or let empty").click()
|
|
627
|
+
page.get_by_placeholder("Type area name, or let empty").press_sequentially("bray")
|
|
628
|
+
page.get_by_text("Bray-sur-Seine, Seine-et-Marne, Île-de-France, France").click()
|
|
629
|
+
expect(page.locator("#area")).to_contain_text(
|
|
630
|
+
"Bray-sur-Seine, Seine-et-Marne, Île-de-France, France"
|
|
631
|
+
)
|
|
632
|
+
page.get_by_role("button", name="Choose this data").click()
|
|
633
|
+
expect(page.get_by_placeholder("Provide an URL here")).to_have_value(
|
|
634
|
+
"https://my.overpass.io/interpreter?data=[out:json];nwr[building](area:3601393025);out geom;"
|
|
635
|
+
)
|
|
636
|
+
page.get_by_role("button", name="Overpass").click()
|
|
637
|
+
expect(page.locator("#area")).to_contain_text(
|
|
638
|
+
"Bray-sur-Seine, Seine-et-Marne, Île-de-France, France"
|
|
639
|
+
)
|
|
640
|
+
|
|
641
|
+
|
|
582
642
|
def test_import_from_datasets(page, live_server, tilelayer, settings):
|
|
583
643
|
settings.UMAP_IMPORTERS = {
|
|
584
644
|
"datasets": {
|
|
@@ -33,6 +33,13 @@ def test_datalayers_control(map, live_server, datalayer, page):
|
|
|
33
33
|
page.goto(f"{live_server.url}{map.get_absolute_url()}?datalayersControl=expanded")
|
|
34
34
|
expect(control).to_be_visible()
|
|
35
35
|
expect(browser).to_be_visible()
|
|
36
|
+
# Should not override onLoadPanel
|
|
37
|
+
page.goto(
|
|
38
|
+
f"{live_server.url}{map.get_absolute_url()}?datalayersControl=expanded&onLoadPanel=caption"
|
|
39
|
+
)
|
|
40
|
+
expect(control).to_be_visible()
|
|
41
|
+
expect(browser).to_be_hidden()
|
|
42
|
+
expect(page.locator(".umap-caption")).to_be_visible()
|
|
36
43
|
|
|
37
44
|
|
|
38
45
|
def test_can_deactivate_wheel_from_query_string(map, live_server, page):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: umap-project
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.0b2
|
|
4
4
|
Summary: Create maps with OpenStreetMap layers in a minute and embed them in your site.
|
|
5
5
|
Author-email: Yohan Boniface <yb@enix.org>
|
|
6
6
|
Maintainer-email: David Larlet <david@larlet.fr>
|
|
@@ -28,23 +28,23 @@ Requires-Dist: requests==2.32.3
|
|
|
28
28
|
Requires-Dist: rjsmin==1.2.2
|
|
29
29
|
Requires-Dist: social-auth-app-django==5.4.2
|
|
30
30
|
Requires-Dist: social-auth-core==4.5.4
|
|
31
|
-
Requires-Dist: websockets==13.0
|
|
31
|
+
Requires-Dist: websockets==13.0.1
|
|
32
32
|
Provides-Extra: dev
|
|
33
|
-
Requires-Dist: djlint==1.
|
|
33
|
+
Requires-Dist: djlint==1.35.2; extra == 'dev'
|
|
34
34
|
Requires-Dist: hatch==1.12.0; extra == 'dev'
|
|
35
35
|
Requires-Dist: isort==5.13.2; extra == 'dev'
|
|
36
36
|
Requires-Dist: mkdocs-material==9.5.33; extra == 'dev'
|
|
37
37
|
Requires-Dist: mkdocs-static-i18n==1.2.3; extra == 'dev'
|
|
38
|
-
Requires-Dist: mkdocs==1.6.
|
|
38
|
+
Requires-Dist: mkdocs==1.6.1; extra == 'dev'
|
|
39
39
|
Requires-Dist: pymdown-extensions==10.9; extra == 'dev'
|
|
40
|
-
Requires-Dist: ruff==0.6.
|
|
40
|
+
Requires-Dist: ruff==0.6.3; extra == 'dev'
|
|
41
41
|
Requires-Dist: vermin==1.6.0; extra == 'dev'
|
|
42
42
|
Provides-Extra: docker
|
|
43
43
|
Requires-Dist: uwsgi==2.0.26; extra == 'docker'
|
|
44
44
|
Provides-Extra: test
|
|
45
45
|
Requires-Dist: factory-boy==3.3.1; extra == 'test'
|
|
46
46
|
Requires-Dist: playwright>=1.39; extra == 'test'
|
|
47
|
-
Requires-Dist: pytest-django==4.
|
|
47
|
+
Requires-Dist: pytest-django==4.9.0; extra == 'test'
|
|
48
48
|
Requires-Dist: pytest-playwright==0.5.1; extra == 'test'
|
|
49
49
|
Requires-Dist: pytest-xdist<4,>=3.5.0; extra == 'test'
|
|
50
50
|
Requires-Dist: pytest==8.3.2; extra == 'test'
|