umap-project 2.2.0b0__py3-none-any.whl → 2.2.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/.DS_Store +0 -0
- umap/__init__.py +1 -1
- umap/static/.DS_Store +0 -0
- umap/static/umap/.DS_Store +0 -0
- umap/static/umap/base.css +14 -5
- umap/static/umap/favicons/.DS_Store +0 -0
- umap/static/umap/fonts/.DS_Store +0 -0
- umap/static/umap/js/modules/browser.js +16 -1
- umap/static/umap/js/modules/dompurify.js +1 -1
- umap/static/umap/js/modules/facets.js +1 -0
- umap/static/umap/js/modules/utils.js +6 -6
- umap/static/umap/js/umap.autocomplete.js +40 -25
- umap/static/umap/js/umap.controls.js +48 -43
- umap/static/umap/js/umap.core.js +27 -12
- umap/static/umap/js/umap.features.js +2 -2
- umap/static/umap/js/umap.forms.js +24 -18
- umap/static/umap/js/umap.importer.js +60 -46
- umap/static/umap/js/umap.js +9 -11
- umap/static/umap/js/umap.layer.js +9 -1
- umap/static/umap/js/umap.permissions.js +9 -3
- umap/static/umap/js/umap.popup.js +16 -9
- umap/static/umap/js/umap.share.js +1 -1
- umap/static/umap/js/umap.ui.js +10 -9
- umap/static/umap/locale/am_ET.js +4 -3
- umap/static/umap/locale/am_ET.json +4 -3
- umap/static/umap/locale/ar.js +4 -3
- umap/static/umap/locale/ar.json +4 -3
- umap/static/umap/locale/ast.js +4 -3
- umap/static/umap/locale/ast.json +4 -3
- umap/static/umap/locale/bg.js +4 -3
- umap/static/umap/locale/bg.json +4 -3
- umap/static/umap/locale/br.js +15 -14
- umap/static/umap/locale/br.json +15 -14
- umap/static/umap/locale/ca.js +4 -3
- umap/static/umap/locale/ca.json +4 -3
- umap/static/umap/locale/cs_CZ.js +4 -3
- umap/static/umap/locale/cs_CZ.json +4 -3
- umap/static/umap/locale/da.js +4 -3
- umap/static/umap/locale/da.json +4 -3
- umap/static/umap/locale/de.js +4 -3
- umap/static/umap/locale/de.json +4 -3
- umap/static/umap/locale/el.js +4 -3
- umap/static/umap/locale/el.json +4 -3
- umap/static/umap/locale/en.js +4 -3
- umap/static/umap/locale/en.json +4 -3
- umap/static/umap/locale/en_US.json +4 -3
- umap/static/umap/locale/es.js +4 -3
- umap/static/umap/locale/es.json +4 -3
- umap/static/umap/locale/et.js +4 -3
- umap/static/umap/locale/et.json +4 -3
- umap/static/umap/locale/fa_IR.js +4 -3
- umap/static/umap/locale/fa_IR.json +4 -3
- umap/static/umap/locale/fi.js +4 -3
- umap/static/umap/locale/fi.json +4 -3
- umap/static/umap/locale/fr.js +4 -3
- umap/static/umap/locale/fr.json +4 -3
- umap/static/umap/locale/gl.js +4 -3
- umap/static/umap/locale/gl.json +4 -3
- umap/static/umap/locale/he.js +4 -3
- umap/static/umap/locale/he.json +4 -3
- umap/static/umap/locale/hr.js +4 -3
- umap/static/umap/locale/hr.json +4 -3
- umap/static/umap/locale/hu.js +4 -3
- umap/static/umap/locale/hu.json +4 -3
- umap/static/umap/locale/id.js +4 -3
- umap/static/umap/locale/id.json +4 -3
- umap/static/umap/locale/is.js +4 -3
- umap/static/umap/locale/is.json +4 -3
- umap/static/umap/locale/it.js +4 -3
- umap/static/umap/locale/it.json +4 -3
- umap/static/umap/locale/ja.js +4 -3
- umap/static/umap/locale/ja.json +4 -3
- umap/static/umap/locale/ko.js +4 -3
- umap/static/umap/locale/ko.json +4 -3
- umap/static/umap/locale/lt.js +4 -3
- umap/static/umap/locale/lt.json +4 -3
- umap/static/umap/locale/ms.js +4 -3
- umap/static/umap/locale/ms.json +4 -3
- umap/static/umap/locale/nl.js +4 -3
- umap/static/umap/locale/nl.json +4 -3
- umap/static/umap/locale/no.js +4 -3
- umap/static/umap/locale/no.json +4 -3
- umap/static/umap/locale/pl.js +4 -3
- umap/static/umap/locale/pl.json +4 -3
- umap/static/umap/locale/pl_PL.json +4 -3
- umap/static/umap/locale/pt.js +4 -3
- umap/static/umap/locale/pt.json +4 -3
- umap/static/umap/locale/pt_BR.js +4 -3
- umap/static/umap/locale/pt_BR.json +4 -3
- umap/static/umap/locale/pt_PT.js +4 -3
- umap/static/umap/locale/pt_PT.json +4 -3
- umap/static/umap/locale/ro.js +4 -3
- umap/static/umap/locale/ro.json +4 -3
- umap/static/umap/locale/ru.js +4 -3
- umap/static/umap/locale/ru.json +4 -3
- umap/static/umap/locale/sk_SK.js +4 -3
- umap/static/umap/locale/sk_SK.json +4 -3
- umap/static/umap/locale/sl.js +4 -3
- umap/static/umap/locale/sl.json +4 -3
- umap/static/umap/locale/sr.js +4 -3
- umap/static/umap/locale/sr.json +4 -3
- umap/static/umap/locale/sv.js +4 -3
- umap/static/umap/locale/sv.json +4 -3
- umap/static/umap/locale/th_TH.js +4 -3
- umap/static/umap/locale/th_TH.json +4 -3
- umap/static/umap/locale/tr.js +4 -3
- umap/static/umap/locale/tr.json +4 -3
- umap/static/umap/locale/uk_UA.js +4 -3
- umap/static/umap/locale/uk_UA.json +4 -3
- umap/static/umap/locale/vi.js +4 -3
- umap/static/umap/locale/vi.json +4 -3
- umap/static/umap/locale/vi_VN.json +4 -3
- umap/static/umap/locale/zh.js +4 -3
- umap/static/umap/locale/zh.json +4 -3
- umap/static/umap/locale/zh_CN.json +4 -3
- umap/static/umap/locale/zh_TW.Big5.json +4 -3
- umap/static/umap/locale/zh_TW.js +4 -3
- umap/static/umap/locale/zh_TW.json +4 -3
- umap/static/umap/map.css +12 -1
- umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -0
- umap/static/umap/vendors/iconlayers/iconLayers.js +1 -1
- umap/tests/.DS_Store +0 -0
- umap/tests/integration/.DS_Store +0 -0
- umap/tests/integration/test_anonymous_owned_map.py +21 -0
- umap/tests/integration/test_basics.py +21 -0
- umap/tests/integration/test_edit_map.py +7 -0
- umap/tests/integration/test_import.py +4 -2
- umap/tests/integration/test_tilelayer.py +10 -0
- {umap_project-2.2.0b0.dist-info → umap_project-2.2.2.dist-info}/METADATA +6 -6
- {umap_project-2.2.0b0.dist-info → umap_project-2.2.2.dist-info}/RECORD +134 -126
- {umap_project-2.2.0b0.dist-info → umap_project-2.2.2.dist-info}/WHEEL +1 -1
- /umap/static/umap/vendors/dompurify/{purify.es.mjs → purify.es.js} +0 -0
- {umap_project-2.2.0b0.dist-info → umap_project-2.2.2.dist-info}/entry_points.txt +0 -0
- {umap_project-2.2.0b0.dist-info → umap_project-2.2.2.dist-info}/licenses/LICENSE +0 -0
umap/.DS_Store
ADDED
|
Binary file
|
umap/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
VERSION = "2.2.
|
|
1
|
+
VERSION = "2.2.2"
|
umap/static/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
umap/static/umap/base.css
CHANGED
|
@@ -580,20 +580,29 @@ i.info {
|
|
|
580
580
|
margin-top: -8px;
|
|
581
581
|
padding: 0 5px;
|
|
582
582
|
}
|
|
583
|
-
.
|
|
583
|
+
.flat-tabs {
|
|
584
584
|
display: flex;
|
|
585
585
|
justify-content: space-around;
|
|
586
586
|
font-size: 1.2em;
|
|
587
|
-
|
|
587
|
+
margin-bottom: 20px;
|
|
588
|
+
border-bottom: 1px solid #bebebe;
|
|
588
589
|
}
|
|
589
|
-
.
|
|
590
|
+
.flat-tabs button {
|
|
590
591
|
padding: 10px;
|
|
591
|
-
color: #fff;
|
|
592
592
|
text-decoration: none;
|
|
593
593
|
cursor: pointer;
|
|
594
|
+
border-bottom: 1px solid transparent;
|
|
594
595
|
}
|
|
595
|
-
.
|
|
596
|
+
.flat-tabs button:hover,
|
|
597
|
+
.flat-tabs .on {
|
|
596
598
|
font-weight: bold;
|
|
599
|
+
border-bottom: 1px solid #444;
|
|
600
|
+
}
|
|
601
|
+
.dark .flat-tabs button {
|
|
602
|
+
color: #fff;
|
|
603
|
+
}
|
|
604
|
+
.dark .flat-tabs button:hover,
|
|
605
|
+
.dark .flat-tabs .on {
|
|
597
606
|
border-bottom: 1px solid #fff;
|
|
598
607
|
}
|
|
599
608
|
.umap-pictogram-category h6 {
|
|
Binary file
|
|
Binary file
|
|
@@ -44,7 +44,7 @@ export default class Browser {
|
|
|
44
44
|
U.Icon.setIconContrast(icon, colorBox, symbol, bgcolor)
|
|
45
45
|
}
|
|
46
46
|
const viewFeature = (e) => {
|
|
47
|
-
feature.zoomTo({...e, callback: feature.view})
|
|
47
|
+
feature.zoomTo({ ...e, callback: feature.view })
|
|
48
48
|
}
|
|
49
49
|
DomEvent.on(zoom_to, 'click', viewFeature)
|
|
50
50
|
DomEvent.on(title, 'click', viewFeature)
|
|
@@ -135,6 +135,7 @@ export default class Browser {
|
|
|
135
135
|
DomEvent.disableClickPropagation(container)
|
|
136
136
|
|
|
137
137
|
DomUtil.createTitle(container, translate('Browse data'), 'icon-layers')
|
|
138
|
+
this.tabsMenu(container, 'browse')
|
|
138
139
|
const formContainer = DomUtil.create('div', '', container)
|
|
139
140
|
this.dataContainer = DomUtil.create('div', '', container)
|
|
140
141
|
|
|
@@ -165,4 +166,18 @@ export default class Browser {
|
|
|
165
166
|
DomEvent.on(button, 'click', map.openBrowser, map)
|
|
166
167
|
return button
|
|
167
168
|
}
|
|
169
|
+
|
|
170
|
+
tabsMenu(container, active) {
|
|
171
|
+
const tabs = L.DomUtil.create('div', 'flat-tabs', container)
|
|
172
|
+
const browse = L.DomUtil.add('button', 'flat tab-browse', tabs, L._('Data'))
|
|
173
|
+
DomEvent.on(browse, 'click', this.open, this)
|
|
174
|
+
if (this.map.options.facetKey) {
|
|
175
|
+
const facets = L.DomUtil.add('button', 'flat tab-facets', tabs, L._('Filters'))
|
|
176
|
+
DomEvent.on(facets, 'click', this.map.facets.open, this.map.facets)
|
|
177
|
+
}
|
|
178
|
+
const info = L.DomUtil.add('button', 'flat tab-info', tabs, L._('About'))
|
|
179
|
+
DomEvent.on(info, 'click', this.map.displayCaption, this.map)
|
|
180
|
+
let el = tabs.querySelector(`.tab-${active}`)
|
|
181
|
+
L.DomUtil.addClass(el, 'on')
|
|
182
|
+
}
|
|
168
183
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as DOMPurifyInitializer } from '../../vendors/dompurify/purify.es.
|
|
1
|
+
import { default as DOMPurifyInitializer } from '../../vendors/dompurify/purify.es.js'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Generate a pseudo-unique identifier (5 chars long, mixed-case alphanumeric)
|
|
@@ -70,7 +70,6 @@ export default function getPurify() {
|
|
|
70
70
|
export function escapeHTML(s) {
|
|
71
71
|
s = s ? s.toString() : ''
|
|
72
72
|
s = getPurify().sanitize(s, {
|
|
73
|
-
USE_PROFILES: { html: true },
|
|
74
73
|
ADD_TAGS: ['iframe'],
|
|
75
74
|
ALLOWED_TAGS: [
|
|
76
75
|
'h3',
|
|
@@ -86,9 +85,10 @@ export function escapeHTML(s) {
|
|
|
86
85
|
'iframe',
|
|
87
86
|
'img',
|
|
88
87
|
'br',
|
|
88
|
+
'span',
|
|
89
89
|
],
|
|
90
90
|
ADD_ATTR: ['target', 'allow', 'allowfullscreen', 'frameborder', 'scrolling'],
|
|
91
|
-
ALLOWED_ATTR: ['href', 'src', 'width', 'height'],
|
|
91
|
+
ALLOWED_ATTR: ['href', 'src', 'width', 'height', 'style'],
|
|
92
92
|
// Added: `geo:` URL scheme as defined in RFC5870:
|
|
93
93
|
// https://www.rfc-editor.org/rfc/rfc5870.html
|
|
94
94
|
// The base RegExp comes from:
|
|
@@ -358,7 +358,7 @@ export function template(str, data) {
|
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
export function parseNaiveDate(value) {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
361
|
+
const naive = new Date(value)
|
|
362
|
+
// Let's pretend naive date are UTC, and remove time…
|
|
363
|
+
return new Date(Date.UTC(naive.getFullYear(), naive.getMonth(), naive.getDate()))
|
|
364
364
|
}
|
|
@@ -35,27 +35,25 @@ U.AutoComplete = L.Class.extend({
|
|
|
35
35
|
},
|
|
36
36
|
|
|
37
37
|
createInput: function () {
|
|
38
|
-
this.input = L.DomUtil.element(
|
|
39
|
-
'input',
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.el
|
|
47
|
-
)
|
|
38
|
+
this.input = L.DomUtil.element({
|
|
39
|
+
tagName: 'input',
|
|
40
|
+
type: 'text',
|
|
41
|
+
parent: this.el,
|
|
42
|
+
placeholder: this.options.placeholder,
|
|
43
|
+
autocomplete: 'off',
|
|
44
|
+
className: this.options.className,
|
|
45
|
+
})
|
|
48
46
|
L.DomEvent.on(this.input, 'keydown', this.onKeyDown, this)
|
|
49
47
|
L.DomEvent.on(this.input, 'keyup', this.onKeyUp, this)
|
|
50
48
|
L.DomEvent.on(this.input, 'blur', this.onBlur, this)
|
|
51
49
|
},
|
|
52
50
|
|
|
53
51
|
createContainer: function () {
|
|
54
|
-
this.container = L.DomUtil.element(
|
|
55
|
-
'ul',
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
)
|
|
52
|
+
this.container = L.DomUtil.element({
|
|
53
|
+
tagName: 'ul',
|
|
54
|
+
parent: document.body,
|
|
55
|
+
className: 'umap-autocomplete',
|
|
56
|
+
})
|
|
59
57
|
},
|
|
60
58
|
|
|
61
59
|
resizeContainer: function () {
|
|
@@ -174,8 +172,11 @@ U.AutoComplete = L.Class.extend({
|
|
|
174
172
|
},
|
|
175
173
|
|
|
176
174
|
createResult: function (item) {
|
|
177
|
-
const el = L.DomUtil.element(
|
|
178
|
-
|
|
175
|
+
const el = L.DomUtil.element({
|
|
176
|
+
tagName: 'li',
|
|
177
|
+
parent: this.container,
|
|
178
|
+
textContent: item.label,
|
|
179
|
+
})
|
|
179
180
|
const result = {
|
|
180
181
|
item: item,
|
|
181
182
|
el: el,
|
|
@@ -276,15 +277,22 @@ U.AutoComplete.Ajax.SelectMultiple = U.AutoComplete.Ajax.extend({
|
|
|
276
277
|
initSelectedContainer: function () {
|
|
277
278
|
return L.DomUtil.after(
|
|
278
279
|
this.input,
|
|
279
|
-
L.DomUtil.element('ul',
|
|
280
|
+
L.DomUtil.element({ tagName: 'ul', className: 'umap-multiresult' })
|
|
280
281
|
)
|
|
281
282
|
},
|
|
282
283
|
|
|
283
284
|
displaySelected: function (result) {
|
|
284
|
-
const result_el = L.DomUtil.element(
|
|
285
|
+
const result_el = L.DomUtil.element({
|
|
286
|
+
tagName: 'li',
|
|
287
|
+
parent: this.selected_container,
|
|
288
|
+
})
|
|
285
289
|
result_el.textContent = result.item.label
|
|
286
|
-
const close = L.DomUtil.element(
|
|
287
|
-
|
|
290
|
+
const close = L.DomUtil.element({
|
|
291
|
+
tagName: 'span',
|
|
292
|
+
parent: result_el,
|
|
293
|
+
className: 'close',
|
|
294
|
+
textContent: '×',
|
|
295
|
+
})
|
|
288
296
|
L.DomEvent.on(
|
|
289
297
|
close,
|
|
290
298
|
'click',
|
|
@@ -302,15 +310,22 @@ U.AutoComplete.Ajax.Select = U.AutoComplete.Ajax.extend({
|
|
|
302
310
|
initSelectedContainer: function () {
|
|
303
311
|
return L.DomUtil.after(
|
|
304
312
|
this.input,
|
|
305
|
-
L.DomUtil.element('div',
|
|
313
|
+
L.DomUtil.element({ tagName: 'div', className: 'umap-singleresult' })
|
|
306
314
|
)
|
|
307
315
|
},
|
|
308
316
|
|
|
309
317
|
displaySelected: function (result) {
|
|
310
|
-
const result_el = L.DomUtil.element(
|
|
318
|
+
const result_el = L.DomUtil.element({
|
|
319
|
+
tagName: 'div',
|
|
320
|
+
parent: this.selected_container,
|
|
321
|
+
})
|
|
311
322
|
result_el.textContent = result.item.label
|
|
312
|
-
const close = L.DomUtil.element(
|
|
313
|
-
|
|
323
|
+
const close = L.DomUtil.element({
|
|
324
|
+
tagName: 'span',
|
|
325
|
+
parent: result_el,
|
|
326
|
+
className: 'close',
|
|
327
|
+
textContent: '×',
|
|
328
|
+
})
|
|
314
329
|
this.input.style.display = 'none'
|
|
315
330
|
L.DomEvent.on(
|
|
316
331
|
close,
|
|
@@ -392,7 +392,7 @@ U.EditControl = L.Control.extend({
|
|
|
392
392
|
'mouseover',
|
|
393
393
|
function () {
|
|
394
394
|
map.ui.tooltip({
|
|
395
|
-
content:
|
|
395
|
+
content: map.help.displayLabel('TOGGLE_EDIT'),
|
|
396
396
|
anchor: enableEditing,
|
|
397
397
|
position: 'bottom',
|
|
398
398
|
delay: 750,
|
|
@@ -668,21 +668,29 @@ const ControlsMixin = {
|
|
|
668
668
|
const container = L.DomUtil.create('div', 'umap-caption')
|
|
669
669
|
L.DomUtil.createTitle(container, this.options.name, 'icon-caption')
|
|
670
670
|
this.permissions.addOwnerLink('h5', container)
|
|
671
|
+
this.browser.tabsMenu(container, 'info')
|
|
671
672
|
if (this.options.description) {
|
|
672
|
-
const description = L.DomUtil.
|
|
673
|
-
|
|
673
|
+
const description = L.DomUtil.element({
|
|
674
|
+
tagName: 'div',
|
|
675
|
+
className: 'umap-map-description',
|
|
676
|
+
safeHTML: U.Utils.toHTML(this.options.description),
|
|
677
|
+
parent: container,
|
|
678
|
+
})
|
|
674
679
|
}
|
|
675
680
|
const datalayerContainer = L.DomUtil.create('div', 'datalayer-container', container)
|
|
676
681
|
this.eachVisibleDataLayer((datalayer) => {
|
|
677
682
|
if (!datalayer.options.inCaption) return
|
|
678
683
|
const p = L.DomUtil.create('p', 'datalayer-legend', datalayerContainer),
|
|
679
684
|
legend = L.DomUtil.create('span', '', p),
|
|
680
|
-
headline = L.DomUtil.create('strong', '', p)
|
|
681
|
-
description = L.DomUtil.create('span', '', p)
|
|
685
|
+
headline = L.DomUtil.create('strong', '', p)
|
|
682
686
|
datalayer.onceLoaded(function () {
|
|
683
687
|
datalayer.renderLegend(legend)
|
|
684
688
|
if (datalayer.options.description) {
|
|
685
|
-
|
|
689
|
+
L.DomUtil.element({
|
|
690
|
+
tagName: 'span',
|
|
691
|
+
parent: p,
|
|
692
|
+
safeHTML: U.Utils.toHTML(datalayer.options.description),
|
|
693
|
+
})
|
|
686
694
|
}
|
|
687
695
|
})
|
|
688
696
|
datalayer.renderToolbox(headline)
|
|
@@ -692,12 +700,11 @@ const ControlsMixin = {
|
|
|
692
700
|
credits = L.DomUtil.createFieldset(creditsContainer, L._('Credits'))
|
|
693
701
|
title = L.DomUtil.add('h5', '', credits, L._('User content credits'))
|
|
694
702
|
if (this.options.shortCredit || this.options.longCredit) {
|
|
695
|
-
L.DomUtil.
|
|
696
|
-
'p',
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
)
|
|
703
|
+
L.DomUtil.element({
|
|
704
|
+
tagName: 'p',
|
|
705
|
+
parent: credits,
|
|
706
|
+
safeHTML: U.Utils.toHTML(this.options.longCredit || this.options.shortCredit),
|
|
707
|
+
})
|
|
701
708
|
}
|
|
702
709
|
if (this.options.licence) {
|
|
703
710
|
const licence = L.DomUtil.add(
|
|
@@ -715,24 +722,27 @@ const ControlsMixin = {
|
|
|
715
722
|
} else {
|
|
716
723
|
L.DomUtil.add('p', '', credits, L._('No licence has been set'))
|
|
717
724
|
}
|
|
718
|
-
L.DomUtil.create('hr', '', credits)
|
|
719
725
|
title = L.DomUtil.create('h5', '', credits)
|
|
720
726
|
title.textContent = L._('Map background credits')
|
|
721
|
-
const tilelayerCredit = L.DomUtil.create('p', '', credits)
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
727
|
+
const tilelayerCredit = L.DomUtil.create('p', '', credits)
|
|
728
|
+
L.DomUtil.element({
|
|
729
|
+
tagName: 'strong',
|
|
730
|
+
parent: tilelayerCredit,
|
|
731
|
+
textContent: `${this.selected_tilelayer.options.name} `,
|
|
732
|
+
})
|
|
733
|
+
L.DomUtil.element({
|
|
734
|
+
tagName: 'span',
|
|
735
|
+
parent: tilelayerCredit,
|
|
736
|
+
safeHTML: this.selected_tilelayer.getAttribution(),
|
|
737
|
+
})
|
|
738
|
+
const urls = {
|
|
739
|
+
leaflet: 'http://leafletjs.com',
|
|
740
|
+
django: 'https://www.djangoproject.com',
|
|
741
|
+
umap: 'http://wiki.openstreetmap.org/wiki/UMap',
|
|
742
|
+
changelog: 'https://umap-project.readthedocs.io/en/master/changelog/',
|
|
743
|
+
version: this.options.umap_version,
|
|
744
|
+
}
|
|
745
|
+
const creditHTML = L._(
|
|
736
746
|
`
|
|
737
747
|
Powered by <a href="{leaflet}">Leaflet</a> and
|
|
738
748
|
<a href="{django}">Django</a>,
|
|
@@ -741,6 +751,7 @@ const ControlsMixin = {
|
|
|
741
751
|
`,
|
|
742
752
|
urls
|
|
743
753
|
)
|
|
754
|
+
L.DomUtil.element({ tagName: 'p', innerHTML: creditHTML, parent: credits })
|
|
744
755
|
this.panel.open({ content: container })
|
|
745
756
|
},
|
|
746
757
|
|
|
@@ -754,13 +765,7 @@ const ControlsMixin = {
|
|
|
754
765
|
const rightContainer = L.DomUtil.create('div', 'umap-right-edit-toolbox', container)
|
|
755
766
|
const logo = L.DomUtil.create('div', 'logo', leftContainer)
|
|
756
767
|
L.DomUtil.createLink('', logo, 'uMap', '/', null, L._('Go to the homepage'))
|
|
757
|
-
const nameButton = L.DomUtil.createButton(
|
|
758
|
-
'map-name',
|
|
759
|
-
leftContainer,
|
|
760
|
-
'',
|
|
761
|
-
this.edit,
|
|
762
|
-
this
|
|
763
|
-
)
|
|
768
|
+
const nameButton = L.DomUtil.createButton('map-name', leftContainer, '')
|
|
764
769
|
L.DomEvent.on(
|
|
765
770
|
nameButton,
|
|
766
771
|
'mouseover',
|
|
@@ -809,7 +814,7 @@ const ControlsMixin = {
|
|
|
809
814
|
update()
|
|
810
815
|
this.once('saved', L.bind(update, this))
|
|
811
816
|
if (this.options.editMode === 'advanced') {
|
|
812
|
-
L.DomEvent.on(nameButton, 'click', this.
|
|
817
|
+
L.DomEvent.on(nameButton, 'click', this.editCaption, this)
|
|
813
818
|
L.DomEvent.on(shareStatusButton, 'click', this.permissions.edit, this.permissions)
|
|
814
819
|
}
|
|
815
820
|
this.on('postsync', L.bind(update, this))
|
|
@@ -1052,16 +1057,16 @@ U.AttributionControl = L.Control.Attribution.extend({
|
|
|
1052
1057
|
// Use our own container, so we can hide/show on small screens
|
|
1053
1058
|
const credits = this._container.innerHTML
|
|
1054
1059
|
this._container.innerHTML = ''
|
|
1055
|
-
const container = L.DomUtil.
|
|
1056
|
-
|
|
1057
|
-
'attribution-container',
|
|
1058
|
-
this._container,
|
|
1059
|
-
credits
|
|
1060
|
-
)
|
|
1060
|
+
const container = L.DomUtil.create('div', 'attribution-container', this._container)
|
|
1061
|
+
container.innerHTML = credits
|
|
1061
1062
|
const shortCredit = this._map.getOption('shortCredit'),
|
|
1062
1063
|
captionMenus = this._map.getOption('captionMenus')
|
|
1063
1064
|
if (shortCredit) {
|
|
1064
|
-
L.DomUtil.
|
|
1065
|
+
L.DomUtil.element({
|
|
1066
|
+
tagName: 'span',
|
|
1067
|
+
parent: container,
|
|
1068
|
+
safeHTML: ` — ${U.Utils.toHTML(shortCredit)}`,
|
|
1069
|
+
})
|
|
1065
1070
|
}
|
|
1066
1071
|
if (captionMenus) {
|
|
1067
1072
|
const link = L.DomUtil.add('a', '', container, ` — ${L._('About')}`)
|
umap/static/umap/js/umap.core.js
CHANGED
|
@@ -118,19 +118,21 @@ L.DomUtil.createLink = (className, container, content, url, target, title) => {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
L.DomUtil.createIcon = (parent, className, title, size = 16) => {
|
|
121
|
-
return L.DomUtil.element(
|
|
122
|
-
'i',
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
return L.DomUtil.element({
|
|
122
|
+
tagName: 'i',
|
|
123
|
+
parent: parent,
|
|
124
|
+
className: `icon icon-${size} ${className}`,
|
|
125
|
+
title: title || '',
|
|
126
|
+
})
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
L.DomUtil.createButtonIcon = (parent, className, title, size = 16) => {
|
|
129
|
-
return L.DomUtil.element(
|
|
130
|
-
'button',
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
return L.DomUtil.element({
|
|
131
|
+
tagName: 'button',
|
|
132
|
+
parent: parent,
|
|
133
|
+
className: `icon icon-${size} ${className}`,
|
|
134
|
+
title: title || '',
|
|
135
|
+
})
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
L.DomUtil.createTitle = (parent, text, className, tag = 'h3') => {
|
|
@@ -163,8 +165,13 @@ L.DomUtil.classIf = (el, className, bool) => {
|
|
|
163
165
|
else L.DomUtil.removeClass(el, className)
|
|
164
166
|
}
|
|
165
167
|
|
|
166
|
-
L.DomUtil.element = (
|
|
167
|
-
const el = document.createElement(
|
|
168
|
+
L.DomUtil.element = ({ tagName, parent, ...attrs }) => {
|
|
169
|
+
const el = document.createElement(tagName)
|
|
170
|
+
if (attrs.innerHTML) {
|
|
171
|
+
attrs.innerHTML = U.Utils.escapeHTML(attrs.innerHTML)
|
|
172
|
+
} else if (attrs.safeHTML) {
|
|
173
|
+
attrs.innerHTML = attrs.safeHTML
|
|
174
|
+
}
|
|
168
175
|
for (const attr in attrs) {
|
|
169
176
|
el[attr] = attrs[attr]
|
|
170
177
|
}
|
|
@@ -314,6 +321,14 @@ U.Help = L.Class.extend({
|
|
|
314
321
|
shortcut: 'Modifier+S',
|
|
315
322
|
label: L._('Save current edits'),
|
|
316
323
|
},
|
|
324
|
+
EDIT_FEATURE_LAYER: {
|
|
325
|
+
shortcut: 'Modifier+⇧+Click',
|
|
326
|
+
label: L._("Edit feature's layer"),
|
|
327
|
+
},
|
|
328
|
+
CONTINUE_LINE: {
|
|
329
|
+
shortcut: 'Modifier+Click',
|
|
330
|
+
label: L._('Continue line'),
|
|
331
|
+
},
|
|
317
332
|
},
|
|
318
333
|
|
|
319
334
|
displayLabel: function (action, withKbdTag = true) {
|
|
@@ -448,7 +448,7 @@ U.FeatureMixin = {
|
|
|
448
448
|
}
|
|
449
449
|
items = items.concat(
|
|
450
450
|
{
|
|
451
|
-
text:
|
|
451
|
+
text: this.map.help.displayLabel('EDIT_FEATURE_LAYER'),
|
|
452
452
|
callback: this.datalayer.edit,
|
|
453
453
|
context: this.datalayer,
|
|
454
454
|
iconCls: 'umap-edit',
|
|
@@ -1055,7 +1055,7 @@ U.Polyline = L.Polyline.extend({
|
|
|
1055
1055
|
})
|
|
1056
1056
|
} else if (index === 0 || index === e.vertex.getLastIndex()) {
|
|
1057
1057
|
items.push({
|
|
1058
|
-
text:
|
|
1058
|
+
text: this.map.help.displayLabel('CONTINUE_LINE'),
|
|
1059
1059
|
callback: e.vertex.continue,
|
|
1060
1060
|
context: e.vertex.continue,
|
|
1061
1061
|
})
|
|
@@ -475,7 +475,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
|
475
475
|
build: function () {
|
|
476
476
|
L.FormBuilder.BlurInput.prototype.build.call(this)
|
|
477
477
|
this.buttons = L.DomUtil.create('div', '', this.parentNode)
|
|
478
|
-
this.tabs = L.DomUtil.create('div', '
|
|
478
|
+
this.tabs = L.DomUtil.create('div', 'flat-tabs', this.parentNode)
|
|
479
479
|
this.body = L.DomUtil.create('div', 'umap-pictogram-body', this.parentNode)
|
|
480
480
|
this.footer = L.DomUtil.create('div', '', this.parentNode)
|
|
481
481
|
this.updatePreview()
|
|
@@ -757,12 +757,15 @@ L.FormBuilder.FacetSearchChoices = L.FormBuilder.Element.extend({
|
|
|
757
757
|
},
|
|
758
758
|
|
|
759
759
|
buildLabel: function () {
|
|
760
|
-
this.label = L.DomUtil.element(
|
|
760
|
+
this.label = L.DomUtil.element({
|
|
761
|
+
tagName: 'legend',
|
|
762
|
+
textContent: this.options.label,
|
|
763
|
+
})
|
|
761
764
|
},
|
|
762
765
|
|
|
763
766
|
buildLi: function (value) {
|
|
764
767
|
const property_li = L.DomUtil.create('li', '', this.ul)
|
|
765
|
-
const label = L.DomUtil.
|
|
768
|
+
const label = L.DomUtil.create('label', '', property_li)
|
|
766
769
|
const input = L.DomUtil.create('input', '', label)
|
|
767
770
|
L.DomUtil.add('span', '', label, value)
|
|
768
771
|
|
|
@@ -800,14 +803,14 @@ L.FormBuilder.MinMaxBase = L.FormBuilder.Element.extend({
|
|
|
800
803
|
build: function () {
|
|
801
804
|
this.container = L.DomUtil.create('fieldset', 'umap-facet', this.parentNode)
|
|
802
805
|
this.container.appendChild(this.label)
|
|
803
|
-
const {min, max, type} = this.options.criteria
|
|
806
|
+
const { min, max, type } = this.options.criteria
|
|
804
807
|
this.type = type
|
|
805
808
|
this.inputType = this.getInputType(this.type)
|
|
806
809
|
|
|
807
810
|
const [minLabel, maxLabel] = this.getLabels()
|
|
808
811
|
|
|
809
812
|
this.minLabel = L.DomUtil.create('label', '', this.container)
|
|
810
|
-
this.minLabel.
|
|
813
|
+
this.minLabel.textContent = minLabel
|
|
811
814
|
|
|
812
815
|
this.minInput = L.DomUtil.create('input', '', this.minLabel)
|
|
813
816
|
this.minInput.type = this.inputType
|
|
@@ -817,9 +820,8 @@ L.FormBuilder.MinMaxBase = L.FormBuilder.Element.extend({
|
|
|
817
820
|
this.minInput.dataset.value = min
|
|
818
821
|
}
|
|
819
822
|
|
|
820
|
-
|
|
821
823
|
this.maxLabel = L.DomUtil.create('label', '', this.container)
|
|
822
|
-
this.maxLabel.
|
|
824
|
+
this.maxLabel.textContent = maxLabel
|
|
823
825
|
|
|
824
826
|
this.maxInput = L.DomUtil.create('input', '', this.maxLabel)
|
|
825
827
|
this.maxInput.type = this.inputType
|
|
@@ -834,7 +836,10 @@ L.FormBuilder.MinMaxBase = L.FormBuilder.Element.extend({
|
|
|
834
836
|
},
|
|
835
837
|
|
|
836
838
|
buildLabel: function () {
|
|
837
|
-
this.label = L.DomUtil.element(
|
|
839
|
+
this.label = L.DomUtil.element({
|
|
840
|
+
tagName: 'legend',
|
|
841
|
+
textContent: this.options.label,
|
|
842
|
+
})
|
|
838
843
|
},
|
|
839
844
|
|
|
840
845
|
toJS: function () {
|
|
@@ -974,22 +979,23 @@ L.FormBuilder.Range = L.FormBuilder.FloatInput.extend({
|
|
|
974
979
|
},
|
|
975
980
|
|
|
976
981
|
buildHelpText: function () {
|
|
977
|
-
const datalist = L.DomUtil.create(
|
|
978
|
-
'datalist',
|
|
979
|
-
'umap-field-datalist',
|
|
980
|
-
this.getHelpTextParent()
|
|
981
|
-
)
|
|
982
|
-
datalist.id = `range-${this.options.label || this.name}`
|
|
983
|
-
this.input.setAttribute('list', datalist.id)
|
|
984
982
|
let options = ''
|
|
985
|
-
const step = this.options.step || 1
|
|
986
|
-
|
|
983
|
+
const step = this.options.step || 1
|
|
984
|
+
const digits = step < 1 ? 1 : 0
|
|
985
|
+
const id = `range-${this.options.label || this.name}`
|
|
987
986
|
for (let i = this.options.min; i <= this.options.max; i += this.options.step) {
|
|
988
987
|
options += `<option value="${i.toFixed(digits)}" label="${i.toFixed(
|
|
989
988
|
digits
|
|
990
989
|
)}"></option>`
|
|
991
990
|
}
|
|
992
|
-
datalist
|
|
991
|
+
const datalist = L.DomUtil.element({
|
|
992
|
+
tagName: 'datalist',
|
|
993
|
+
parent: this.getHelpTextParent(),
|
|
994
|
+
className: 'umap-field-datalist',
|
|
995
|
+
safeHTML: options,
|
|
996
|
+
id: id,
|
|
997
|
+
})
|
|
998
|
+
this.input.setAttribute('list', id)
|
|
993
999
|
L.FormBuilder.Input.prototype.buildHelpText.call(this)
|
|
994
1000
|
},
|
|
995
1001
|
})
|