umap-project 3.3.5__py3-none-any.whl → 3.3.6__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 CHANGED
@@ -1 +1 @@
1
- VERSION = "3.3.5"
1
+ VERSION = "3.3.6"
@@ -252,7 +252,7 @@ export default class Browser {
252
252
  if (datalayer.isVisible()) allHidden = false
253
253
  })
254
254
  this._umap.datalayers.browsable().map((datalayer) => {
255
- datalayer._forcedVisibility = true
255
+ datalayer.autoLoaded = false
256
256
  if (allHidden) {
257
257
  datalayer.show()
258
258
  } else {
@@ -225,17 +225,27 @@ export class DataLayer {
225
225
  }
226
226
 
227
227
  showAtLoad() {
228
- return this.autoLoaded() && this.showAtZoom()
228
+ return this.autoLoaded && this.showAtZoom()
229
229
  }
230
230
 
231
- autoLoaded() {
232
- if (!this._umap.datalayersFromQueryString) return this.properties.displayOnLoad
233
- const datalayerIds = this._umap.datalayersFromQueryString
234
- let loadMe = datalayerIds.includes(this.id.toString())
235
- if (this.properties.old_id) {
236
- loadMe = loadMe || datalayerIds.includes(this.properties.old_id.toString())
231
+ get autoLoaded() {
232
+ if (this._autoLoaded === undefined) {
233
+ if (this._umap.datalayersFromQueryString) {
234
+ const datalayerIds = this._umap.datalayersFromQueryString
235
+ this._autoLoaded = datalayerIds.includes(this.id.toString())
236
+ if (this.properties.old_id) {
237
+ this._autoLoaded =
238
+ this._autoLoaded || datalayerIds.includes(this.properties.old_id.toString())
239
+ }
240
+ } else {
241
+ this._autoLoaded = this.properties.displayOnLoad
242
+ }
237
243
  }
238
- return loadMe
244
+ return this._autoLoaded
245
+ }
246
+
247
+ set autoLoaded(value) {
248
+ this._autoLoaded = value
239
249
  }
240
250
 
241
251
  insertBefore(other) {
@@ -1213,7 +1223,7 @@ export class DataLayer {
1213
1223
  // From now on, do not try to how/hide
1214
1224
  // automatically this layer, as user
1215
1225
  // has taken control on this.
1216
- this._forcedVisibility = true
1226
+ this.autoLoaded = false
1217
1227
  let display = force
1218
1228
  if (force === undefined) {
1219
1229
  if (!this.isVisible()) display = true
@@ -59,6 +59,7 @@ export class FeatureManager extends Map {
59
59
  if (this.has(feature.id)) {
60
60
  console.error('Duplicate id', feature, this.get(feature.id))
61
61
  feature.id = Utils.generateId()
62
+ feature.datalayer._found_duplicate_id = true
62
63
  }
63
64
  this.set(feature.id, feature)
64
65
  }
@@ -53,7 +53,7 @@ export const LayerMixin = {
53
53
  },
54
54
 
55
55
  onZoomEnd() {
56
- if (this.datalayer._forcedVisibility) return
56
+ if (!this.datalayer.autoLoaded) return
57
57
  if (!this.datalayer.showAtZoom() && this.datalayer.isVisible()) {
58
58
  this.datalayer.hide()
59
59
  }
@@ -1269,6 +1269,18 @@ export default class Umap {
1269
1269
  this.drop.enable()
1270
1270
  this.fire('edit:enabled')
1271
1271
  this.initSyncEngine()
1272
+ this.datalayers.active().forEach((datalayer) => {
1273
+ if (!datalayer.isReadOnly() && datalayer._found_duplicate_id) {
1274
+ datalayer._found_duplicate_id = false
1275
+ // Force user to resave those datalayers
1276
+ datalayer.sync.update(
1277
+ 'properties.name',
1278
+ datalayer.properties.name,
1279
+ datalayer.properties.name
1280
+ )
1281
+ Alert.info(translate('Layer has been migrated, please save the map.'))
1282
+ }
1283
+ })
1272
1284
  }
1273
1285
 
1274
1286
  disableEdit() {
@@ -595,7 +595,6 @@ const locale = {
595
595
  "Transform to regular line": "轉換為普通線條",
596
596
  "Transform to route": "轉換為路線",
597
597
  "Restore route": "恢復路線",
598
- "Compute elevation": "計畫等高線",
599
598
  "Profile": "設定檔案",
600
599
  "Compute elevations": "計算等高線。",
601
600
  "Route preference": "路線偏好設定",
@@ -615,7 +614,8 @@ const locale = {
615
614
  "Loss:": "減少:",
616
615
  "Altitude:": "海拔:",
617
616
  "Right-click to edit": "按右鍵來編輯",
618
- "Draw along routes": "沿著路線繪製"
617
+ "Draw along routes": "沿著路線繪製",
618
+ "Skipping invalid geometry": "略過無效的地理空間"
619
619
  }
620
620
  L.registerLocale("zh_TW", locale)
621
621
  L.setLocale("zh_TW")
@@ -595,7 +595,6 @@
595
595
  "Transform to regular line": "轉換為普通線條",
596
596
  "Transform to route": "轉換為路線",
597
597
  "Restore route": "恢復路線",
598
- "Compute elevation": "計畫等高線",
599
598
  "Profile": "設定檔案",
600
599
  "Compute elevations": "計算等高線。",
601
600
  "Route preference": "路線偏好設定",
@@ -615,5 +614,6 @@
615
614
  "Loss:": "減少:",
616
615
  "Altitude:": "海拔:",
617
616
  "Right-click to edit": "按右鍵來編輯",
618
- "Draw along routes": "沿著路線繪製"
617
+ "Draw along routes": "沿著路線繪製",
618
+ "Skipping invalid geometry": "略過無效的地理空間"
619
619
  }
@@ -1,8 +1,6 @@
1
- import json
2
1
  import re
3
2
 
4
3
  import pytest
5
- from django.core.files.base import ContentFile
6
4
  from playwright.sync_api import expect
7
5
 
8
6
  from ..base import DataLayerFactory
@@ -10,17 +8,9 @@ from ..base import DataLayerFactory
10
8
  pytestmark = pytest.mark.django_db
11
9
 
12
10
 
13
- def set_options(datalayer, **options):
14
- # For now we need to change both the DB and the FS…
15
- datalayer.settings.update(options)
16
- data = json.load(datalayer.geojson.file)
17
- data["_umap_options"].update(**options)
18
- datalayer.geojson = ContentFile(json.dumps(data), "foo.json")
19
- datalayer.save()
20
-
21
-
22
11
  def test_honour_displayOnLoad_false(map, live_server, datalayer, page):
23
- set_options(datalayer, displayOnLoad=False)
12
+ datalayer.settings.update(displayOnLoad=False)
13
+ datalayer.save()
24
14
  page.goto(f"{live_server.url}{map.get_absolute_url()}?onLoadPanel=datalayers")
25
15
  expect(page.locator(".leaflet-marker-icon")).to_be_hidden()
26
16
  layers = page.locator(".umap-browser .datalayer")
@@ -30,14 +20,17 @@ def test_honour_displayOnLoad_false(map, live_server, datalayer, page):
30
20
  expect(layers_off).to_have_count(1)
31
21
  page.get_by_role("button", name="Open browser").click()
32
22
  page.get_by_label("Zoom in").click()
23
+ page.wait_for_timeout(300)
33
24
  expect(markers).to_be_hidden()
34
- page.get_by_title("Show/hide layer").click()
25
+ with page.expect_response(re.compile(rf".*/datalayer/{map.pk}/{datalayer.pk}/.*")):
26
+ page.get_by_title("Show/hide layer").click()
35
27
  expect(layers_off).to_have_count(0)
36
28
  expect(markers).to_be_visible()
37
29
 
38
30
 
39
31
  def test_should_honour_fromZoom(live_server, map, datalayer, page):
40
- set_options(datalayer, displayOnLoad=True, fromZoom=6)
32
+ datalayer.settings.update(displayOnLoad=True, fromZoom=6)
33
+ datalayer.save()
41
34
  page.goto(f"{live_server.url}{map.get_absolute_url()}#5/48.55/14.68")
42
35
  markers = page.locator(".leaflet-marker-icon")
43
36
  expect(markers).to_be_hidden()
@@ -55,7 +48,8 @@ def test_should_honour_fromZoom(live_server, map, datalayer, page):
55
48
 
56
49
 
57
50
  def test_should_honour_toZoom(live_server, map, datalayer, page, new_page):
58
- set_options(datalayer, displayOnLoad=True, toZoom=6)
51
+ datalayer.settings.update(displayOnLoad=True, toZoom=6)
52
+ datalayer.save()
59
53
  # Loading at zoom 7 should not show the marker
60
54
  page.goto(f"{live_server.url}{map.get_absolute_url()}#7/48.55/14.68")
61
55
  markers = page.locator(".leaflet-marker-icon")
@@ -123,7 +117,6 @@ def test_datalayers_in_query_string(live_server, datalayer, map, page):
123
117
  map.settings["properties"]["onLoadPanel"] = "datalayers"
124
118
  map.save()
125
119
  with_old_id = DataLayerFactory(old_id=134, map=map, name="with old id")
126
- set_options(with_old_id, name="with old id")
127
120
  visible = page.locator(".umap-browser .datalayer:not(.off) .datalayer-name")
128
121
  hidden = page.locator(".umap-browser .datalayer.off .datalayer-name")
129
122
  page.goto(f"{live_server.url}{map.get_absolute_url()}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: umap-project
3
- Version: 3.3.5
3
+ Version: 3.3.6
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>
@@ -1,4 +1,4 @@
1
- umap/__init__.py,sha256=q-nEmrwgsCPkWnS7hzZUeU8TT3ysppos2-fV16jW2tg,18
1
+ umap/__init__.py,sha256=dXcxAQVoifk8mnJp_WE7_cuoi0cl0OiyMlYF2X9SLWI,18
2
2
  umap/admin.py,sha256=YlK4CgEWb2eFYRKiklsKouxeiQ8z_b-H2Fv2XCaiGFQ,3014
3
3
  umap/apps.py,sha256=5ssKqPUuNJlapaBmr4LY_HDb7J1NFCT3wzythxQOOfs,109
4
4
  umap/asgi.py,sha256=sJkGqDLgMoPkq2nMRyRE_Hz3ZLJm1X5lgXiQJu6rYt0,660
@@ -238,7 +238,7 @@ umap/static/umap/js/components/modal.js,sha256=ugaibc2n5Pftocs1crN6zaPRJztSQm1at
238
238
  umap/static/umap/js/components/alerts/alert.css,sha256=fSmbDDjXjEYLfgnEAVDhyqWiBOUy2YhVRy0_den-7Dk,4930
239
239
  umap/static/umap/js/components/alerts/alert.js,sha256=_BcG9WluOkJTj_v795c0PIXvv5EZQs0uO5-rUhcwEco,4482
240
240
  umap/static/umap/js/modules/autocomplete.js,sha256=CLw4KP_Mmf5s55OWimK3Xw7GkwDLtuCqeEI2WqPSsOU,8729
241
- umap/static/umap/js/modules/browser.js,sha256=6WVBox4gLoqPasBzkh7dULz74AKKDQ-5Cp-b0-DbVHY,9753
241
+ umap/static/umap/js/modules/browser.js,sha256=9uug5dbf0HCsg90xUAbva-_dwW_6znFFDUbaPDoUflc,9747
242
242
  umap/static/umap/js/modules/caption.js,sha256=glOSK2HIENR-tPO4iDWOvPRX8xgeWloKAbntRpYH1qc,5813
243
243
  umap/static/umap/js/modules/dompurify.js,sha256=SOmoM-pTgYCKCKXFo6-znemWPLiLsFgR4lxM_moWaA8,328
244
244
  umap/static/umap/js/modules/drop.js,sha256=aHuz_sDgWAqDEH49OWNhnnyFvGLDMCoeeo5xaBLZwAg,1431
@@ -249,7 +249,7 @@ umap/static/umap/js/modules/help.js,sha256=fnkc6ugsYI1TeermtqiJUYJFm9P1pcC-CoDuJ
249
249
  umap/static/umap/js/modules/i18n.js,sha256=dEpjsWoEZa-Tr5_MDO0tuWkt7kLL3crxXqhttyP-khU,1387
250
250
  umap/static/umap/js/modules/importer.js,sha256=UEEUodCoWmrhq1ActNusz4jU6n6R3DRuhPVd3_oSF00,11458
251
251
  umap/static/umap/js/modules/leaflet-configure.js,sha256=P3aD8iNGxuVNv-xW4Di4txAjNmnlpKtCCzDvPaKEdQ8,243
252
- umap/static/umap/js/modules/managers.js,sha256=hRj3lNFnXKhxBm8uIUpR15bYqlog_i8qeIP9879lDdc,2462
252
+ umap/static/umap/js/modules/managers.js,sha256=7MCeiB5INYN1XTlksZSPDi2VwVBrr2tzzGUs4ePpLso,2513
253
253
  umap/static/umap/js/modules/orderable.js,sha256=zDtcElZ_MVPoGba8Iv9bxOzk4vuN7C-5XVl4UomDYHE,2521
254
254
  umap/static/umap/js/modules/permissions.js,sha256=t-kZvgGIGva8MNMu9Ydr-U9KVrdKUQery_BqniFWut0,8734
255
255
  umap/static/umap/js/modules/printer.js,sha256=fvb44tLBiYR7TyBdXJdroYsjQOrnbzw7-6F0dBCUEGg,3607
@@ -260,11 +260,11 @@ umap/static/umap/js/modules/share.js,sha256=xgojG1xHDcbgJZlUd-oP7VFrbGDpl2k1LmTl
260
260
  umap/static/umap/js/modules/slideshow.js,sha256=7tmW32iuEwLXTY_4A_DmiRMjdDr5luhpJSdmbz2SXPc,3608
261
261
  umap/static/umap/js/modules/tableeditor.js,sha256=NbUgJul5_fFhikWyXIZ1nOEp9hSVKO61i2y52noGISc,8537
262
262
  umap/static/umap/js/modules/templates.js,sha256=41fliDQLrVo-WosiyLkxpRry3WXpCVz4IW7kYn0AMfQ,4415
263
- umap/static/umap/js/modules/umap.js,sha256=_9A2AjVY4vkeprghMtEmL0J6XmOnMUyeGjU14byK1bM,54329
263
+ umap/static/umap/js/modules/umap.js,sha256=GD3vS_MGMqH3I0SIgSNIDgdCKKJJ3sLjMqNuQYcVG48,54785
264
264
  umap/static/umap/js/modules/urls.js,sha256=76cFqycj2O8huuoYYBvxnVt2Fc2UDbgrRsiv6lQmcSY,890
265
265
  umap/static/umap/js/modules/utils.js,sha256=rT_RILODFUWAvvgjFpT5TtNbu8A9jzn0mlkpHEB8QqM,16044
266
266
  umap/static/umap/js/modules/data/features.js,sha256=goCRmPzAx47VE_A-WB_2xJbopid4UpW0jLOLibZ_aUk,38334
267
- umap/static/umap/js/modules/data/layer.js,sha256=dWj9wA8xIZei46jLqEiokRlK-PQ0v3GLGZgC-5fqjcw,44044
267
+ umap/static/umap/js/modules/data/layer.js,sha256=E0nDlWk7ovEA5PdV58Pv4Z8CUPlBkLImWfn42m_kIXk,44262
268
268
  umap/static/umap/js/modules/form/builder.js,sha256=akRoO8VpKXqWr3LO4Y_B1zr9gXJL2S5RCJqRDREweq8,6452
269
269
  umap/static/umap/js/modules/form/fields.js,sha256=yUEUPDHF3tgnpDv7UdfMXHsabCMaGsUDXQq2-Qe1krg,36152
270
270
  umap/static/umap/js/modules/importers/banfr.js,sha256=TBwL3GQJdzYtaDtxeHxyPQ7Ycy5zTaQyvzXa55X7n2I,2932
@@ -281,7 +281,7 @@ umap/static/umap/js/modules/rendering/map.js,sha256=frdccjuaoK9-PMCNAGGk0y_rG5DV
281
281
  umap/static/umap/js/modules/rendering/popup.js,sha256=OtQYpjhWCoW20XBFeeSKCXMqN-szohaX1TKWhPc9eBo,2577
282
282
  umap/static/umap/js/modules/rendering/template.js,sha256=n74YzbZOS_4CeK3-Jn7NXbkzqsh4zjCbEX9w15QxKu0,11468
283
283
  umap/static/umap/js/modules/rendering/ui.js,sha256=3Uow0IHOHrPW7LJCa00kjCyZQFdRq5hViAOhoBuipHc,17617
284
- umap/static/umap/js/modules/rendering/layers/base.js,sha256=Prgd0xG2dp_ecITebKhckdrlSZOwxDYrcuwkJ6Vb5xk,2489
284
+ umap/static/umap/js/modules/rendering/layers/base.js,sha256=k_TlwHiGc16CFvE41-OmgjTFa99LbkG0IUKCUoZaruk,2483
285
285
  umap/static/umap/js/modules/rendering/layers/classified.js,sha256=CLktnkjf5_6CzkKVyZcx5wAKvhsRp4pRpCIBauwKeO0,15068
286
286
  umap/static/umap/js/modules/rendering/layers/cluster.js,sha256=yRv9pXJtYQGimRL6hJXbE9xT1xUmQ4qy2Ja8GjFC5pE,8054
287
287
  umap/static/umap/js/modules/rendering/layers/heat.js,sha256=K_LsxnfpGImy2HlneV5nK0cBu1FxDmPNxR5VmsV4LaM,4975
@@ -393,8 +393,8 @@ umap/static/umap/locale/zh.js,sha256=Uzjdp0Oe4QXCewo_YtDuxbC8VTK7RqeBEmXwulGvV48
393
393
  umap/static/umap/locale/zh.json,sha256=Z6IaQd0Sy1MjmdJP2BfQ3ka7CcWpY37h3ytUPniYka8,34646
394
394
  umap/static/umap/locale/zh_CN.json,sha256=aGzn8kP65zQ4c9Z4Cw95XtJge94LgVeC2w-72mnODaU,34868
395
395
  umap/static/umap/locale/zh_TW.Big5.json,sha256=aGzn8kP65zQ4c9Z4Cw95XtJge94LgVeC2w-72mnODaU,34868
396
- umap/static/umap/locale/zh_TW.js,sha256=thikXtB9stolTrcHNPg6qhwnXEoSeQ6Gz11OU0TQk30,34391
397
- umap/static/umap/locale/zh_TW.json,sha256=-B-WKSrb1Nf-pBOnhQ0fsnp5p7B-B80COp6L8yN7cNI,34320
396
+ umap/static/umap/locale/zh_TW.js,sha256=MTmNcH8LLqEcnKLsormJR5IetMiyHUjE7Yg8pm8FEm0,34411
397
+ umap/static/umap/locale/zh_TW.json,sha256=0aGY_OSMS6F37hscpK8EPE1KrbH7X3FpKw8tBBkZerI,34340
398
398
  umap/static/umap/unittests/URLs.js,sha256=wF0hfRX3NqwFAe31QGeKFwavUpNP2T8pHwXBlcpiwNo,2070
399
399
  umap/static/umap/unittests/hlc.js,sha256=GvpBaBSgfMs0Zym0_zOs2QldUOcbFNVIKweBhuwM_QI,5294
400
400
  umap/static/umap/unittests/sync.js,sha256=SRzK5N7o7iZodye53evBTZZjXG1mMm6dguV_Iyh69XQ,11096
@@ -566,7 +566,7 @@ umap/tests/integration/test_circles_layer.py,sha256=PjYGmCvAd9qDnldnbiw6nomJs1Yg
566
566
  umap/tests/integration/test_cluster.py,sha256=Ltkk0KUeUtU59lbNwZeoTyaGSYWto5k-rS6_SZ_QnGc,5457
567
567
  umap/tests/integration/test_conditional_rules.py,sha256=D1vs3-fcxmLvlKK17Xf0i6dDkOK1UQWqBBFKodxfm0c,15657
568
568
  umap/tests/integration/test_dashboard.py,sha256=LClLBc8lgDM1-NGhkvUSUMLmMuKt3sR1ubt2Eo-Iq7A,1550
569
- umap/tests/integration/test_datalayer.py,sha256=CNxT97ZVB-pPjgXh77i3n3hJKgi4Sm0rYh5SbHB9ZWE,5752
569
+ umap/tests/integration/test_datalayer.py,sha256=tjerFu7npF3bQ8L8VOHWjdFJrKU22rGjEqSv2-fj-bY,5525
570
570
  umap/tests/integration/test_draw_polygon.py,sha256=WNKXcxMqlTmwI0Yro_PbdpTi-M4gZNeIVa-fSXpS6rE,25298
571
571
  umap/tests/integration/test_draw_polyline.py,sha256=RgivhjEzjHVE6niPG5uAxJjtmEVD11ftuU4Tb47bXh8,14717
572
572
  umap/tests/integration/test_draw_route.py,sha256=hxa_uVqHLLEbbSsEIMsPsq5fMCNoKWY7cRCpMwqudmM,7276
@@ -602,8 +602,8 @@ umap/tests/integration/test_view_marker.py,sha256=NFCwNez__E_WsE1DuW5RuB0HVKDP4C
602
602
  umap/tests/integration/test_view_polygon.py,sha256=NMJC6Nt9VpQ8FIU9Pqq2OspHv49xsWlsoXCr8iBa0VA,2060
603
603
  umap/tests/integration/test_view_polyline.py,sha256=aJoXKmLhJaN0yhPdDCVskZNGx3q3mLDkjVPhZ30cadA,13959
604
604
  umap/tests/integration/test_websocket_sync.py,sha256=n3Nd9cDdYMfJjMIkGUidqeceAW2loM8nx17Bh57m0fo,28341
605
- umap_project-3.3.5.dist-info/METADATA,sha256=EP8EZHDKLEFQpRm87ui9IAS3A7cDjL1fk6kAWlO6oRM,5747
606
- umap_project-3.3.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
607
- umap_project-3.3.5.dist-info/entry_points.txt,sha256=gz-KDQfEsMLBae8ABOD3foJsCYGPW1tA4Y394R_1RW8,39
608
- umap_project-3.3.5.dist-info/licenses/LICENSE,sha256=kQtrtRKgiPhcl7aO0-lmvbrNAXu7WHyiXvPrUk-TD2Q,820
609
- umap_project-3.3.5.dist-info/RECORD,,
605
+ umap_project-3.3.6.dist-info/METADATA,sha256=I6p1JERct-0XUpF8rTBHHFqaC4bTXvZdsIKlOm1tbGY,5747
606
+ umap_project-3.3.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
607
+ umap_project-3.3.6.dist-info/entry_points.txt,sha256=gz-KDQfEsMLBae8ABOD3foJsCYGPW1tA4Y394R_1RW8,39
608
+ umap_project-3.3.6.dist-info/licenses/LICENSE,sha256=kQtrtRKgiPhcl7aO0-lmvbrNAXu7WHyiXvPrUk-TD2Q,820
609
+ umap_project-3.3.6.dist-info/RECORD,,