umap-project 3.4.0b1__py3-none-any.whl → 3.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.
- umap/__init__.py +1 -1
- umap/context_processors.py +1 -1
- umap/locale/da/LC_MESSAGES/django.mo +0 -0
- umap/locale/da/LC_MESSAGES/django.po +20 -16
- umap/locale/en/LC_MESSAGES/django.po +18 -14
- umap/locale/es/LC_MESSAGES/django.mo +0 -0
- umap/locale/es/LC_MESSAGES/django.po +20 -16
- umap/locale/fr/LC_MESSAGES/django.mo +0 -0
- umap/locale/fr/LC_MESSAGES/django.po +18 -14
- umap/locale/pl/LC_MESSAGES/django.mo +0 -0
- umap/locale/pl/LC_MESSAGES/django.po +72 -71
- umap/migrations/0018_datalayer_uuid.py +1 -1
- umap/models.py +7 -3
- umap/settings/local.py.sample +1 -1
- umap/static/umap/content.css +0 -3
- umap/static/umap/css/bar.css +9 -6
- umap/static/umap/css/form.css +27 -11
- umap/static/umap/css/popup.css +1 -0
- umap/static/umap/js/components/base.js +1 -1
- umap/static/umap/js/components/copiable.js +47 -0
- umap/static/umap/js/modules/autocomplete.js +31 -58
- umap/static/umap/js/modules/browser.js +8 -8
- umap/static/umap/js/modules/data/features.js +33 -36
- umap/static/umap/js/modules/data/fields.js +446 -0
- umap/static/umap/js/modules/data/layer.js +76 -93
- umap/static/umap/js/modules/domutils.js +24 -4
- umap/static/umap/js/modules/filters.js +20 -47
- umap/static/umap/js/modules/form/fields.js +4 -4
- umap/static/umap/js/modules/formatter.js +9 -1
- umap/static/umap/js/modules/help.js +13 -14
- umap/static/umap/js/modules/i18n.js +1 -1
- umap/static/umap/js/modules/importer.js +18 -27
- umap/static/umap/js/modules/importers/banfr.js +0 -1
- umap/static/umap/js/modules/importers/cadastrefr.js +19 -19
- umap/static/umap/js/modules/importers/communesfr.js +7 -8
- umap/static/umap/js/modules/importers/datasets.js +14 -14
- umap/static/umap/js/modules/importers/geodatamine.js +20 -22
- umap/static/umap/js/modules/importers/opendata.js +10 -0
- umap/static/umap/js/modules/importers/overpass.js +19 -18
- umap/static/umap/js/modules/managers.js +1 -265
- umap/static/umap/js/modules/permissions.js +5 -3
- umap/static/umap/js/modules/rendering/controls.js +6 -4
- umap/static/umap/js/modules/rendering/icon.js +5 -9
- umap/static/umap/js/modules/rendering/layers/base.js +1 -1
- umap/static/umap/js/modules/rendering/layers/classified.js +16 -11
- umap/static/umap/js/modules/rendering/layers/heat.js +27 -21
- umap/static/umap/js/modules/rendering/map.js +22 -22
- umap/static/umap/js/modules/rendering/popup.js +6 -3
- umap/static/umap/js/modules/rendering/template.js +31 -37
- umap/static/umap/js/modules/rendering/ui.js +1 -2
- umap/static/umap/js/modules/rules.js +34 -41
- umap/static/umap/js/modules/schema.js +0 -7
- umap/static/umap/js/modules/share.js +36 -69
- umap/static/umap/js/modules/slideshow.js +3 -3
- umap/static/umap/js/modules/tableeditor.js +0 -1
- umap/static/umap/js/modules/ui/bar.js +51 -32
- umap/static/umap/js/modules/ui/dialog.js +10 -1
- umap/static/umap/js/modules/ui/panel.js +28 -23
- umap/static/umap/js/modules/ui/tooltip.js +1 -1
- umap/static/umap/js/modules/umap.js +84 -84
- umap/static/umap/js/modules/utils.js +13 -4
- umap/static/umap/js/umap.controls.js +33 -14
- umap/static/umap/locale/am_ET.js +19 -8
- umap/static/umap/locale/am_ET.json +19 -8
- umap/static/umap/locale/ar.js +19 -8
- umap/static/umap/locale/ar.json +19 -8
- umap/static/umap/locale/ast.js +19 -8
- umap/static/umap/locale/ast.json +19 -8
- umap/static/umap/locale/bg.js +19 -8
- umap/static/umap/locale/bg.json +19 -8
- umap/static/umap/locale/br.js +20 -9
- umap/static/umap/locale/br.json +20 -9
- umap/static/umap/locale/ca.js +19 -8
- umap/static/umap/locale/ca.json +19 -8
- umap/static/umap/locale/cs_CZ.js +20 -9
- umap/static/umap/locale/cs_CZ.json +20 -9
- umap/static/umap/locale/da.js +54 -43
- umap/static/umap/locale/da.json +54 -43
- umap/static/umap/locale/de.js +44 -33
- umap/static/umap/locale/de.json +44 -33
- umap/static/umap/locale/el.js +20 -9
- umap/static/umap/locale/el.json +20 -9
- umap/static/umap/locale/en.js +20 -9
- umap/static/umap/locale/en.json +20 -9
- umap/static/umap/locale/en_US.json +19 -8
- umap/static/umap/locale/es.js +55 -44
- umap/static/umap/locale/es.json +55 -44
- umap/static/umap/locale/et.js +20 -9
- umap/static/umap/locale/et.json +20 -9
- umap/static/umap/locale/eu.js +25 -14
- umap/static/umap/locale/eu.json +25 -14
- umap/static/umap/locale/fa_IR.js +20 -9
- umap/static/umap/locale/fa_IR.json +20 -9
- umap/static/umap/locale/fi.js +19 -8
- umap/static/umap/locale/fi.json +19 -8
- umap/static/umap/locale/fr.js +21 -10
- umap/static/umap/locale/fr.json +21 -10
- umap/static/umap/locale/gl.js +147 -136
- umap/static/umap/locale/gl.json +147 -136
- umap/static/umap/locale/he.js +19 -8
- umap/static/umap/locale/he.json +19 -8
- umap/static/umap/locale/hr.js +19 -8
- umap/static/umap/locale/hr.json +19 -8
- umap/static/umap/locale/hu.js +62 -51
- umap/static/umap/locale/hu.json +62 -51
- umap/static/umap/locale/id.js +19 -8
- umap/static/umap/locale/id.json +19 -8
- umap/static/umap/locale/is.js +20 -9
- umap/static/umap/locale/is.json +20 -9
- umap/static/umap/locale/it.js +20 -9
- umap/static/umap/locale/it.json +20 -9
- umap/static/umap/locale/ja.js +19 -8
- umap/static/umap/locale/ja.json +19 -8
- umap/static/umap/locale/ko.js +19 -8
- umap/static/umap/locale/ko.json +19 -8
- umap/static/umap/locale/lt.js +19 -8
- umap/static/umap/locale/lt.json +19 -8
- umap/static/umap/locale/ms.js +20 -9
- umap/static/umap/locale/ms.json +20 -9
- umap/static/umap/locale/nl.js +20 -9
- umap/static/umap/locale/nl.json +20 -9
- umap/static/umap/locale/no.js +19 -8
- umap/static/umap/locale/no.json +19 -8
- umap/static/umap/locale/pl.js +56 -45
- umap/static/umap/locale/pl.json +56 -45
- umap/static/umap/locale/pl_PL.json +19 -8
- umap/static/umap/locale/pt.js +20 -9
- umap/static/umap/locale/pt.json +20 -9
- umap/static/umap/locale/pt_BR.js +19 -8
- umap/static/umap/locale/pt_BR.json +19 -8
- umap/static/umap/locale/pt_PT.js +19 -8
- umap/static/umap/locale/pt_PT.json +19 -8
- umap/static/umap/locale/ro.js +19 -8
- umap/static/umap/locale/ro.json +19 -8
- umap/static/umap/locale/ru.js +19 -8
- umap/static/umap/locale/ru.json +19 -8
- umap/static/umap/locale/si.js +1 -1
- umap/static/umap/locale/si.json +1 -1
- umap/static/umap/locale/sk_SK.js +19 -8
- umap/static/umap/locale/sk_SK.json +19 -8
- umap/static/umap/locale/sl.js +19 -8
- umap/static/umap/locale/sl.json +19 -8
- umap/static/umap/locale/sr.js +19 -8
- umap/static/umap/locale/sr.json +19 -8
- umap/static/umap/locale/sv.js +19 -8
- umap/static/umap/locale/sv.json +19 -8
- umap/static/umap/locale/th_TH.js +19 -8
- umap/static/umap/locale/th_TH.json +19 -8
- umap/static/umap/locale/tr.js +19 -8
- umap/static/umap/locale/tr.json +19 -8
- umap/static/umap/locale/uk_UA.js +19 -8
- umap/static/umap/locale/uk_UA.json +19 -8
- umap/static/umap/locale/vi.js +19 -8
- umap/static/umap/locale/vi.json +19 -8
- umap/static/umap/locale/vi_VN.json +19 -8
- umap/static/umap/locale/zh.js +19 -8
- umap/static/umap/locale/zh.json +19 -8
- umap/static/umap/locale/zh_CN.json +19 -8
- umap/static/umap/locale/zh_TW.Big5.json +19 -8
- umap/static/umap/locale/zh_TW.js +53 -42
- umap/static/umap/locale/zh_TW.json +53 -42
- umap/static/umap/map.css +8 -7
- umap/static/umap/unittests/utils.js +7 -7
- umap/templates/umap/content_footer.html +1 -0
- umap/templates/umap/css.html +0 -2
- umap/templates/umap/js.html +1 -3
- umap/templates/umap/login_popup_end.html +2 -2
- umap/tests/integration/conftest.py +11 -2
- umap/tests/integration/test_anonymous_owned_map.py +2 -2
- umap/tests/integration/test_conditional_rules.py +107 -52
- umap/tests/integration/test_draw_polygon.py +4 -0
- umap/tests/integration/test_draw_polyline.py +11 -0
- umap/tests/integration/test_edit_datalayer.py +1 -1
- umap/tests/integration/test_fields.py +19 -0
- umap/tests/integration/test_filters.py +6 -7
- umap/tests/integration/test_iframe.py +1 -1
- umap/tests/integration/test_import.py +23 -0
- umap/tests/integration/test_map.py +2 -2
- umap/tests/integration/test_map_preview.py +1 -1
- umap/tests/integration/test_owned_map.py +2 -2
- umap/tests/integration/test_picto.py +1 -1
- umap/tests/integration/test_popup.py +31 -0
- umap/tests/integration/test_remote_data.py +4 -4
- umap/tests/integration/test_save.py +1 -1
- umap/tests/integration/test_search.py +41 -0
- umap/tests/integration/test_share.py +2 -2
- umap/tests/integration/test_team.py +1 -1
- umap/tests/integration/test_websocket_sync.py +69 -20
- umap/tests/test_dashboard.py +1 -1
- umap/tests/test_statics.py +2 -2
- umap/tests/test_utils.py +4 -1
- umap/tests/test_views.py +1 -1
- umap/utils.py +3 -2
- {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/METADATA +17 -17
- {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/RECORD +198 -199
- umap/static/umap/js/umap.core.js +0 -93
- umap/static/umap/vendors/editinosm/Leaflet.EditInOSM.css +0 -46
- umap/static/umap/vendors/editinosm/Leaflet.EditInOSM.js +0 -240
- umap/static/umap/vendors/editinosm/edit-in-osm.png +0 -0
- {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/WHEEL +0 -0
- {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/entry_points.txt +0 -0
- {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DomEvent,
|
|
3
|
-
DomUtil,
|
|
4
|
-
Util,
|
|
5
|
-
setOptions,
|
|
6
|
-
} from '../../vendors/leaflet/leaflet-src.esm.js'
|
|
1
|
+
import { DomEvent, Util, setOptions } from '../../vendors/leaflet/leaflet-src.esm.js'
|
|
7
2
|
import { translate } from './i18n.js'
|
|
8
3
|
import { Request, ServerRequest } from './request.js'
|
|
9
4
|
import { escapeHTML, generateId } from './utils.js'
|
|
10
5
|
import * as Utils from './utils.js'
|
|
6
|
+
import * as DOMUtils from './domutils.js'
|
|
11
7
|
|
|
12
8
|
export class BaseAutocomplete {
|
|
13
9
|
constructor(parent, options) {
|
|
@@ -41,26 +37,18 @@ export class BaseAutocomplete {
|
|
|
41
37
|
}
|
|
42
38
|
|
|
43
39
|
createInput() {
|
|
44
|
-
this.input =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
name: this.options.name || 'autocomplete',
|
|
52
|
-
})
|
|
53
|
-
DomEvent.on(this.input, 'keydown', this.onKeyDown, this)
|
|
54
|
-
DomEvent.on(this.input, 'keyup', this.onKeyUp, this)
|
|
55
|
-
DomEvent.on(this.input, 'blur', this.onBlur, this)
|
|
40
|
+
this.input = DOMUtils.loadTemplate(`
|
|
41
|
+
<input type="text" placeholder="${this.options.placeholder}" autocomplete="off" class="${this.options.className}" name="${this.options.name || 'autocomplete'}">
|
|
42
|
+
`)
|
|
43
|
+
this.parent.appendChild(this.input)
|
|
44
|
+
this.input.addEventListener('keydown', (event) => this.onKeyDown(event))
|
|
45
|
+
this.input.addEventListener('keyup', (event) => this.onKeyUp(event))
|
|
46
|
+
this.input.addEventListener('blur', (event) => this.onBlur(event))
|
|
56
47
|
}
|
|
57
48
|
|
|
58
49
|
createContainer() {
|
|
59
|
-
this.container =
|
|
60
|
-
|
|
61
|
-
parent: document.body,
|
|
62
|
-
className: 'umap-autocomplete',
|
|
63
|
-
})
|
|
50
|
+
this.container = DOMUtils.loadTemplate('<ul class="umap-autocomplete"></ul>')
|
|
51
|
+
document.body.appendChild(this.container)
|
|
64
52
|
}
|
|
65
53
|
|
|
66
54
|
resizeContainer() {
|
|
@@ -167,20 +155,17 @@ export class BaseAutocomplete {
|
|
|
167
155
|
}
|
|
168
156
|
|
|
169
157
|
createResult(item) {
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
parent: this.container,
|
|
173
|
-
textContent: item.label,
|
|
174
|
-
})
|
|
158
|
+
const li = DOMUtils.loadTemplate(`<li>${item.label}</li>`)
|
|
159
|
+
this.container.appendChild(li)
|
|
175
160
|
const result = {
|
|
176
161
|
item: item,
|
|
177
|
-
el:
|
|
162
|
+
el: li,
|
|
178
163
|
}
|
|
179
|
-
|
|
164
|
+
li.addEventListener('mouseover', () => {
|
|
180
165
|
this.current = result
|
|
181
166
|
this.highlight()
|
|
182
167
|
})
|
|
183
|
-
|
|
168
|
+
li.addEventListener('mousedown', () => this.setChoice())
|
|
184
169
|
return result
|
|
185
170
|
}
|
|
186
171
|
|
|
@@ -202,8 +187,7 @@ export class BaseAutocomplete {
|
|
|
202
187
|
|
|
203
188
|
highlight() {
|
|
204
189
|
this.results.forEach((result, index) => {
|
|
205
|
-
|
|
206
|
-
else DomUtil.removeClass(result.el, 'on')
|
|
190
|
+
result.el.classList.toggle('on', index === this.current)
|
|
207
191
|
})
|
|
208
192
|
}
|
|
209
193
|
|
|
@@ -298,19 +282,15 @@ export const SingleMixin = (Base) =>
|
|
|
298
282
|
}
|
|
299
283
|
|
|
300
284
|
displaySelected(result) {
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
parent: result_el,
|
|
309
|
-
className: 'close',
|
|
310
|
-
textContent: '×',
|
|
311
|
-
})
|
|
285
|
+
const [root, { close }] = DOMUtils.loadTemplateWithRefs(`
|
|
286
|
+
<div class="with-toolbox">
|
|
287
|
+
${result.item.label}
|
|
288
|
+
<button type="button" class="icon icon-16 icon-close" title="${translate('Close')}" data-ref="close"></button>
|
|
289
|
+
</div>
|
|
290
|
+
`)
|
|
291
|
+
this.selectedContainer.appendChild(root)
|
|
312
292
|
this.input.style.display = 'none'
|
|
313
|
-
|
|
293
|
+
close.addEventListener('click', () => {
|
|
314
294
|
this.selectedContainer.innerHTML = ''
|
|
315
295
|
this.input.style.display = 'block'
|
|
316
296
|
this.options.on_unselect?.(result)
|
|
@@ -328,19 +308,12 @@ export const MultipleMixin = (Base) =>
|
|
|
328
308
|
}
|
|
329
309
|
|
|
330
310
|
displaySelected(result) {
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
tagName: 'span',
|
|
338
|
-
parent: result_el,
|
|
339
|
-
className: 'close',
|
|
340
|
-
textContent: '×',
|
|
341
|
-
})
|
|
342
|
-
DomEvent.on(close, 'click', () => {
|
|
343
|
-
this.selectedContainer.removeChild(result_el)
|
|
311
|
+
const [li, { close }] = DOMUtils.loadTemplateWithRefs(`
|
|
312
|
+
<li class="with-toolbox">${result.item.label} <button class="icon icon-16 icon-close" type="button" data-ref="close"></button></li>
|
|
313
|
+
`)
|
|
314
|
+
this.selectedContainer.appendChild(li)
|
|
315
|
+
close.addEventListener('click', () => {
|
|
316
|
+
this.selectedContainer.removeChild(li)
|
|
344
317
|
this.options.on_unselect?.(result)
|
|
345
318
|
})
|
|
346
319
|
this.hide()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DomEvent,
|
|
1
|
+
import { DomEvent, stamp } from '../../vendors/leaflet/leaflet-src.esm.js'
|
|
2
2
|
import { Form } from './form/builder.js'
|
|
3
3
|
import { EXPORT_FORMATS } from './formatter.js'
|
|
4
4
|
import { translate } from './i18n.js'
|
|
@@ -97,8 +97,8 @@ export default class Browser {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
toggleBadge() {
|
|
100
|
-
Utils.toggleBadge(this.filtersTitle, this.
|
|
101
|
-
Utils.toggleBadge('.umap-control-browse', this.
|
|
100
|
+
Utils.toggleBadge(this.filtersTitle, this.hasActiveFilters())
|
|
101
|
+
Utils.toggleBadge('.umap-control-browse', this.hasActiveFilters())
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
onFormChange() {
|
|
@@ -118,8 +118,8 @@ export default class Browser {
|
|
|
118
118
|
return !!document.querySelector('.on .umap-browser')
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
return !!this.options.filter || this._umap.
|
|
121
|
+
hasActiveFilters() {
|
|
122
|
+
return !!this.options.filter || this._umap.hasActiveFilters()
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
onMoveEnd() {
|
|
@@ -133,9 +133,9 @@ export default class Browser {
|
|
|
133
133
|
update() {
|
|
134
134
|
if (!this.isOpen()) return
|
|
135
135
|
this.dataContainer.innerHTML = ''
|
|
136
|
-
this._umap.datalayers.browsable()
|
|
136
|
+
for (const datalayer of this._umap.datalayers.browsable()) {
|
|
137
137
|
this.addDataLayer(datalayer, this.dataContainer)
|
|
138
|
-
}
|
|
138
|
+
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
open(mode) {
|
|
@@ -260,7 +260,7 @@ export default class Browser {
|
|
|
260
260
|
if (datalayer.isVisible()) allHidden = false
|
|
261
261
|
})
|
|
262
262
|
this._umap.datalayers.browsable().map((datalayer) => {
|
|
263
|
-
datalayer.
|
|
263
|
+
datalayer.autoVisibility = false
|
|
264
264
|
if (allHidden) {
|
|
265
265
|
datalayer.show()
|
|
266
266
|
} else {
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DomEvent,
|
|
3
|
-
DomUtil,
|
|
4
|
-
GeoJSON,
|
|
5
|
-
LineUtil,
|
|
6
|
-
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
|
1
|
+
import { GeoJSON, LineUtil } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
|
7
2
|
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
|
8
3
|
import { MutatingForm } from '../form/builder.js'
|
|
9
|
-
import { translate } from '../i18n.js'
|
|
4
|
+
import { translate, getLocale } from '../i18n.js'
|
|
10
5
|
import {
|
|
11
6
|
PREFERENCES as ORS_PREFERENCES,
|
|
12
7
|
PROFILES as ORS_PROFILES,
|
|
@@ -93,7 +88,7 @@ class Feature {
|
|
|
93
88
|
|
|
94
89
|
get fields() {
|
|
95
90
|
// Fields are user defined properties
|
|
96
|
-
return [...this.
|
|
91
|
+
return [...this._umap.fields.all(), ...this.datalayer.fields.all()]
|
|
97
92
|
}
|
|
98
93
|
|
|
99
94
|
setter(key, value) {
|
|
@@ -243,12 +238,11 @@ class Feature {
|
|
|
243
238
|
if (this._umap.editedFeature === this && !event?.force) return
|
|
244
239
|
// If this feature is active (popup open), let's close it.
|
|
245
240
|
this.deactivate()
|
|
246
|
-
const container =
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)
|
|
241
|
+
const container = DOMUtils.loadTemplate(`
|
|
242
|
+
<div class="umap-feature-container">
|
|
243
|
+
<h3><i class="icon icon-16 icon-${this.getClassName()}"></i> ${translate('Feature properties')}</h3>
|
|
244
|
+
</div>
|
|
245
|
+
`)
|
|
252
246
|
|
|
253
247
|
let builder = new MutatingForm(this, [
|
|
254
248
|
['datalayer', { handler: 'EditableDataLayerSwitcher' }],
|
|
@@ -260,17 +254,19 @@ class Feature {
|
|
|
260
254
|
const properties = []
|
|
261
255
|
for (const field of this.fields) {
|
|
262
256
|
const options = { handler: 'Input', label: field.key }
|
|
263
|
-
if (field.key === 'description' || field.
|
|
257
|
+
if (field.key === 'description' || field.TYPE === 'Text') {
|
|
264
258
|
options.handler = 'Textarea'
|
|
265
259
|
options.helpEntries = ['textFormatting']
|
|
266
|
-
} else if (field.
|
|
260
|
+
} else if (field.TYPE === 'Number') {
|
|
267
261
|
options.handler = 'FloatInput'
|
|
268
|
-
} else if (field.
|
|
262
|
+
} else if (field.TYPE === 'Date') {
|
|
269
263
|
options.handler = 'DateInput'
|
|
270
|
-
} else if (field.
|
|
264
|
+
} else if (field.TYPE === 'Datetime') {
|
|
271
265
|
options.handler = 'DateTimeInput'
|
|
272
|
-
} else if (field.
|
|
266
|
+
} else if (field.TYPE === 'Boolean') {
|
|
273
267
|
options.handler = 'Switch'
|
|
268
|
+
} else if (field.TYPE === 'Enum') {
|
|
269
|
+
options.helpText = translate('Comma separated list of values')
|
|
274
270
|
}
|
|
275
271
|
properties.push([`properties.${field.key}`, options])
|
|
276
272
|
}
|
|
@@ -331,7 +327,7 @@ class Feature {
|
|
|
331
327
|
let builder = new MutatingForm(this, optionsFields, {
|
|
332
328
|
id: 'umap-feature-shape-properties',
|
|
333
329
|
})
|
|
334
|
-
const shapeProperties =
|
|
330
|
+
const shapeProperties = DOMUtils.createFieldset(
|
|
335
331
|
container,
|
|
336
332
|
translate('Shape properties')
|
|
337
333
|
)
|
|
@@ -343,7 +339,7 @@ class Feature {
|
|
|
343
339
|
builder = new MutatingForm(this, advancedOptions, {
|
|
344
340
|
id: 'umap-feature-advanced-properties',
|
|
345
341
|
})
|
|
346
|
-
const advancedProperties =
|
|
342
|
+
const advancedProperties = DOMUtils.createFieldset(
|
|
347
343
|
container,
|
|
348
344
|
translate('Advanced properties')
|
|
349
345
|
)
|
|
@@ -351,7 +347,7 @@ class Feature {
|
|
|
351
347
|
|
|
352
348
|
const interactionOptions = this.getInteractionOptions()
|
|
353
349
|
builder = new MutatingForm(this, interactionOptions)
|
|
354
|
-
const popupFieldset =
|
|
350
|
+
const popupFieldset = DOMUtils.createFieldset(
|
|
355
351
|
container,
|
|
356
352
|
translate('Interaction options')
|
|
357
353
|
)
|
|
@@ -442,7 +438,7 @@ class Feature {
|
|
|
442
438
|
this.properties = Object.fromEntries(
|
|
443
439
|
Object.entries(geojson.properties || {}).map(this.cleanProperty)
|
|
444
440
|
)
|
|
445
|
-
this.properties._umap_options =
|
|
441
|
+
this.properties._umap_options = Object.assign(
|
|
446
442
|
{},
|
|
447
443
|
this.properties._storage_options,
|
|
448
444
|
this.properties._umap_options
|
|
@@ -514,8 +510,8 @@ class Feature {
|
|
|
514
510
|
}
|
|
515
511
|
|
|
516
512
|
cloneProperties() {
|
|
517
|
-
const properties =
|
|
518
|
-
properties._umap_options =
|
|
513
|
+
const properties = Object.assign({}, this.properties)
|
|
514
|
+
properties._umap_options = Object.assign({}, properties._umap_options)
|
|
519
515
|
if (Object.keys && Object.keys(properties._umap_options).length === 0) {
|
|
520
516
|
delete properties._umap_options // It can make a difference on big data sets
|
|
521
517
|
}
|
|
@@ -591,9 +587,10 @@ class Feature {
|
|
|
591
587
|
}
|
|
592
588
|
|
|
593
589
|
extendedProperties() {
|
|
590
|
+
console.trace()
|
|
594
591
|
// Include context properties
|
|
595
592
|
const properties = this._umap.getGeoContext()
|
|
596
|
-
const locale =
|
|
593
|
+
const locale = getLocale()
|
|
597
594
|
if (locale) properties.locale = locale
|
|
598
595
|
if (U.lang) properties.lang = U.lang
|
|
599
596
|
properties.rank = this.getRank() + 1
|
|
@@ -788,7 +785,7 @@ export class Point extends Feature {
|
|
|
788
785
|
]
|
|
789
786
|
const builder = new MutatingForm(this, coordinatesOptions)
|
|
790
787
|
builder.on('set', () => {
|
|
791
|
-
if (!this.ui._latlng
|
|
788
|
+
if (!Utils.LatLngIsValid(this.ui._latlng)) {
|
|
792
789
|
Alert.error(translate('Invalid latitude or longitude'))
|
|
793
790
|
builder.restoreField('ui._latlng.lat')
|
|
794
791
|
builder.restoreField('ui._latlng.lng')
|
|
@@ -796,7 +793,7 @@ export class Point extends Feature {
|
|
|
796
793
|
this.pullGeometry()
|
|
797
794
|
this.zoomTo({ easing: false })
|
|
798
795
|
})
|
|
799
|
-
const fieldset =
|
|
796
|
+
const fieldset = DOMUtils.createFieldset(container, translate('Coordinates'))
|
|
800
797
|
fieldset.appendChild(builder.build())
|
|
801
798
|
}
|
|
802
799
|
|
|
@@ -964,7 +961,7 @@ class Path extends Feature {
|
|
|
964
961
|
const builder = new MutatingForm(this, options, {
|
|
965
962
|
id: 'umap-feature-line-decoration',
|
|
966
963
|
})
|
|
967
|
-
const fieldset =
|
|
964
|
+
const fieldset = DOMUtils.createFieldset(container, translate('Line decoration'))
|
|
968
965
|
fieldset.appendChild(builder.build())
|
|
969
966
|
}
|
|
970
967
|
}
|
|
@@ -1077,7 +1074,7 @@ export class LineString extends Path {
|
|
|
1077
1074
|
getAdvancedEditActions(container) {
|
|
1078
1075
|
super.getAdvancedEditActions(container)
|
|
1079
1076
|
const button = Utils.loadTemplate(`
|
|
1080
|
-
<button
|
|
1077
|
+
<button type="button"><i class="icon icon-24 icon-polygon"></i>${translate('Transform to polygon')}</button>
|
|
1081
1078
|
`)
|
|
1082
1079
|
container.appendChild(button)
|
|
1083
1080
|
button.addEventListener('click', () => this.toPolygon())
|
|
@@ -1383,13 +1380,13 @@ export class Polygon extends Path {
|
|
|
1383
1380
|
|
|
1384
1381
|
getAdvancedEditActions(container) {
|
|
1385
1382
|
super.getAdvancedEditActions(container)
|
|
1386
|
-
const toLineString =
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
this.toLineString,
|
|
1391
|
-
this
|
|
1383
|
+
const toLineString = DOMUtils.loadTemplate(
|
|
1384
|
+
`<button type="button" class="umap-to-polyline">
|
|
1385
|
+
<i class="icon icon-24 icon-polyline"></i>${translate('Transform to lines')}
|
|
1386
|
+
</button>`
|
|
1392
1387
|
)
|
|
1388
|
+
container.appendChild(toLineString)
|
|
1389
|
+
toLineString.addEventListener('click', () => this.toLineString())
|
|
1393
1390
|
}
|
|
1394
1391
|
|
|
1395
1392
|
isMulti() {
|