umap-project 2.0.4__py3-none-any.whl → 2.1.1__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/fields.py +3 -1
- umap/locale/br/LC_MESSAGES/django.po +76 -71
- umap/locale/en/LC_MESSAGES/django.po +41 -41
- umap/locale/hu/LC_MESSAGES/django.po +42 -42
- umap/locale/it/LC_MESSAGES/django.po +64 -58
- umap/locale/ms/LC_MESSAGES/django.po +62 -57
- umap/migrations/0018_datalayer_uuid.py +62 -0
- umap/migrations/0019_migrate_internal_remote_datalayers.py +52 -0
- umap/models.py +20 -3
- umap/settings/base.py +1 -0
- umap/settings/dev.py +1 -0
- umap/static/umap/js/modules/browser.js +2 -2
- umap/static/umap/js/modules/global.js +14 -4
- umap/static/umap/js/modules/i18n.js +35 -0
- umap/static/umap/js/modules/leaflet-configure.js +7 -0
- umap/static/umap/js/modules/schema.js +388 -0
- umap/static/umap/js/modules/urls.js +17 -2
- umap/static/umap/js/modules/utils.js +24 -0
- umap/static/umap/js/umap.controls.js +9 -10
- umap/static/umap/js/umap.core.js +5 -5
- umap/static/umap/js/umap.features.js +23 -9
- umap/static/umap/js/umap.forms.js +49 -299
- umap/static/umap/js/umap.icon.js +2 -2
- umap/static/umap/js/umap.js +26 -129
- umap/static/umap/js/umap.layer.js +9 -9
- umap/static/umap/js/umap.popup.js +3 -0
- umap/static/umap/js/umap.share.js +1 -1
- umap/static/umap/locale/am_ET.json +229 -225
- umap/static/umap/locale/ar.json +229 -225
- umap/static/umap/locale/ast.json +229 -225
- umap/static/umap/locale/bg.json +229 -225
- umap/static/umap/locale/br.json +237 -233
- umap/static/umap/locale/ca.json +229 -225
- umap/static/umap/locale/cs_CZ.json +229 -225
- umap/static/umap/locale/da.json +229 -225
- umap/static/umap/locale/de.json +229 -225
- umap/static/umap/locale/el.json +229 -225
- umap/static/umap/locale/en.json +230 -233
- umap/static/umap/locale/en_US.json +229 -225
- umap/static/umap/locale/es.json +229 -225
- umap/static/umap/locale/et.json +229 -225
- umap/static/umap/locale/eu.json +226 -198
- umap/static/umap/locale/fa_IR.json +229 -225
- umap/static/umap/locale/fi.json +229 -225
- umap/static/umap/locale/fr.json +229 -232
- umap/static/umap/locale/gl.json +229 -225
- umap/static/umap/locale/he.json +229 -225
- umap/static/umap/locale/hr.json +229 -225
- umap/static/umap/locale/hu.json +229 -232
- umap/static/umap/locale/id.json +229 -225
- umap/static/umap/locale/is.json +229 -225
- umap/static/umap/locale/it.json +229 -232
- umap/static/umap/locale/ja.json +229 -225
- umap/static/umap/locale/ko.json +229 -225
- umap/static/umap/locale/lt.json +229 -225
- umap/static/umap/locale/ms.json +229 -232
- umap/static/umap/locale/nl.json +232 -228
- umap/static/umap/locale/no.json +229 -225
- umap/static/umap/locale/pl.json +229 -225
- umap/static/umap/locale/pl_PL.json +229 -225
- umap/static/umap/locale/pt.json +229 -225
- umap/static/umap/locale/pt_BR.json +229 -225
- umap/static/umap/locale/pt_PT.json +229 -225
- umap/static/umap/locale/ro.json +229 -225
- umap/static/umap/locale/ru.json +229 -225
- umap/static/umap/locale/sk_SK.json +229 -225
- umap/static/umap/locale/sl.json +229 -225
- umap/static/umap/locale/sr.json +229 -225
- umap/static/umap/locale/sv.json +229 -225
- umap/static/umap/locale/th_TH.json +229 -225
- umap/static/umap/locale/tr.json +229 -225
- umap/static/umap/locale/uk_UA.json +229 -225
- umap/static/umap/locale/vi.json +229 -225
- umap/static/umap/locale/vi_VN.json +229 -225
- umap/static/umap/locale/zh.json +229 -225
- umap/static/umap/locale/zh_CN.json +229 -225
- umap/static/umap/locale/zh_TW.Big5.json +229 -225
- umap/static/umap/locale/zh_TW.json +229 -232
- umap/static/umap/test/index.html +0 -2
- umap/static/umap/{test → unittests}/URLs.js +5 -0
- umap/static/umap/vendors/leaflet/leaflet-src.esm.js +7064 -7064
- umap/static/umap/vendors/photon/leaflet.photon.js +3 -0
- umap/templates/umap/js.html +8 -6
- umap/templatetags/umap_tags.py +3 -2
- umap/tests/integration/test_browser.py +40 -0
- umap/tests/integration/test_collaborative_editing.py +72 -3
- umap/tests/integration/test_export_map.py +226 -9
- umap/tests/integration/test_features_id_generation.py +51 -0
- umap/tests/integration/test_owned_map.py +14 -1
- umap/tests/integration/test_statics.py +3 -3
- umap/tests/integration/test_tilelayer.py +3 -3
- umap/tests/settings.py +3 -3
- umap/tests/test_datalayer_views.py +77 -20
- umap/tests/test_map_views.py +20 -0
- umap/tests/test_merge_features.py +25 -5
- umap/urls.py +12 -12
- umap/utils.py +7 -0
- umap/views.py +58 -49
- umap/wsgi.py +1 -0
- {umap_project-2.0.4.dist-info → umap_project-2.1.1.dist-info}/METADATA +9 -9
- {umap_project-2.0.4.dist-info → umap_project-2.1.1.dist-info}/RECORD +105 -99
- umap/static/umap/test/Map.Export.js +0 -106
- {umap_project-2.0.4.dist-info → umap_project-2.1.1.dist-info}/WHEEL +0 -0
- {umap_project-2.0.4.dist-info → umap_project-2.1.1.dist-info}/entry_points.txt +0 -0
- {umap_project-2.0.4.dist-info → umap_project-2.1.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -677,7 +677,7 @@ U.DataLayer = L.Evented.extend({
|
|
|
677
677
|
this._loading = true
|
|
678
678
|
const [geojson, response, error] = await this.map.server.get(this._dataUrl())
|
|
679
679
|
if (!error) {
|
|
680
|
-
this.
|
|
680
|
+
this._reference_version = response.headers.get('X-Datalayer-Version')
|
|
681
681
|
// FIXME: for now this property is set dynamically from backend
|
|
682
682
|
// And thus it's not in the geojson file in the server
|
|
683
683
|
// So do not let all options to be reset
|
|
@@ -688,7 +688,7 @@ U.DataLayer = L.Evented.extend({
|
|
|
688
688
|
}
|
|
689
689
|
// In case of maps pre 1.0 still around
|
|
690
690
|
if (geojson._storage) geojson._storage.editMode = this.options.editMode
|
|
691
|
-
this.fromUmapGeoJSON(geojson)
|
|
691
|
+
await this.fromUmapGeoJSON(geojson)
|
|
692
692
|
this.backupOptions()
|
|
693
693
|
this.fire('loaded')
|
|
694
694
|
this._loading = false
|
|
@@ -703,10 +703,10 @@ U.DataLayer = L.Evented.extend({
|
|
|
703
703
|
this.fire('datachanged')
|
|
704
704
|
},
|
|
705
705
|
|
|
706
|
-
fromUmapGeoJSON: function (geojson) {
|
|
706
|
+
fromUmapGeoJSON: async function (geojson) {
|
|
707
707
|
if (geojson._storage) geojson._umap_options = geojson._storage // Retrocompat
|
|
708
708
|
if (geojson._umap_options) this.setOptions(geojson._umap_options)
|
|
709
|
-
if (this.isRemoteLayer()) this.fetchRemoteData()
|
|
709
|
+
if (this.isRemoteLayer()) await this.fetchRemoteData()
|
|
710
710
|
else this.fromGeoJSON(geojson)
|
|
711
711
|
this._loaded = true
|
|
712
712
|
},
|
|
@@ -1459,7 +1459,7 @@ U.DataLayer = L.Evented.extend({
|
|
|
1459
1459
|
if (!this.isVisible()) return
|
|
1460
1460
|
const bounds = this.layer.getBounds()
|
|
1461
1461
|
if (bounds.isValid()) {
|
|
1462
|
-
const options = {maxZoom: this.getOption(
|
|
1462
|
+
const options = { maxZoom: this.getOption('zoomTo') }
|
|
1463
1463
|
this.map.fitBounds(bounds, options)
|
|
1464
1464
|
}
|
|
1465
1465
|
},
|
|
@@ -1577,8 +1577,8 @@ U.DataLayer = L.Evented.extend({
|
|
|
1577
1577
|
map_id: this.map.options.umap_id,
|
|
1578
1578
|
pk: this.umap_id,
|
|
1579
1579
|
})
|
|
1580
|
-
const headers = this.
|
|
1581
|
-
? { '
|
|
1580
|
+
const headers = this._reference_version
|
|
1581
|
+
? { 'X-Datalayer-Reference': this._reference_version }
|
|
1582
1582
|
: {}
|
|
1583
1583
|
await this._trySave(saveUrl, headers, formData)
|
|
1584
1584
|
this._geojson = geojson
|
|
@@ -1596,7 +1596,7 @@ U.DataLayer = L.Evented.extend({
|
|
|
1596
1596
|
label: L._('Save anyway'),
|
|
1597
1597
|
callback: async () => {
|
|
1598
1598
|
// Save again,
|
|
1599
|
-
// but do not pass
|
|
1599
|
+
// but do not pass the reference version this time
|
|
1600
1600
|
await this._trySave(url, {}, formData)
|
|
1601
1601
|
},
|
|
1602
1602
|
},
|
|
@@ -1619,7 +1619,7 @@ U.DataLayer = L.Evented.extend({
|
|
|
1619
1619
|
this.fromGeoJSON(data.geojson)
|
|
1620
1620
|
delete data.geojson
|
|
1621
1621
|
}
|
|
1622
|
-
this.
|
|
1622
|
+
this._reference_version = response.headers.get('X-Datalayer-Version')
|
|
1623
1623
|
this.setUmapId(data.id)
|
|
1624
1624
|
this.updateOptions(data)
|
|
1625
1625
|
this.backupOptions()
|
|
@@ -59,6 +59,9 @@ U.Popup.Panel = U.Popup.extend({
|
|
|
59
59
|
L.DomUtil.create('i', 'umap-icon-16 umap-list', button)
|
|
60
60
|
const label = L.DomUtil.create('span', '', button)
|
|
61
61
|
label.textContent = label.title = L._('See all')
|
|
62
|
+
// Fixme: remove me when this is merged and released
|
|
63
|
+
// https://github.com/Leaflet/Leaflet/pull/9052
|
|
64
|
+
L.DomEvent.disableClickPropagation(button)
|
|
62
65
|
L.DomEvent.on(button, 'click', this.feature.map.openBrowser, this.feature.map)
|
|
63
66
|
return button
|
|
64
67
|
},
|
|
@@ -215,7 +215,7 @@ U.IframeExporter = L.Evented.extend({
|
|
|
215
215
|
this.map = map
|
|
216
216
|
this.baseUrl = L.Util.getBaseUrl()
|
|
217
217
|
// Use map default, not generic default
|
|
218
|
-
this.queryString.onLoadPanel = this.map.
|
|
218
|
+
this.queryString.onLoadPanel = this.map.getOption('onLoadPanel')
|
|
219
219
|
},
|
|
220
220
|
|
|
221
221
|
getMap: function () {
|