umap-project 2.4.1__py3-none-any.whl → 2.4.2__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.
Potentially problematic release.
This version of umap-project might be problematic. Click here for more details.
- umap/__init__.py +1 -1
- umap/locale/el/LC_MESSAGES/django.po +145 -90
- umap/locale/en/LC_MESSAGES/django.po +13 -13
- umap/locale/eu/LC_MESSAGES/django.po +145 -89
- umap/static/umap/base.css +1 -1
- umap/static/umap/content.css +2 -2
- umap/static/umap/css/dialog.css +1 -1
- umap/static/umap/css/importers.css +2 -0
- umap/static/umap/css/panel.css +2 -2
- umap/static/umap/css/tooltip.css +1 -1
- umap/static/umap/js/components/alerts/alert.css +1 -1
- umap/static/umap/js/components/alerts/alert.js +1 -1
- umap/static/umap/js/modules/autocomplete.js +4 -4
- umap/static/umap/js/modules/browser.js +6 -6
- umap/static/umap/js/modules/caption.js +4 -4
- umap/static/umap/js/modules/dompurify.js +2 -3
- umap/static/umap/js/modules/facets.js +16 -10
- umap/static/umap/js/modules/global.js +16 -16
- umap/static/umap/js/modules/help.js +2 -2
- umap/static/umap/js/modules/importer.js +6 -6
- umap/static/umap/js/modules/importers/geodatamine.js +4 -4
- umap/static/umap/js/modules/importers/overpass.js +2 -2
- umap/static/umap/js/modules/orderable.js +2 -2
- umap/static/umap/js/modules/request.js +1 -1
- umap/static/umap/js/modules/rules.js +13 -10
- umap/static/umap/js/modules/sync/engine.js +3 -3
- umap/static/umap/js/modules/sync/updaters.js +10 -11
- umap/static/umap/js/modules/sync/websocket.js +1 -1
- umap/static/umap/js/modules/ui/dialog.js +1 -1
- umap/static/umap/js/modules/ui/panel.js +1 -1
- umap/static/umap/js/modules/ui/tooltip.js +6 -6
- umap/static/umap/js/modules/urls.js +1 -2
- umap/static/umap/js/modules/utils.js +16 -16
- umap/static/umap/js/umap.controls.js +26 -28
- umap/static/umap/js/umap.core.js +19 -15
- umap/static/umap/js/umap.datalayer.permissions.js +15 -18
- umap/static/umap/js/umap.features.js +91 -117
- umap/static/umap/js/umap.forms.js +46 -74
- umap/static/umap/js/umap.icon.js +17 -22
- umap/static/umap/js/umap.js +79 -83
- umap/static/umap/js/umap.layer.js +151 -169
- umap/static/umap/js/umap.permissions.js +6 -9
- umap/static/umap/js/umap.popup.js +19 -19
- umap/static/umap/js/umap.share.js +9 -15
- umap/static/umap/js/umap.slideshow.js +12 -14
- umap/static/umap/js/umap.tableeditor.js +5 -5
- umap/static/umap/locale/am_ET.json +5 -2
- umap/static/umap/locale/ar.json +5 -2
- umap/static/umap/locale/ast.json +5 -2
- umap/static/umap/locale/bg.json +5 -2
- umap/static/umap/locale/br.json +5 -2
- umap/static/umap/locale/ca.json +5 -2
- umap/static/umap/locale/cs_CZ.json +5 -2
- umap/static/umap/locale/da.json +5 -2
- umap/static/umap/locale/de.json +5 -2
- umap/static/umap/locale/el.json +10 -7
- umap/static/umap/locale/en.json +4 -2
- umap/static/umap/locale/en_US.json +5 -2
- umap/static/umap/locale/es.json +4 -2
- umap/static/umap/locale/et.json +5 -2
- umap/static/umap/locale/fa_IR.json +5 -2
- umap/static/umap/locale/fi.json +5 -2
- umap/static/umap/locale/fr.json +4 -2
- umap/static/umap/locale/gl.json +5 -2
- umap/static/umap/locale/he.json +5 -2
- umap/static/umap/locale/hr.json +5 -2
- umap/static/umap/locale/hu.json +5 -2
- umap/static/umap/locale/id.json +5 -2
- umap/static/umap/locale/is.json +5 -2
- umap/static/umap/locale/it.json +5 -2
- umap/static/umap/locale/ja.json +5 -2
- umap/static/umap/locale/ko.json +5 -2
- umap/static/umap/locale/lt.json +5 -2
- umap/static/umap/locale/ms.json +5 -2
- umap/static/umap/locale/nl.json +5 -2
- umap/static/umap/locale/no.json +5 -2
- umap/static/umap/locale/pl.json +5 -2
- umap/static/umap/locale/pl_PL.json +5 -2
- umap/static/umap/locale/pt.json +4 -2
- umap/static/umap/locale/pt_BR.json +5 -2
- umap/static/umap/locale/pt_PT.json +5 -2
- umap/static/umap/locale/ro.json +5 -2
- umap/static/umap/locale/ru.json +5 -2
- umap/static/umap/locale/sk_SK.json +5 -2
- umap/static/umap/locale/sl.json +5 -2
- umap/static/umap/locale/sr.json +5 -2
- umap/static/umap/locale/sv.json +5 -2
- umap/static/umap/locale/th_TH.json +5 -2
- umap/static/umap/locale/tr.json +5 -2
- umap/static/umap/locale/uk_UA.json +5 -2
- umap/static/umap/locale/vi.json +5 -2
- umap/static/umap/locale/vi_VN.json +5 -2
- umap/static/umap/locale/zh.json +5 -2
- umap/static/umap/locale/zh_CN.json +5 -2
- umap/static/umap/locale/zh_TW.Big5.json +5 -2
- umap/static/umap/locale/zh_TW.json +5 -2
- umap/static/umap/map.css +8 -9
- umap/static/umap/vars.css +10 -0
- umap/static/umap/vendors/dompurify/purify.es.js +5 -59
- umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -1
- umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +2 -2
- umap/storage.py +1 -1
- umap/tests/integration/test_map_preview.py +36 -2
- umap/tests/test_views.py +2 -2
- umap/views.py +3 -2
- {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/METADATA +2 -2
- {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/RECORD +110 -110
- {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/WHEEL +0 -0
- {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/entry_points.txt +0 -0
- {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/licenses/LICENSE +0 -0
umap/static/umap/js/umap.js
CHANGED
|
@@ -13,7 +13,7 @@ L.Map.mergeOptions({
|
|
|
13
13
|
// we cannot rely on this because of the y is overriden by Leaflet
|
|
14
14
|
// See https://github.com/Leaflet/Leaflet/pull/9201
|
|
15
15
|
// And let's remove this -y when this PR is merged and released.
|
|
16
|
-
demoTileInfos: {
|
|
16
|
+
demoTileInfos: { s: 'a', z: 9, x: 265, y: 181, '-y': 181, r: '' },
|
|
17
17
|
licences: [],
|
|
18
18
|
licence: '',
|
|
19
19
|
enableMarkerDraw: true,
|
|
@@ -83,18 +83,15 @@ U.Map = L.Map.extend({
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
let editedFeature = null
|
|
86
|
-
const self = this
|
|
87
86
|
try {
|
|
88
87
|
Object.defineProperty(this, 'editedFeature', {
|
|
89
|
-
get:
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
set: function (feature) {
|
|
88
|
+
get: () => editedFeature,
|
|
89
|
+
set: (feature) => {
|
|
93
90
|
if (editedFeature && editedFeature !== feature) {
|
|
94
91
|
editedFeature.endEdit()
|
|
95
92
|
}
|
|
96
93
|
editedFeature = feature
|
|
97
|
-
|
|
94
|
+
this.fire('seteditedfeature')
|
|
98
95
|
},
|
|
99
96
|
})
|
|
100
97
|
} catch (e) {
|
|
@@ -102,11 +99,7 @@ U.Map = L.Map.extend({
|
|
|
102
99
|
}
|
|
103
100
|
|
|
104
101
|
// Retrocompat
|
|
105
|
-
if (
|
|
106
|
-
this.options.slideshow &&
|
|
107
|
-
this.options.slideshow.delay &&
|
|
108
|
-
this.options.slideshow.active === undefined
|
|
109
|
-
) {
|
|
102
|
+
if (this.options.slideshow?.delay && this.options.slideshow.active === undefined) {
|
|
110
103
|
this.options.slideshow.active = true
|
|
111
104
|
}
|
|
112
105
|
if (this.options.advancedFilterKey) {
|
|
@@ -156,9 +149,7 @@ U.Map = L.Map.extend({
|
|
|
156
149
|
let isDirty = false // self status
|
|
157
150
|
try {
|
|
158
151
|
Object.defineProperty(this, 'isDirty', {
|
|
159
|
-
get:
|
|
160
|
-
return isDirty
|
|
161
|
-
},
|
|
152
|
+
get: () => isDirty,
|
|
162
153
|
set: function (status) {
|
|
163
154
|
isDirty = status
|
|
164
155
|
this.checkDirty()
|
|
@@ -184,14 +175,17 @@ U.Map = L.Map.extend({
|
|
|
184
175
|
this._default_extent = true
|
|
185
176
|
this.options.name = L._('Untitled map')
|
|
186
177
|
let data = L.Util.queryString('data', null)
|
|
187
|
-
|
|
178
|
+
const url = new URL(window.location.href)
|
|
179
|
+
const dataUrls = new URLSearchParams(url.search).getAll('dataUrl')
|
|
188
180
|
const dataFormat = L.Util.queryString('dataFormat', 'geojson')
|
|
189
|
-
if (
|
|
190
|
-
dataUrl
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
181
|
+
if (dataUrls.length) {
|
|
182
|
+
for (let dataUrl of dataUrls) {
|
|
183
|
+
dataUrl = decodeURIComponent(dataUrl)
|
|
184
|
+
dataUrl = this.localizeUrl(dataUrl)
|
|
185
|
+
dataUrl = this.proxyUrl(dataUrl)
|
|
186
|
+
const datalayer = this.createDataLayer()
|
|
187
|
+
datalayer.importFromUrl(dataUrl, dataFormat)
|
|
188
|
+
}
|
|
195
189
|
} else if (data) {
|
|
196
190
|
data = decodeURIComponent(data)
|
|
197
191
|
const datalayer = this.createDataLayer()
|
|
@@ -216,8 +210,8 @@ U.Map = L.Map.extend({
|
|
|
216
210
|
},
|
|
217
211
|
|
|
218
212
|
initSyncEngine: async function () {
|
|
219
|
-
if (this.options.websocketEnabled
|
|
220
|
-
if (this.options.syncEnabled
|
|
213
|
+
if (this.options.websocketEnabled === false) return
|
|
214
|
+
if (this.options.syncEnabled !== true) {
|
|
221
215
|
this.sync.stop()
|
|
222
216
|
} else {
|
|
223
217
|
const ws_token_uri = this.urls.get('map_websocket_auth_token', {
|
|
@@ -235,9 +229,9 @@ U.Map = L.Map.extend({
|
|
|
235
229
|
},
|
|
236
230
|
|
|
237
231
|
render: function (fields) {
|
|
238
|
-
|
|
232
|
+
const impacts = U.Utils.getImpactsFromSchema(fields)
|
|
239
233
|
|
|
240
|
-
for (
|
|
234
|
+
for (const impact of impacts) {
|
|
241
235
|
switch (impact) {
|
|
242
236
|
case 'ui':
|
|
243
237
|
this.initCaptionBar()
|
|
@@ -274,7 +268,7 @@ U.Map = L.Map.extend({
|
|
|
274
268
|
})
|
|
275
269
|
},
|
|
276
270
|
|
|
277
|
-
setOptionsFromQueryString:
|
|
271
|
+
setOptionsFromQueryString: (options) => {
|
|
278
272
|
// This is not an editable option
|
|
279
273
|
L.Util.setFromQueryString(options, 'editMode')
|
|
280
274
|
// FIXME retrocompat
|
|
@@ -341,7 +335,7 @@ U.Map = L.Map.extend({
|
|
|
341
335
|
|
|
342
336
|
// Merge the given schema with the default one
|
|
343
337
|
// Missing keys inside the schema are merged with the default ones.
|
|
344
|
-
overrideSchema:
|
|
338
|
+
overrideSchema: (schema) => {
|
|
345
339
|
for (const [key, extra] of Object.entries(schema)) {
|
|
346
340
|
U.SCHEMA[key] = L.extend({}, U.SCHEMA[key], extra)
|
|
347
341
|
}
|
|
@@ -419,9 +413,7 @@ U.Map = L.Map.extend({
|
|
|
419
413
|
},
|
|
420
414
|
|
|
421
415
|
renderControls: function () {
|
|
422
|
-
const hasSlideshow = Boolean(
|
|
423
|
-
this.options.slideshow && this.options.slideshow.active
|
|
424
|
-
)
|
|
416
|
+
const hasSlideshow = Boolean(this.options.slideshow?.active)
|
|
425
417
|
const barEnabled = this.options.captionBar || hasSlideshow
|
|
426
418
|
document.body.classList.toggle('umap-caption-bar-enabled', barEnabled)
|
|
427
419
|
document.body.classList.toggle('umap-slideshow-enabled', hasSlideshow)
|
|
@@ -449,7 +441,9 @@ U.Map = L.Map.extend({
|
|
|
449
441
|
}
|
|
450
442
|
})
|
|
451
443
|
}
|
|
452
|
-
let name
|
|
444
|
+
let name
|
|
445
|
+
let status
|
|
446
|
+
let control
|
|
453
447
|
for (let i = 0; i < this.HIDDABLE_CONTROLS.length; i++) {
|
|
454
448
|
name = this.HIDDABLE_CONTROLS[i]
|
|
455
449
|
status = this.getOption(`${name}Control`)
|
|
@@ -470,7 +464,8 @@ U.Map = L.Map.extend({
|
|
|
470
464
|
initDataLayers: async function (datalayers) {
|
|
471
465
|
datalayers = datalayers || this.options.datalayers
|
|
472
466
|
for (const options of datalayers) {
|
|
473
|
-
|
|
467
|
+
// `false` to not propagate syncing elements served from uMap
|
|
468
|
+
this.createDataLayer(options, false)
|
|
474
469
|
}
|
|
475
470
|
await this.loadDataLayers()
|
|
476
471
|
},
|
|
@@ -624,7 +619,7 @@ U.Map = L.Map.extend({
|
|
|
624
619
|
initTileLayers: function () {
|
|
625
620
|
this.tilelayers = []
|
|
626
621
|
for (const props of this.options.tilelayers) {
|
|
627
|
-
|
|
622
|
+
const layer = this.createTileLayer(props)
|
|
628
623
|
this.tilelayers.push(layer)
|
|
629
624
|
if (
|
|
630
625
|
this.options.tilelayer &&
|
|
@@ -634,11 +629,7 @@ U.Map = L.Map.extend({
|
|
|
634
629
|
this.options.tilelayer.attribution = props.attribution
|
|
635
630
|
}
|
|
636
631
|
}
|
|
637
|
-
if (
|
|
638
|
-
this.options.tilelayer &&
|
|
639
|
-
this.options.tilelayer.url_template &&
|
|
640
|
-
this.options.tilelayer.attribution
|
|
641
|
-
) {
|
|
632
|
+
if (this.options.tilelayer?.url_template && this.options.tilelayer.attribution) {
|
|
642
633
|
this.customTilelayer = this.createTileLayer(this.options.tilelayer)
|
|
643
634
|
this.selectTileLayer(this.customTilelayer)
|
|
644
635
|
} else {
|
|
@@ -647,9 +638,7 @@ U.Map = L.Map.extend({
|
|
|
647
638
|
if (this._controls) this._controls.tilelayers.setLayers()
|
|
648
639
|
},
|
|
649
640
|
|
|
650
|
-
createTileLayer:
|
|
651
|
-
return new L.TileLayer(tilelayer.url_template, tilelayer)
|
|
652
|
-
},
|
|
641
|
+
createTileLayer: (tilelayer) => new L.TileLayer(tilelayer.url_template, tilelayer),
|
|
653
642
|
|
|
654
643
|
selectTileLayer: function (tilelayer) {
|
|
655
644
|
if (tilelayer === this.selected_tilelayer) {
|
|
@@ -663,13 +652,13 @@ U.Map = L.Map.extend({
|
|
|
663
652
|
}
|
|
664
653
|
this.selected_tilelayer = tilelayer
|
|
665
654
|
if (
|
|
666
|
-
!isNaN(this.selected_tilelayer.options.minZoom) &&
|
|
655
|
+
!Number.isNaN(this.selected_tilelayer.options.minZoom) &&
|
|
667
656
|
this.getZoom() < this.selected_tilelayer.options.minZoom
|
|
668
657
|
) {
|
|
669
658
|
this.setZoom(this.selected_tilelayer.options.minZoom)
|
|
670
659
|
}
|
|
671
660
|
if (
|
|
672
|
-
!isNaN(this.selected_tilelayer.options.maxZoom) &&
|
|
661
|
+
!Number.isNaN(this.selected_tilelayer.options.maxZoom) &&
|
|
673
662
|
this.getZoom() > this.selected_tilelayer.options.maxZoom
|
|
674
663
|
) {
|
|
675
664
|
this.setZoom(this.selected_tilelayer.options.maxZoom)
|
|
@@ -756,7 +745,7 @@ U.Map = L.Map.extend({
|
|
|
756
745
|
}
|
|
757
746
|
},
|
|
758
747
|
|
|
759
|
-
latLng:
|
|
748
|
+
latLng: (a, b, c) => {
|
|
760
749
|
// manage geojson case and call original method
|
|
761
750
|
if (!(a instanceof L.LatLng) && a.coordinates) {
|
|
762
751
|
// Guess it's a geojson
|
|
@@ -766,11 +755,16 @@ U.Map = L.Map.extend({
|
|
|
766
755
|
},
|
|
767
756
|
|
|
768
757
|
handleLimitBounds: function () {
|
|
769
|
-
const south = parseFloat(this.options.limitBounds.south)
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
if (
|
|
758
|
+
const south = Number.parseFloat(this.options.limitBounds.south)
|
|
759
|
+
const west = Number.parseFloat(this.options.limitBounds.west)
|
|
760
|
+
const north = Number.parseFloat(this.options.limitBounds.north)
|
|
761
|
+
const east = Number.parseFloat(this.options.limitBounds.east)
|
|
762
|
+
if (
|
|
763
|
+
!Number.isNaN(south) &&
|
|
764
|
+
!Number.isNaN(west) &&
|
|
765
|
+
!Number.isNaN(north) &&
|
|
766
|
+
!Number.isNaN(east)
|
|
767
|
+
) {
|
|
774
768
|
const bounds = L.latLngBounds([
|
|
775
769
|
[south, west],
|
|
776
770
|
[north, east],
|
|
@@ -800,7 +794,7 @@ U.Map = L.Map.extend({
|
|
|
800
794
|
return L.Map.prototype.setMaxBounds.call(this, bounds)
|
|
801
795
|
},
|
|
802
796
|
|
|
803
|
-
createDataLayer: function (options = {}, sync) {
|
|
797
|
+
createDataLayer: function (options = {}, sync = true) {
|
|
804
798
|
options.name = options.name || `${L._('Layer')} ${this.datalayers_index.length + 1}`
|
|
805
799
|
const datalayer = new U.DataLayer(this, options, sync)
|
|
806
800
|
|
|
@@ -815,9 +809,7 @@ U.Map = L.Map.extend({
|
|
|
815
809
|
datalayer.edit()
|
|
816
810
|
},
|
|
817
811
|
|
|
818
|
-
getDefaultOption:
|
|
819
|
-
return U.SCHEMA[option] && U.SCHEMA[option].default
|
|
820
|
-
},
|
|
812
|
+
getDefaultOption: (option) => U.SCHEMA[option]?.default,
|
|
821
813
|
|
|
822
814
|
getOption: function (option, feature) {
|
|
823
815
|
if (feature) {
|
|
@@ -841,11 +833,10 @@ U.Map = L.Map.extend({
|
|
|
841
833
|
},
|
|
842
834
|
|
|
843
835
|
updateTileLayers: function () {
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
}
|
|
836
|
+
const callback = (tilelayer) => {
|
|
837
|
+
this.options.tilelayer = tilelayer.toJSON()
|
|
838
|
+
this.isDirty = true
|
|
839
|
+
}
|
|
849
840
|
if (this._controls.tilelayersChooser)
|
|
850
841
|
this._controls.tilelayersChooser.openSwitcher({
|
|
851
842
|
callback: callback,
|
|
@@ -893,7 +884,7 @@ U.Map = L.Map.extend({
|
|
|
893
884
|
|
|
894
885
|
importFromUrl: async function (uri) {
|
|
895
886
|
const response = await this.request.get(uri)
|
|
896
|
-
if (response
|
|
887
|
+
if (response?.ok) {
|
|
897
888
|
this.importRaw(await response.text())
|
|
898
889
|
}
|
|
899
890
|
},
|
|
@@ -911,14 +902,13 @@ U.Map = L.Map.extend({
|
|
|
911
902
|
}
|
|
912
903
|
|
|
913
904
|
if (importedData.geometry) this.options.center = this.latLng(importedData.geometry)
|
|
914
|
-
const self = this
|
|
915
905
|
importedData.layers.forEach((geojson) => {
|
|
916
906
|
if (!geojson._umap_options && geojson._storage) {
|
|
917
907
|
geojson._umap_options = geojson._storage
|
|
918
908
|
delete geojson._storage
|
|
919
909
|
}
|
|
920
910
|
delete geojson._umap_options?.id // Never trust an id at this stage
|
|
921
|
-
const dataLayer =
|
|
911
|
+
const dataLayer = this.createDataLayer(geojson._umap_options)
|
|
922
912
|
dataLayer.fromUmapGeoJSON(geojson)
|
|
923
913
|
})
|
|
924
914
|
|
|
@@ -936,11 +926,10 @@ U.Map = L.Map.extend({
|
|
|
936
926
|
importFromFile: function (file) {
|
|
937
927
|
const reader = new FileReader()
|
|
938
928
|
reader.readAsText(file)
|
|
939
|
-
const self = this
|
|
940
929
|
reader.onload = (e) => {
|
|
941
930
|
const rawData = e.target.result
|
|
942
931
|
try {
|
|
943
|
-
|
|
932
|
+
this.importRaw(rawData)
|
|
944
933
|
} catch (e) {
|
|
945
934
|
console.error('Error importing data', e)
|
|
946
935
|
U.Alert.error(L._('Invalid umap data in {filename}', { filename: file.name }))
|
|
@@ -1146,7 +1135,8 @@ U.Map = L.Map.extend({
|
|
|
1146
1135
|
// (edit and viewing)
|
|
1147
1136
|
// cf https://github.com/umap-project/umap/issues/585
|
|
1148
1137
|
defaultEditDataLayer: function () {
|
|
1149
|
-
let datalayer
|
|
1138
|
+
let datalayer
|
|
1139
|
+
let fallback
|
|
1150
1140
|
datalayer = this.lastUsedDataLayer
|
|
1151
1141
|
if (
|
|
1152
1142
|
datalayer &&
|
|
@@ -1172,7 +1162,7 @@ U.Map = L.Map.extend({
|
|
|
1172
1162
|
},
|
|
1173
1163
|
|
|
1174
1164
|
getDataLayerByUmapId: function (umap_id) {
|
|
1175
|
-
return this.findDataLayer((d) => d.umap_id
|
|
1165
|
+
return this.findDataLayer((d) => d.umap_id === umap_id)
|
|
1176
1166
|
},
|
|
1177
1167
|
|
|
1178
1168
|
_editControls: function (container) {
|
|
@@ -1354,7 +1344,7 @@ U.Map = L.Map.extend({
|
|
|
1354
1344
|
handler: 'BlurInput',
|
|
1355
1345
|
helpText: `${L._('Supported scheme')}: http://{s}.domain.com/{z}/{x}/{y}.png`,
|
|
1356
1346
|
placeholder: 'url',
|
|
1357
|
-
|
|
1347
|
+
label: L._('Background overlay url'),
|
|
1358
1348
|
type: 'url',
|
|
1359
1349
|
},
|
|
1360
1350
|
],
|
|
@@ -1505,8 +1495,15 @@ U.Map = L.Map.extend({
|
|
|
1505
1495
|
L.DomUtil.createButton(
|
|
1506
1496
|
'button umap-empty',
|
|
1507
1497
|
advancedButtons,
|
|
1508
|
-
L._('
|
|
1509
|
-
this.
|
|
1498
|
+
L._('Clear data'),
|
|
1499
|
+
this.emptyDataLayers,
|
|
1500
|
+
this
|
|
1501
|
+
)
|
|
1502
|
+
L.DomUtil.createButton(
|
|
1503
|
+
'button umap-empty',
|
|
1504
|
+
advancedButtons,
|
|
1505
|
+
L._('Remove layers'),
|
|
1506
|
+
this.removeDataLayers,
|
|
1510
1507
|
this
|
|
1511
1508
|
)
|
|
1512
1509
|
}
|
|
@@ -1517,13 +1514,6 @@ U.Map = L.Map.extend({
|
|
|
1517
1514
|
this.clone,
|
|
1518
1515
|
this
|
|
1519
1516
|
)
|
|
1520
|
-
L.DomUtil.createButton(
|
|
1521
|
-
'button umap-empty',
|
|
1522
|
-
advancedButtons,
|
|
1523
|
-
L._('Delete all layers'),
|
|
1524
|
-
this.empty,
|
|
1525
|
-
this
|
|
1526
|
-
)
|
|
1527
1517
|
L.DomUtil.createButton(
|
|
1528
1518
|
'button umap-download',
|
|
1529
1519
|
advancedButtons,
|
|
@@ -1611,11 +1601,11 @@ U.Map = L.Map.extend({
|
|
|
1611
1601
|
|
|
1612
1602
|
initCaptionBar: function () {
|
|
1613
1603
|
const container = L.DomUtil.create(
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1604
|
+
'div',
|
|
1605
|
+
'umap-caption-bar',
|
|
1606
|
+
this._controlContainer
|
|
1607
|
+
)
|
|
1608
|
+
const name = L.DomUtil.create('h3', '', container)
|
|
1619
1609
|
L.DomEvent.disableClickPropagation(container)
|
|
1620
1610
|
this.permissions.addOwnerLink('span', container)
|
|
1621
1611
|
if (this.getOption('captionMenus')) {
|
|
@@ -1687,12 +1677,18 @@ U.Map = L.Map.extend({
|
|
|
1687
1677
|
}
|
|
1688
1678
|
},
|
|
1689
1679
|
|
|
1690
|
-
|
|
1680
|
+
removeDataLayers: function () {
|
|
1691
1681
|
this.eachDataLayerReverse((datalayer) => {
|
|
1692
1682
|
datalayer._delete()
|
|
1693
1683
|
})
|
|
1694
1684
|
},
|
|
1695
1685
|
|
|
1686
|
+
emptyDataLayers: function () {
|
|
1687
|
+
this.eachDataLayerReverse((datalayer) => {
|
|
1688
|
+
datalayer.empty()
|
|
1689
|
+
})
|
|
1690
|
+
},
|
|
1691
|
+
|
|
1696
1692
|
initLoader: function () {
|
|
1697
1693
|
this.loader = new L.Control.Loading()
|
|
1698
1694
|
this.loader.onAdd(this)
|
|
@@ -1721,7 +1717,7 @@ U.Map = L.Map.extend({
|
|
|
1721
1717
|
},
|
|
1722
1718
|
})
|
|
1723
1719
|
}
|
|
1724
|
-
if (e
|
|
1720
|
+
if (e?.relatedTarget) {
|
|
1725
1721
|
if (e.relatedTarget.getContextMenuItems) {
|
|
1726
1722
|
items = items.concat(e.relatedTarget.getContextMenuItems(e))
|
|
1727
1723
|
}
|