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
|
@@ -162,7 +162,7 @@ U.BaseFeatureAction = L.ToolbarAction.extend({
|
|
|
162
162
|
this.postInit()
|
|
163
163
|
},
|
|
164
164
|
|
|
165
|
-
postInit:
|
|
165
|
+
postInit: () => {},
|
|
166
166
|
|
|
167
167
|
hideToolbar: function () {
|
|
168
168
|
this.map.removeLayer(this.toolbar)
|
|
@@ -356,7 +356,7 @@ U.DropControl = L.Class.extend({
|
|
|
356
356
|
this.dropzone.classList.add('umap-dragover')
|
|
357
357
|
},
|
|
358
358
|
|
|
359
|
-
dragover:
|
|
359
|
+
dragover: (e) => {
|
|
360
360
|
L.DomEvent.stop(e)
|
|
361
361
|
},
|
|
362
362
|
|
|
@@ -393,7 +393,7 @@ U.EditControl = L.Control.extend({
|
|
|
393
393
|
L.DomEvent.on(
|
|
394
394
|
enableEditing,
|
|
395
395
|
'mouseover',
|
|
396
|
-
|
|
396
|
+
() => {
|
|
397
397
|
map.tooltip.open({
|
|
398
398
|
content: map.help.displayLabel('TOGGLE_EDIT'),
|
|
399
399
|
anchor: enableEditing,
|
|
@@ -434,9 +434,9 @@ U.MoreControls = L.Control.extend({
|
|
|
434
434
|
},
|
|
435
435
|
|
|
436
436
|
toggle: function () {
|
|
437
|
-
const pos = this.getPosition()
|
|
438
|
-
|
|
439
|
-
|
|
437
|
+
const pos = this.getPosition()
|
|
438
|
+
const corner = this._map._controlCorners[pos]
|
|
439
|
+
const className = 'umap-more-controls'
|
|
440
440
|
if (L.DomUtil.hasClass(corner, className)) L.DomUtil.removeClass(corner, className)
|
|
441
441
|
else L.DomUtil.addClass(corner, className)
|
|
442
442
|
},
|
|
@@ -454,10 +454,10 @@ U.PermanentCreditsControl = L.Control.extend({
|
|
|
454
454
|
|
|
455
455
|
onAdd: function () {
|
|
456
456
|
const paragraphContainer = L.DomUtil.create(
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
457
|
+
'div',
|
|
458
|
+
'umap-permanent-credits-container'
|
|
459
|
+
)
|
|
460
|
+
const creditsParagraph = L.DomUtil.create('p', '', paragraphContainer)
|
|
461
461
|
|
|
462
462
|
this.paragraphContainer = paragraphContainer
|
|
463
463
|
this.setCredits()
|
|
@@ -503,7 +503,7 @@ L.Control.Button = L.Control.extend({
|
|
|
503
503
|
return container
|
|
504
504
|
},
|
|
505
505
|
|
|
506
|
-
afterAdd:
|
|
506
|
+
afterAdd: (container) => {},
|
|
507
507
|
})
|
|
508
508
|
|
|
509
509
|
U.DataLayersControl = L.Control.Button.extend({
|
|
@@ -745,7 +745,7 @@ const ControlsMixin = {
|
|
|
745
745
|
L.DomUtil.createLink(
|
|
746
746
|
'umap-user',
|
|
747
747
|
rightContainer,
|
|
748
|
-
L._(
|
|
748
|
+
L._('My Dashboard ({username})', {
|
|
749
749
|
username: this.options.user.name,
|
|
750
750
|
}),
|
|
751
751
|
this.options.user.url
|
|
@@ -832,10 +832,10 @@ const ControlsMixin = {
|
|
|
832
832
|
row.dataset.id = L.stamp(datalayer)
|
|
833
833
|
})
|
|
834
834
|
const onReorder = (src, dst, initialIndex, finalIndex) => {
|
|
835
|
-
const layer = this.datalayers[src.dataset.id]
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
835
|
+
const layer = this.datalayers[src.dataset.id]
|
|
836
|
+
const other = this.datalayers[dst.dataset.id]
|
|
837
|
+
const minIndex = Math.min(layer.getRank(), other.getRank())
|
|
838
|
+
const maxIndex = Math.max(layer.getRank(), other.getRank())
|
|
839
839
|
if (finalIndex === 0) layer.bringToTop()
|
|
840
840
|
else if (finalIndex > initialIndex) layer.insertBefore(other)
|
|
841
841
|
else layer.insertAfter(other)
|
|
@@ -948,10 +948,10 @@ U.TileLayerChooser = L.Control.extend({
|
|
|
948
948
|
},
|
|
949
949
|
|
|
950
950
|
addTileLayerElement: function (tilelayer, options) {
|
|
951
|
-
const selectedClass = this.map.hasLayer(tilelayer) ? 'selected' : ''
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
951
|
+
const selectedClass = this.map.hasLayer(tilelayer) ? 'selected' : ''
|
|
952
|
+
const el = L.DomUtil.create('li', selectedClass, this._tilelayers_container)
|
|
953
|
+
const img = L.DomUtil.create('img', '', el)
|
|
954
|
+
const name = L.DomUtil.create('div', '', el)
|
|
955
955
|
img.src = U.Utils.template(tilelayer.options.url_template, this.map.demoTileInfos)
|
|
956
956
|
img.loading = 'lazy'
|
|
957
957
|
name.textContent = tilelayer.options.name
|
|
@@ -961,7 +961,7 @@ U.TileLayerChooser = L.Control.extend({
|
|
|
961
961
|
function () {
|
|
962
962
|
this.map.selectTileLayer(tilelayer)
|
|
963
963
|
this.map._controls.tilelayers.setLayers()
|
|
964
|
-
if (options
|
|
964
|
+
if (options?.callback) options.callback(tilelayer)
|
|
965
965
|
},
|
|
966
966
|
this
|
|
967
967
|
)
|
|
@@ -982,8 +982,8 @@ U.AttributionControl = L.Control.Attribution.extend({
|
|
|
982
982
|
this._container.innerHTML = ''
|
|
983
983
|
const container = L.DomUtil.create('div', 'attribution-container', this._container)
|
|
984
984
|
container.innerHTML = credits
|
|
985
|
-
const shortCredit = this._map.getOption('shortCredit')
|
|
986
|
-
|
|
985
|
+
const shortCredit = this._map.getOption('shortCredit')
|
|
986
|
+
const captionMenus = this._map.getOption('captionMenus')
|
|
987
987
|
if (shortCredit) {
|
|
988
988
|
L.DomUtil.element({
|
|
989
989
|
tagName: 'span',
|
|
@@ -1205,9 +1205,7 @@ L.Control.MiniMap.include({
|
|
|
1205
1205
|
this._miniMap.addLayer(this._layer)
|
|
1206
1206
|
},
|
|
1207
1207
|
|
|
1208
|
-
_cloneLayer:
|
|
1209
|
-
return new L.TileLayer(layer._url, L.Util.extend({}, layer.options))
|
|
1210
|
-
},
|
|
1208
|
+
_cloneLayer: (layer) => new L.TileLayer(layer._url, L.Util.extend({}, layer.options)),
|
|
1211
1209
|
})
|
|
1212
1210
|
|
|
1213
1211
|
L.Control.Loading.include({
|
|
@@ -1312,7 +1310,7 @@ U.Editable = L.Editable.extend({
|
|
|
1312
1310
|
},
|
|
1313
1311
|
|
|
1314
1312
|
drawingTooltip: function (e) {
|
|
1315
|
-
if (e.layer instanceof L.Marker && e.type
|
|
1313
|
+
if (e.layer instanceof L.Marker && e.type === 'editable:drawing:start') {
|
|
1316
1314
|
this.map.tooltip.open({ content: L._('Click to add a marker') })
|
|
1317
1315
|
}
|
|
1318
1316
|
if (!(e.layer instanceof L.Polyline)) {
|
|
@@ -1364,7 +1362,7 @@ U.Editable = L.Editable.extend({
|
|
|
1364
1362
|
this.map.ui.closeTooltip()
|
|
1365
1363
|
},
|
|
1366
1364
|
|
|
1367
|
-
onVertexRawClick:
|
|
1365
|
+
onVertexRawClick: (e) => {
|
|
1368
1366
|
e.layer.onVertexRawClick(e)
|
|
1369
1367
|
L.DomEvent.stop(e)
|
|
1370
1368
|
e.cancel()
|
umap/static/umap/js/umap.core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
L.Util.copyToClipboard =
|
|
1
|
+
L.Util.copyToClipboard = (textToCopy) => {
|
|
2
2
|
// https://stackoverflow.com/a/65996386
|
|
3
3
|
// Navigator clipboard api needs a secure context (https)
|
|
4
4
|
if (navigator.clipboard && window.isSecureContext) {
|
|
@@ -25,10 +25,10 @@ L.Util.copyToClipboard = function (textToCopy) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
L.Util.queryString =
|
|
28
|
+
L.Util.queryString = (name, fallback) => {
|
|
29
29
|
const decode = (s) => decodeURIComponent(s.replace(/\+/g, ' '))
|
|
30
|
-
const qs = window.location.search.slice(1).split('&')
|
|
31
|
-
|
|
30
|
+
const qs = window.location.search.slice(1).split('&')
|
|
31
|
+
const qa = {}
|
|
32
32
|
for (const i in qs) {
|
|
33
33
|
const key = qs[i].split('=')
|
|
34
34
|
if (!key) continue
|
|
@@ -37,27 +37,27 @@ L.Util.queryString = function (name, fallback) {
|
|
|
37
37
|
return qa[name] || fallback
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
L.Util.booleanFromQueryString =
|
|
40
|
+
L.Util.booleanFromQueryString = (name) => {
|
|
41
41
|
const value = L.Util.queryString(name)
|
|
42
42
|
return value === '1' || value === 'true'
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
L.Util.setFromQueryString =
|
|
45
|
+
L.Util.setFromQueryString = (options, name) => {
|
|
46
46
|
const value = L.Util.queryString(name)
|
|
47
47
|
if (typeof value !== 'undefined') options[name] = value
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
L.Util.setBooleanFromQueryString =
|
|
50
|
+
L.Util.setBooleanFromQueryString = (options, name) => {
|
|
51
51
|
const value = L.Util.queryString(name)
|
|
52
|
-
if (typeof value !== 'undefined') options[name] = value
|
|
52
|
+
if (typeof value !== 'undefined') options[name] = value === '1' || value === 'true'
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
L.Util.setNumberFromQueryString =
|
|
55
|
+
L.Util.setNumberFromQueryString = (options, name) => {
|
|
56
56
|
const value = +L.Util.queryString(name)
|
|
57
|
-
if (!isNaN(value)) options[name] = value
|
|
57
|
+
if (!Number.isNaN(value)) options[name] = value
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
L.Util.setNullableBooleanFromQueryString =
|
|
60
|
+
L.Util.setNullableBooleanFromQueryString = (options, name) => {
|
|
61
61
|
let value = L.Util.queryString(name)
|
|
62
62
|
if (typeof value !== 'undefined') {
|
|
63
63
|
if (value === 'null') value = null
|
|
@@ -192,7 +192,7 @@ L.DomUtil.after = (target, el) => {
|
|
|
192
192
|
// convert colour in range 0-255 to the modifier used within luminance calculation
|
|
193
193
|
L.DomUtil.colourMod = (colour) => {
|
|
194
194
|
const sRGB = colour / 255
|
|
195
|
-
let mod =
|
|
195
|
+
let mod = ((sRGB + 0.055) / 1.055) ** 2.4
|
|
196
196
|
if (sRGB < 0.03928) mod = sRGB / 12.92
|
|
197
197
|
return mod
|
|
198
198
|
}
|
|
@@ -222,7 +222,11 @@ L.DomUtil.contrastedColor = (el, bgcolor) => {
|
|
|
222
222
|
let rgb = window.getComputedStyle(el).getPropertyValue('background-color')
|
|
223
223
|
rgb = L.DomUtil.RGBRegex.exec(rgb)
|
|
224
224
|
if (!rgb || rgb.length !== 4) return out
|
|
225
|
-
rgb = [
|
|
225
|
+
rgb = [
|
|
226
|
+
Number.parseInt(rgb[1], 10),
|
|
227
|
+
Number.parseInt(rgb[2], 10),
|
|
228
|
+
Number.parseInt(rgb[3], 10),
|
|
229
|
+
]
|
|
226
230
|
out = L.DomUtil.contrastWCAG21(rgb)
|
|
227
231
|
if (bgcolor) _CACHE_CONSTRAST[bgcolor] = out
|
|
228
232
|
return out
|
|
@@ -247,9 +251,9 @@ L.DomEvent.once = (el, types, fn, context) => {
|
|
|
247
251
|
|
|
248
252
|
L.LatLng.prototype.isValid = function () {
|
|
249
253
|
return (
|
|
250
|
-
isFinite(this.lat) &&
|
|
254
|
+
Number.isFinite(this.lat) &&
|
|
251
255
|
Math.abs(this.lat) <= 90 &&
|
|
252
|
-
isFinite(this.lng) &&
|
|
256
|
+
Number.isFinite(this.lng) &&
|
|
253
257
|
Math.abs(this.lng) <= 180
|
|
254
258
|
)
|
|
255
259
|
}
|
|
@@ -7,15 +7,12 @@ U.DataLayerPermissions = L.Class.extend({
|
|
|
7
7
|
this.options = L.Util.setOptions(this, datalayer.options.permissions)
|
|
8
8
|
this.datalayer = datalayer
|
|
9
9
|
let isDirty = false
|
|
10
|
-
const self = this
|
|
11
10
|
try {
|
|
12
11
|
Object.defineProperty(this, 'isDirty', {
|
|
13
|
-
get:
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
set: function (status) {
|
|
12
|
+
get: () => isDirty,
|
|
13
|
+
set: (status) => {
|
|
17
14
|
isDirty = status
|
|
18
|
-
if (status)
|
|
15
|
+
if (status) this.datalayer.isDirty = status
|
|
19
16
|
},
|
|
20
17
|
})
|
|
21
18
|
} catch (e) {
|
|
@@ -29,19 +26,19 @@ U.DataLayerPermissions = L.Class.extend({
|
|
|
29
26
|
|
|
30
27
|
edit: function (container) {
|
|
31
28
|
const fields = [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
],
|
|
29
|
+
[
|
|
30
|
+
'options.edit_status',
|
|
31
|
+
{
|
|
32
|
+
handler: 'IntSelect',
|
|
33
|
+
label: L._('Who can edit "{layer}"', { layer: this.datalayer.getName() }),
|
|
34
|
+
selectOptions: this.datalayer.map.options.datalayer_edit_statuses,
|
|
35
|
+
},
|
|
40
36
|
],
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
]
|
|
38
|
+
const builder = new U.FormBuilder(this, fields, {
|
|
39
|
+
className: 'umap-form datalayer-permissions',
|
|
40
|
+
})
|
|
41
|
+
const form = builder.build()
|
|
45
42
|
container.appendChild(form)
|
|
46
43
|
},
|
|
47
44
|
|