umap-project 3.4.0b2__py3-none-any.whl → 3.4.0b3__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/locale/da/LC_MESSAGES/django.mo +0 -0
- umap/locale/da/LC_MESSAGES/django.po +2 -2
- umap/locale/en/LC_MESSAGES/django.po +14 -14
- umap/migrations/0018_datalayer_uuid.py +1 -1
- umap/models.py +1 -1
- umap/settings/local.py.sample +1 -1
- umap/static/umap/css/form.css +2 -2
- umap/static/umap/js/components/base.js +1 -1
- umap/static/umap/js/modules/browser.js +4 -4
- umap/static/umap/js/modules/data/features.js +1 -1
- umap/static/umap/js/modules/data/fields.js +280 -0
- umap/static/umap/js/modules/data/layer.js +6 -8
- umap/static/umap/js/modules/domutils.js +3 -3
- umap/static/umap/js/modules/filters.js +7 -7
- umap/static/umap/js/modules/help.js +1 -1
- umap/static/umap/js/modules/i18n.js +1 -1
- umap/static/umap/js/modules/importer.js +1 -1
- umap/static/umap/js/modules/managers.js +0 -264
- umap/static/umap/js/modules/rendering/controls.js +4 -2
- umap/static/umap/js/modules/rendering/layers/classified.js +1 -1
- umap/static/umap/js/modules/rendering/layers/heat.js +26 -21
- umap/static/umap/js/modules/rendering/template.js +4 -4
- umap/static/umap/js/modules/ui/dialog.js +10 -1
- umap/static/umap/js/modules/ui/panel.js +2 -2
- umap/static/umap/js/modules/umap.js +9 -4
- umap/static/umap/js/modules/utils.js +1 -1
- umap/static/umap/locale/am_ET.js +14 -5
- umap/static/umap/locale/am_ET.json +14 -5
- umap/static/umap/locale/ar.js +14 -5
- umap/static/umap/locale/ar.json +14 -5
- umap/static/umap/locale/ast.js +14 -5
- umap/static/umap/locale/ast.json +14 -5
- umap/static/umap/locale/bg.js +14 -5
- umap/static/umap/locale/bg.json +14 -5
- umap/static/umap/locale/br.js +1 -1
- umap/static/umap/locale/br.json +1 -1
- umap/static/umap/locale/ca.js +14 -5
- umap/static/umap/locale/ca.json +14 -5
- umap/static/umap/locale/cs_CZ.js +14 -5
- umap/static/umap/locale/cs_CZ.json +14 -5
- umap/static/umap/locale/da.js +48 -39
- umap/static/umap/locale/da.json +48 -39
- umap/static/umap/locale/de.js +14 -5
- umap/static/umap/locale/de.json +14 -5
- umap/static/umap/locale/el.js +14 -5
- umap/static/umap/locale/el.json +14 -5
- umap/static/umap/locale/en.js +14 -5
- umap/static/umap/locale/en.json +14 -5
- umap/static/umap/locale/en_US.json +14 -5
- umap/static/umap/locale/es.js +49 -40
- umap/static/umap/locale/es.json +49 -40
- umap/static/umap/locale/et.js +14 -5
- umap/static/umap/locale/et.json +14 -5
- umap/static/umap/locale/eu.js +14 -5
- umap/static/umap/locale/eu.json +14 -5
- umap/static/umap/locale/fa_IR.js +14 -5
- umap/static/umap/locale/fa_IR.json +14 -5
- umap/static/umap/locale/fi.js +14 -5
- umap/static/umap/locale/fi.json +14 -5
- umap/static/umap/locale/fr.js +14 -5
- umap/static/umap/locale/fr.json +14 -5
- umap/static/umap/locale/gl.js +14 -5
- umap/static/umap/locale/gl.json +14 -5
- umap/static/umap/locale/he.js +14 -5
- umap/static/umap/locale/he.json +14 -5
- umap/static/umap/locale/hr.js +14 -5
- umap/static/umap/locale/hr.json +14 -5
- umap/static/umap/locale/hu.js +56 -47
- umap/static/umap/locale/hu.json +56 -47
- umap/static/umap/locale/id.js +14 -5
- umap/static/umap/locale/id.json +14 -5
- umap/static/umap/locale/is.js +14 -5
- umap/static/umap/locale/is.json +14 -5
- umap/static/umap/locale/it.js +14 -5
- umap/static/umap/locale/it.json +14 -5
- umap/static/umap/locale/ja.js +14 -5
- umap/static/umap/locale/ja.json +14 -5
- umap/static/umap/locale/ko.js +14 -5
- umap/static/umap/locale/ko.json +14 -5
- umap/static/umap/locale/lt.js +14 -5
- umap/static/umap/locale/lt.json +14 -5
- umap/static/umap/locale/ms.js +14 -5
- umap/static/umap/locale/ms.json +14 -5
- umap/static/umap/locale/nl.js +14 -5
- umap/static/umap/locale/nl.json +14 -5
- umap/static/umap/locale/no.js +14 -5
- umap/static/umap/locale/no.json +14 -5
- umap/static/umap/locale/pl.js +14 -5
- umap/static/umap/locale/pl.json +14 -5
- umap/static/umap/locale/pl_PL.json +14 -5
- umap/static/umap/locale/pt.js +14 -5
- umap/static/umap/locale/pt.json +14 -5
- umap/static/umap/locale/pt_BR.js +14 -5
- umap/static/umap/locale/pt_BR.json +14 -5
- umap/static/umap/locale/pt_PT.js +14 -5
- umap/static/umap/locale/pt_PT.json +14 -5
- umap/static/umap/locale/ro.js +14 -5
- umap/static/umap/locale/ro.json +14 -5
- umap/static/umap/locale/ru.js +14 -5
- umap/static/umap/locale/ru.json +14 -5
- umap/static/umap/locale/si.js +1 -1
- umap/static/umap/locale/si.json +1 -1
- umap/static/umap/locale/sk_SK.js +14 -5
- umap/static/umap/locale/sk_SK.json +14 -5
- umap/static/umap/locale/sl.js +14 -5
- umap/static/umap/locale/sl.json +14 -5
- umap/static/umap/locale/sr.js +14 -5
- umap/static/umap/locale/sr.json +14 -5
- umap/static/umap/locale/sv.js +14 -5
- umap/static/umap/locale/sv.json +14 -5
- umap/static/umap/locale/th_TH.js +14 -5
- umap/static/umap/locale/th_TH.json +14 -5
- umap/static/umap/locale/tr.js +14 -5
- umap/static/umap/locale/tr.json +14 -5
- umap/static/umap/locale/uk_UA.js +14 -5
- umap/static/umap/locale/uk_UA.json +14 -5
- umap/static/umap/locale/vi.js +14 -5
- umap/static/umap/locale/vi.json +14 -5
- umap/static/umap/locale/vi_VN.json +14 -5
- umap/static/umap/locale/zh.js +14 -5
- umap/static/umap/locale/zh.json +14 -5
- umap/static/umap/locale/zh_CN.json +14 -5
- umap/static/umap/locale/zh_TW.Big5.json +14 -5
- umap/static/umap/locale/zh_TW.js +47 -38
- umap/static/umap/locale/zh_TW.json +47 -38
- umap/templates/umap/login_popup_end.html +2 -2
- umap/tests/integration/conftest.py +8 -0
- umap/tests/integration/test_anonymous_owned_map.py +1 -1
- umap/tests/integration/test_conditional_rules.py +1 -1
- umap/tests/integration/test_filters.py +6 -7
- umap/tests/integration/test_map_preview.py +1 -1
- umap/tests/integration/test_picto.py +1 -1
- umap/tests/integration/test_save.py +1 -1
- umap/tests/integration/test_websocket_sync.py +63 -19
- umap/tests/test_dashboard.py +1 -1
- umap/tests/test_statics.py +2 -2
- umap/tests/test_views.py +1 -1
- umap/utils.py +1 -1
- {umap_project-3.4.0b2.dist-info → umap_project-3.4.0b3.dist-info}/METADATA +4 -4
- {umap_project-3.4.0b2.dist-info → umap_project-3.4.0b3.dist-info}/RECORD +144 -143
- {umap_project-3.4.0b2.dist-info → umap_project-3.4.0b3.dist-info}/WHEEL +0 -0
- {umap_project-3.4.0b2.dist-info → umap_project-3.4.0b3.dist-info}/entry_points.txt +0 -0
- {umap_project-3.4.0b2.dist-info → umap_project-3.4.0b3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import * as Utils from './utils.js'
|
|
2
|
-
import { translate } from './i18n.js'
|
|
3
|
-
import Orderable from './orderable.js'
|
|
4
|
-
import { uMapAlert as Alert } from '../components/alerts/alert.js'
|
|
5
|
-
import { Form } from './form/builder.js'
|
|
6
2
|
|
|
7
3
|
export class DataLayerManager extends Object {
|
|
8
4
|
add(datalayer) {
|
|
@@ -116,263 +112,3 @@ export class FeatureManager extends Map {
|
|
|
116
112
|
return this.all()[index - 1]
|
|
117
113
|
}
|
|
118
114
|
}
|
|
119
|
-
|
|
120
|
-
export class FieldManager extends Map {
|
|
121
|
-
constructor(parent, dialog) {
|
|
122
|
-
super()
|
|
123
|
-
this.parent = parent
|
|
124
|
-
this.dialog = dialog
|
|
125
|
-
this.parent.properties.fields ??= []
|
|
126
|
-
this.pull()
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
pull() {
|
|
130
|
-
this.clear()
|
|
131
|
-
for (const field of this.parent.properties.fields) {
|
|
132
|
-
this.add(field)
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
push() {
|
|
137
|
-
this.parent.properties.fields = this.all().map((field) => {
|
|
138
|
-
// We don't want to keep the reference, otherwise editing
|
|
139
|
-
// it will also change the old value
|
|
140
|
-
return { ...field }
|
|
141
|
-
})
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
async commit() {
|
|
145
|
-
return new Promise((resolve) => {
|
|
146
|
-
const oldFields = Utils.CopyJSON(this.parent.properties.fields)
|
|
147
|
-
resolve()
|
|
148
|
-
this.push()
|
|
149
|
-
this.parent.sync.update(
|
|
150
|
-
'properties.fields',
|
|
151
|
-
this.parent.properties.fields,
|
|
152
|
-
oldFields
|
|
153
|
-
)
|
|
154
|
-
})
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
add(field) {
|
|
158
|
-
if (!field?.key) {
|
|
159
|
-
console.error('Invalid field', field)
|
|
160
|
-
return
|
|
161
|
-
}
|
|
162
|
-
field.type ??= 'String'
|
|
163
|
-
// Copy object, so not to affect original
|
|
164
|
-
// when edited.
|
|
165
|
-
this.set(field.key, { ...field })
|
|
166
|
-
this.push()
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
delete(key) {
|
|
170
|
-
super.delete(key)
|
|
171
|
-
this.push()
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
all() {
|
|
175
|
-
return Array.from(this.values())
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
edit(container) {
|
|
179
|
-
const [root, { ul, add, manageFilters }] = Utils.loadTemplateWithRefs(`
|
|
180
|
-
<details id="fields-management">
|
|
181
|
-
<summary><h4>${translate('Manage Fields')}</h4></summary>
|
|
182
|
-
<fieldset>
|
|
183
|
-
<ul data-ref=ul></ul>
|
|
184
|
-
<div class="button-bar half">
|
|
185
|
-
<button type="button" data-ref=add>${translate('Add a new field')}</button>
|
|
186
|
-
<button type="button" data-ref="manageFilters">${translate('Manage filters')}</button>
|
|
187
|
-
</div>
|
|
188
|
-
</fieldset>
|
|
189
|
-
</details>
|
|
190
|
-
`)
|
|
191
|
-
container.appendChild(root)
|
|
192
|
-
add.hidden = this.parent.isRemoteLayer?.()
|
|
193
|
-
add.addEventListener('click', () => {
|
|
194
|
-
this.editField().then(() => {
|
|
195
|
-
this.parent.edit().then((panel) => {
|
|
196
|
-
panel.scrollTo('details#fields-management')
|
|
197
|
-
})
|
|
198
|
-
})
|
|
199
|
-
})
|
|
200
|
-
manageFilters.addEventListener('click', () => this.parent.filters.edit())
|
|
201
|
-
for (const field of this.all()) {
|
|
202
|
-
const [row, { edit, del, addFilter, editFilter }] = Utils.loadTemplateWithRefs(
|
|
203
|
-
`<li class="orderable with-toolbox" data-key="${field.key}">
|
|
204
|
-
<span>
|
|
205
|
-
<i class="icon icon-16 icon-field-${field.type}" title="${field.type}"></i>
|
|
206
|
-
${field.key}
|
|
207
|
-
</span>
|
|
208
|
-
<span>
|
|
209
|
-
<button class="icon icon-16 icon-edit" title="${translate('Edit this field')}" data-ref=edit></button>
|
|
210
|
-
<button class="icon icon-16 icon-filters" title="${translate('Edit filter')}" data-ref=editFilter></button>
|
|
211
|
-
<button class="icon icon-16 icon-filters-empty" title="${translate('Add a filter for this field')}" data-ref=addFilter></button>
|
|
212
|
-
<button class="icon icon-16 icon-delete" title="${translate('Delete this field')}" data-ref=del></button>
|
|
213
|
-
<i class="icon icon-16 icon-drag" title="${translate('Drag to reorder')}"></i>
|
|
214
|
-
</span>
|
|
215
|
-
</li>`
|
|
216
|
-
)
|
|
217
|
-
editFilter.hidden = !this.parent.filters.has(field.key)
|
|
218
|
-
addFilter.hidden = this.parent.filters.has(field.key)
|
|
219
|
-
del.hidden = this.parent.isRemoteLayer?.()
|
|
220
|
-
editFilter.addEventListener('click', () =>
|
|
221
|
-
this.parent.filters.createFilterForm(field.key)
|
|
222
|
-
)
|
|
223
|
-
addFilter.addEventListener('click', () =>
|
|
224
|
-
this.parent.filters.createFilterForm(field.key)
|
|
225
|
-
)
|
|
226
|
-
ul.appendChild(row)
|
|
227
|
-
edit.addEventListener('click', () => {
|
|
228
|
-
this.editField(field.key).then(() => {
|
|
229
|
-
this.parent.edit().then((panel) => {
|
|
230
|
-
panel.scrollTo('details#fields-management')
|
|
231
|
-
})
|
|
232
|
-
})
|
|
233
|
-
})
|
|
234
|
-
del.addEventListener('click', () => {
|
|
235
|
-
this.confirmDelete(field.key).then(() => {
|
|
236
|
-
this.parent.edit().then((panel) => {
|
|
237
|
-
panel.scrollTo('details#fields-management')
|
|
238
|
-
})
|
|
239
|
-
})
|
|
240
|
-
})
|
|
241
|
-
}
|
|
242
|
-
const onReorder = (src, dst, initialIndex, finalIndex) => {
|
|
243
|
-
const orderedKeys = Array.from(ul.querySelectorAll('li')).map(
|
|
244
|
-
(el) => el.dataset.key
|
|
245
|
-
)
|
|
246
|
-
const oldFields = Utils.CopyJSON(this.parent.properties.fields)
|
|
247
|
-
const copy = Object.fromEntries(this)
|
|
248
|
-
this.clear()
|
|
249
|
-
for (const key of orderedKeys) {
|
|
250
|
-
this.add(copy[key])
|
|
251
|
-
}
|
|
252
|
-
this.parent.sync.update(
|
|
253
|
-
'properties.fields',
|
|
254
|
-
this.parent.properties.fields,
|
|
255
|
-
oldFields
|
|
256
|
-
)
|
|
257
|
-
}
|
|
258
|
-
const orderable = new Orderable(ul, onReorder)
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
async editField(name) {
|
|
262
|
-
if (!name && this.parent.isRemoteLayer?.()) return
|
|
263
|
-
const FIELD_TYPES = [
|
|
264
|
-
'String',
|
|
265
|
-
'Text',
|
|
266
|
-
'Number',
|
|
267
|
-
'Date',
|
|
268
|
-
'Datetime',
|
|
269
|
-
'Enum',
|
|
270
|
-
'Boolean',
|
|
271
|
-
]
|
|
272
|
-
const field = this.get(name) || {}
|
|
273
|
-
const metadatas = [
|
|
274
|
-
[
|
|
275
|
-
'key',
|
|
276
|
-
{
|
|
277
|
-
handler: 'BlurInput',
|
|
278
|
-
label: translate('Field Name'),
|
|
279
|
-
disabled: this.parent.isRemoteLayer?.(),
|
|
280
|
-
},
|
|
281
|
-
],
|
|
282
|
-
[
|
|
283
|
-
'type',
|
|
284
|
-
{
|
|
285
|
-
handler: 'Select',
|
|
286
|
-
selectOptions: FIELD_TYPES,
|
|
287
|
-
label: translate('Field Type'),
|
|
288
|
-
},
|
|
289
|
-
],
|
|
290
|
-
]
|
|
291
|
-
const form = new Form(field, metadatas)
|
|
292
|
-
|
|
293
|
-
const [container, { body, addFilter }] = Utils.loadTemplateWithRefs(`
|
|
294
|
-
<div>
|
|
295
|
-
<h3>${translate('Manage field')}</h3>
|
|
296
|
-
<div data-ref=body></div>
|
|
297
|
-
<button type="button" data-ref=addFilter hidden><i class="icon icon-16 icon-filters"></i>${translate('Add filter for this field')}</button>
|
|
298
|
-
</div>
|
|
299
|
-
`)
|
|
300
|
-
body.appendChild(form.build())
|
|
301
|
-
if (this.parent.filters) {
|
|
302
|
-
addFilter.addEventListener('click', () => {
|
|
303
|
-
this.dialog.accept()
|
|
304
|
-
this.parent.filters.createFilterForm(field.key)
|
|
305
|
-
})
|
|
306
|
-
addFilter.hidden = false
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
return this.dialog.open({ template: container }).then(() => {
|
|
310
|
-
if (!this.validateName(field.key, field.key !== name)) {
|
|
311
|
-
this.pull()
|
|
312
|
-
return
|
|
313
|
-
}
|
|
314
|
-
this.parent.sync.startBatch()
|
|
315
|
-
const oldFields = Utils.CopyJSON(this.parent.properties.fields)
|
|
316
|
-
if (!name) {
|
|
317
|
-
this.add(field)
|
|
318
|
-
} else if (name !== field.key) {
|
|
319
|
-
this.clear()
|
|
320
|
-
// Keep order on rename
|
|
321
|
-
for (const old of oldFields) {
|
|
322
|
-
if (old.key === name) {
|
|
323
|
-
this.add(field)
|
|
324
|
-
} else {
|
|
325
|
-
this.add(old)
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
this.parent.renameField(name, field.key)
|
|
329
|
-
} else {
|
|
330
|
-
this.push()
|
|
331
|
-
}
|
|
332
|
-
this.parent.sync.update(
|
|
333
|
-
'properties.fields',
|
|
334
|
-
this.parent.properties.fields,
|
|
335
|
-
oldFields
|
|
336
|
-
)
|
|
337
|
-
this.parent.sync.commitBatch()
|
|
338
|
-
this.parent.render(['properties.fields'])
|
|
339
|
-
})
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
validateName(name, isNew = false) {
|
|
343
|
-
if (!name) {
|
|
344
|
-
Alert.error(translate('Name cannot be empty.'))
|
|
345
|
-
return false
|
|
346
|
-
}
|
|
347
|
-
if (name.includes('.')) {
|
|
348
|
-
Alert.error(translate('Name “{name}” should not contain a dot.', { name }))
|
|
349
|
-
return false
|
|
350
|
-
}
|
|
351
|
-
if (isNew && this.has(name)) {
|
|
352
|
-
Alert.error(translate('This name already exists: “{name}”', { name }))
|
|
353
|
-
return false
|
|
354
|
-
}
|
|
355
|
-
return true
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
async confirmDelete(name) {
|
|
359
|
-
return this.dialog
|
|
360
|
-
.confirm(translate('Are you sure you want to delete this field on all the data?'))
|
|
361
|
-
.then(() => {
|
|
362
|
-
this.parent.sync.startBatch()
|
|
363
|
-
const oldFields = Utils.CopyJSON(this.parent.properties.fields)
|
|
364
|
-
this.delete(name)
|
|
365
|
-
this.push()
|
|
366
|
-
if (this.parent.filters.has(name)) {
|
|
367
|
-
this.parent.filters.remove(name)
|
|
368
|
-
}
|
|
369
|
-
this.parent.deleteField(name)
|
|
370
|
-
this.parent.sync.update(
|
|
371
|
-
'properties.fields',
|
|
372
|
-
this.parent.properties.fields,
|
|
373
|
-
oldFields
|
|
374
|
-
)
|
|
375
|
-
this.parent.sync.commitBatch()
|
|
376
|
-
})
|
|
377
|
-
}
|
|
378
|
-
}
|
|
@@ -112,7 +112,9 @@ export const PermanentCreditsControl = Control.extend({
|
|
|
112
112
|
const container = Utils.loadTemplate(
|
|
113
113
|
`<div class="umap-permanent-credits-container text">${Utils.toHTML(map.options.permanentCredit)}</div>`
|
|
114
114
|
)
|
|
115
|
-
const background = map.
|
|
115
|
+
const background = map._umap.getProperty('permanentCreditBackground')
|
|
116
|
+
? '#FFFFFFB0'
|
|
117
|
+
: ''
|
|
116
118
|
container.style.backgroundColor = background
|
|
117
119
|
return container
|
|
118
120
|
},
|
|
@@ -164,7 +166,7 @@ export const DataLayersControl = BaseButton.extend({
|
|
|
164
166
|
},
|
|
165
167
|
|
|
166
168
|
afterAdd: function (container) {
|
|
167
|
-
Utils.toggleBadge(container, this._umap.browser?.
|
|
169
|
+
Utils.toggleBadge(container, this._umap.browser?.hasActiveFilters())
|
|
168
170
|
},
|
|
169
171
|
|
|
170
172
|
onClick: function () {
|
|
@@ -7,7 +7,7 @@ import { CircleMarker } from '../ui.js'
|
|
|
7
7
|
import { LayerMixin } from './base.js'
|
|
8
8
|
|
|
9
9
|
// Layer where each feature color is relative to the others,
|
|
10
|
-
// so we need all features before
|
|
10
|
+
// so we need all features before being able to set one
|
|
11
11
|
// feature layer
|
|
12
12
|
const ClassifiedMixin = {
|
|
13
13
|
initialize: function (datalayer) {
|
|
@@ -68,27 +68,32 @@ export const Heat = L.HeatLayer.extend({
|
|
|
68
68
|
return latLngBounds(this._latlngs)
|
|
69
69
|
},
|
|
70
70
|
|
|
71
|
-
getEditableProperties: ()
|
|
72
|
-
[
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
71
|
+
getEditableProperties: function () {
|
|
72
|
+
return [
|
|
73
|
+
[
|
|
74
|
+
'properties.heat.radius',
|
|
75
|
+
{
|
|
76
|
+
handler: 'Range',
|
|
77
|
+
min: 10,
|
|
78
|
+
max: 100,
|
|
79
|
+
step: 5,
|
|
80
|
+
label: translate('Heatmap radius'),
|
|
81
|
+
helpText: translate('Override heatmap radius (default 25)'),
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
[
|
|
85
|
+
'properties.heat.intensityProperty',
|
|
86
|
+
{
|
|
87
|
+
handler: 'Select',
|
|
88
|
+
selectOptions: [
|
|
89
|
+
['', translate('Select field to compute intensity')],
|
|
90
|
+
...this.datalayer.fields.keys(),
|
|
91
|
+
],
|
|
92
|
+
helpText: translate('Optional intensity field to compute heatmap'),
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
]
|
|
96
|
+
},
|
|
92
97
|
|
|
93
98
|
onEdit: function (field, builder) {
|
|
94
99
|
if (field === 'properties.heat.intensityProperty') {
|
|
@@ -126,11 +126,11 @@ class Table extends TitleMixin(PopupTemplate) {
|
|
|
126
126
|
async renderBody(feature) {
|
|
127
127
|
const table = document.createElement('table')
|
|
128
128
|
|
|
129
|
-
for (const
|
|
130
|
-
if (
|
|
129
|
+
for (const field of feature.fields) {
|
|
130
|
+
if (U.LABEL_KEYS.includes(field.key)) {
|
|
131
131
|
continue
|
|
132
132
|
}
|
|
133
|
-
table.appendChild(this.makeRow(feature, key))
|
|
133
|
+
table.appendChild(this.makeRow(feature, field.key))
|
|
134
134
|
}
|
|
135
135
|
return table
|
|
136
136
|
}
|
|
@@ -193,7 +193,7 @@ class OSM extends PopupTemplate {
|
|
|
193
193
|
const row = DomUtil.add('address', 'address', body)
|
|
194
194
|
const number = props['addr:housenumber']
|
|
195
195
|
if (number) {
|
|
196
|
-
// Poor way to deal with international forms of
|
|
196
|
+
// Poor way to deal with international forms of writing addresses
|
|
197
197
|
DomUtil.add('span', '', row, `${translate('No.')}: ${number}`)
|
|
198
198
|
DomUtil.add('span', '', row, `${translate('Street')}: ${street}`)
|
|
199
199
|
} else {
|
|
@@ -161,7 +161,16 @@ export default class Dialog extends WithTemplate {
|
|
|
161
161
|
|
|
162
162
|
accept() {
|
|
163
163
|
this.dialog.returnValue = 'accept'
|
|
164
|
-
|
|
164
|
+
return new Promise((resolve) => {
|
|
165
|
+
this.dialog.addEventListener(
|
|
166
|
+
'close',
|
|
167
|
+
() => {
|
|
168
|
+
resolve()
|
|
169
|
+
},
|
|
170
|
+
{ once: true }
|
|
171
|
+
)
|
|
172
|
+
this.close()
|
|
173
|
+
})
|
|
165
174
|
}
|
|
166
175
|
|
|
167
176
|
waitForUser() {
|
|
@@ -7,7 +7,7 @@ export class Panel {
|
|
|
7
7
|
this._umap = umap
|
|
8
8
|
this._leafletMap = leafletMap
|
|
9
9
|
this.container = DomUtil.create('div', '', this.parent)
|
|
10
|
-
// This will be set once according to the panel
|
|
10
|
+
// This will be set once according to the panel configured at load
|
|
11
11
|
// or by using panels as popups
|
|
12
12
|
this.mode = null
|
|
13
13
|
this.className = 'left'
|
|
@@ -67,7 +67,7 @@ export class Panel {
|
|
|
67
67
|
})
|
|
68
68
|
.catch(() => {
|
|
69
69
|
// Panel has been removed, so the DOM has changed, so the animations
|
|
70
|
-
// were cancelled, we want the new panel
|
|
70
|
+
// were cancelled, we want the new panel callback to be called anyway.
|
|
71
71
|
resolve(this)
|
|
72
72
|
})
|
|
73
73
|
this.container.classList.add('on')
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import Browser from './browser.js'
|
|
11
11
|
import Caption from './caption.js'
|
|
12
12
|
import { DataLayer } from './data/layer.js'
|
|
13
|
+
import { Fields } from './data/fields.js'
|
|
13
14
|
import { Filters, migrateLegacyFilters } from './filters.js'
|
|
14
15
|
import { MutatingForm } from './form/builder.js'
|
|
15
16
|
import { Formatter } from './formatter.js'
|
|
@@ -33,7 +34,7 @@ import Tooltip from './ui/tooltip.js'
|
|
|
33
34
|
import URLs from './urls.js'
|
|
34
35
|
import * as Utils from './utils.js'
|
|
35
36
|
import * as DOMUtils from './domutils.js'
|
|
36
|
-
import { DataLayerManager
|
|
37
|
+
import { DataLayerManager } from './managers.js'
|
|
37
38
|
import { Importer as OpenRouteService } from './importers/openrouteservice.js'
|
|
38
39
|
|
|
39
40
|
export default class Umap {
|
|
@@ -133,7 +134,7 @@ export default class Umap {
|
|
|
133
134
|
this.contextmenu = new ContextMenu()
|
|
134
135
|
this.server = new ServerRequest()
|
|
135
136
|
this.request = new Request()
|
|
136
|
-
this.fields = new
|
|
137
|
+
this.fields = new Fields(this, this.dialog)
|
|
137
138
|
this.filters = new Filters(this, this)
|
|
138
139
|
this.browser = new Browser(this, this._leafletMap)
|
|
139
140
|
this.caption = new Caption(this, this._leafletMap)
|
|
@@ -389,6 +390,10 @@ export default class Umap {
|
|
|
389
390
|
}
|
|
390
391
|
|
|
391
392
|
hasFilters() {
|
|
393
|
+
return this.filters.size || this.datalayers.active().some((d) => d.filters.size)
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
hasActiveFilters() {
|
|
392
397
|
return (
|
|
393
398
|
this.filters.isActive() ||
|
|
394
399
|
this.datalayers.active().some((d) => d.filters.isActive())
|
|
@@ -1224,7 +1229,7 @@ export default class Umap {
|
|
|
1224
1229
|
if (error) {
|
|
1225
1230
|
return
|
|
1226
1231
|
}
|
|
1227
|
-
//
|
|
1232
|
+
// TODO: map.save may not always be the first call during save process
|
|
1228
1233
|
// since SAVEMANAGER refactor
|
|
1229
1234
|
if (data.login_required) {
|
|
1230
1235
|
this.askForLogin().then(() => this.saveAll())
|
|
@@ -1457,7 +1462,7 @@ export default class Umap {
|
|
|
1457
1462
|
}
|
|
1458
1463
|
|
|
1459
1464
|
// This method does a targeted update of the UI,
|
|
1460
|
-
// it
|
|
1465
|
+
// it would be merged with `render`` method and the
|
|
1461
1466
|
// SCHEMA at some point
|
|
1462
1467
|
propagate(fields = []) {
|
|
1463
1468
|
const impacts = {
|
|
@@ -40,7 +40,7 @@ function _getPropertyName(field) {
|
|
|
40
40
|
* Return an array of unique impacts.
|
|
41
41
|
*
|
|
42
42
|
* @param {fields} list[fields]
|
|
43
|
-
* @param object schema object. If
|
|
43
|
+
* @param object schema object. If omitted, global U.SCHEMA will be used.
|
|
44
44
|
* @returns Array[string]
|
|
45
45
|
*/
|
|
46
46
|
export function getImpactsFromSchema(fields, schema) {
|
umap/static/umap/locale/am_ET.js
CHANGED
|
@@ -70,7 +70,7 @@ const locale = {
|
|
|
70
70
|
"color": "ከለር",
|
|
71
71
|
"Comma separated list of numbers, including min and max values.": "Comma separated list of numbers, including min and max values.",
|
|
72
72
|
"Comma separated list of properties to use for sorting features. To reverse the sort, put a minus sign (-) before. Eg. mykey,-otherkey.": "Comma separated list of properties to use for sorting features. To reverse the sort, put a minus sign (-) before. Eg. mykey,-otherkey.",
|
|
73
|
-
"Comma, tab or semi-colon separated values. SRS WGS84 is implied. Only Point geometries are imported. The import will look at the column headers for any mention of «lat» and «lon» at the
|
|
73
|
+
"Comma, tab or semi-colon separated values. SRS WGS84 is implied. Only Point geometries are imported. The import will look at the column headers for any mention of «lat» and «lon» at the beginning of the header, case insensitive. All other column are imported as properties.": "Comma, tab or semi-colon separated values. SRS WGS84 is implied. Only Point geometries are imported. The import will look at the column headers for any mention of «lat» and «lon» at the beginning of the header, case insensitive. All other column are imported as properties.",
|
|
74
74
|
"Congratulations, your map has been created!": "Congratulations, your map has been created!",
|
|
75
75
|
"Continue line": "መስመሩን ቀጥል",
|
|
76
76
|
"Coordinates": "ኮርዲኔቶች",
|
|
@@ -159,7 +159,6 @@ const locale = {
|
|
|
159
159
|
"Go to \"{coords}\"": "Go to \"{coords}\"",
|
|
160
160
|
"Go to the homepage": "Go to the homepage",
|
|
161
161
|
"Go to «{feature}»": "ወደ «{feature}» ተመለስ",
|
|
162
|
-
"Heatmap intensity property": "የሙቀት ካርታ ኢንቴንሲቲ ባህርይ",
|
|
163
162
|
"Heatmap radius": "የሙቀት ካርታ ራዲየስ",
|
|
164
163
|
"Heatmap": "የሙቀት ካርታ",
|
|
165
164
|
"height": "ቁመት",
|
|
@@ -255,7 +254,6 @@ const locale = {
|
|
|
255
254
|
"Open share & download panel": "Open share & download panel",
|
|
256
255
|
"Open this map extent in a map editor to provide more accurate data to OpenStreetMap": "ለOpernStreetMap ይበልጥ ትክክል ይሆነ መረጃ ለመስጠ የካርታውን ኤክስቴንት በካርታ ማረሚያ ክፈት",
|
|
257
256
|
"OpenStreetMap": "OpenStreetMap",
|
|
258
|
-
"Optional intensity property for heatmap": "ለሙቀት ካርታው ባህርይ አማራጭ ኢንቴንሲቲ",
|
|
259
257
|
"Optional. Same as color if not set.": "አማራጭ፣ ካልተመረጠለት እንደቀለሙ የሚሆን",
|
|
260
258
|
"Optional.": "Optional.",
|
|
261
259
|
"Override clustering radius (default 80)": "የራዲየስ ክለስተሪንግ አልፈህ ሂድ (ዲፎልት 80)",
|
|
@@ -631,7 +629,6 @@ const locale = {
|
|
|
631
629
|
"Are you sure you want to delete this field on all the data?": "Are you sure you want to delete this field on all the data?",
|
|
632
630
|
"Anonymous map": "Anonymous map",
|
|
633
631
|
"Edit filter for this field": "Edit filter for this field",
|
|
634
|
-
"Fields, filters and keys": "Fields, filters and keys",
|
|
635
632
|
"Hey, you created a map without an account!": "Hey, you created a map without an account!",
|
|
636
633
|
"This map is anonymous, do you want to attach it to your account?": "This map is anonymous, do you want to attach it to your account?",
|
|
637
634
|
"The map has been upgraded to latest version, please save it.": "The map has been upgraded to latest version, please save it.",
|
|
@@ -641,7 +638,19 @@ const locale = {
|
|
|
641
638
|
"Wikipedia contributors": "Wikipedia contributors",
|
|
642
639
|
"See on Wikipedia": "See on Wikipedia",
|
|
643
640
|
"Anonymous map: update who can see and edit it": "Anonymous map: update who can see and edit it",
|
|
644
|
-
"Login": "Login"
|
|
641
|
+
"Login": "Login",
|
|
642
|
+
"Manage filters": "Manage filters",
|
|
643
|
+
"Map (all layers)": "Map (all layers)",
|
|
644
|
+
"Add a filter for this field": "Add a filter for this field",
|
|
645
|
+
"Short text": "Short text",
|
|
646
|
+
"Text": "Text",
|
|
647
|
+
"Number": "Number",
|
|
648
|
+
"Date": "Date",
|
|
649
|
+
"Date and time": "Date and time",
|
|
650
|
+
"List of values": "List of values",
|
|
651
|
+
"Yes / No": "Yes / No",
|
|
652
|
+
"Select field to compute intensity": "Select field to compute intensity",
|
|
653
|
+
"Optional intensity field to compute heatmap": "Optional intensity field to compute heatmap"
|
|
645
654
|
}
|
|
646
655
|
L.registerLocale("am_ET", locale)
|
|
647
656
|
L.setLocale("am_ET")
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"color": "ከለር",
|
|
71
71
|
"Comma separated list of numbers, including min and max values.": "Comma separated list of numbers, including min and max values.",
|
|
72
72
|
"Comma separated list of properties to use for sorting features. To reverse the sort, put a minus sign (-) before. Eg. mykey,-otherkey.": "Comma separated list of properties to use for sorting features. To reverse the sort, put a minus sign (-) before. Eg. mykey,-otherkey.",
|
|
73
|
-
"Comma, tab or semi-colon separated values. SRS WGS84 is implied. Only Point geometries are imported. The import will look at the column headers for any mention of «lat» and «lon» at the
|
|
73
|
+
"Comma, tab or semi-colon separated values. SRS WGS84 is implied. Only Point geometries are imported. The import will look at the column headers for any mention of «lat» and «lon» at the beginning of the header, case insensitive. All other column are imported as properties.": "Comma, tab or semi-colon separated values. SRS WGS84 is implied. Only Point geometries are imported. The import will look at the column headers for any mention of «lat» and «lon» at the beginning of the header, case insensitive. All other column are imported as properties.",
|
|
74
74
|
"Congratulations, your map has been created!": "Congratulations, your map has been created!",
|
|
75
75
|
"Continue line": "መስመሩን ቀጥል",
|
|
76
76
|
"Coordinates": "ኮርዲኔቶች",
|
|
@@ -159,7 +159,6 @@
|
|
|
159
159
|
"Go to \"{coords}\"": "Go to \"{coords}\"",
|
|
160
160
|
"Go to the homepage": "Go to the homepage",
|
|
161
161
|
"Go to «{feature}»": "ወደ «{feature}» ተመለስ",
|
|
162
|
-
"Heatmap intensity property": "የሙቀት ካርታ ኢንቴንሲቲ ባህርይ",
|
|
163
162
|
"Heatmap radius": "የሙቀት ካርታ ራዲየስ",
|
|
164
163
|
"Heatmap": "የሙቀት ካርታ",
|
|
165
164
|
"height": "ቁመት",
|
|
@@ -255,7 +254,6 @@
|
|
|
255
254
|
"Open share & download panel": "Open share & download panel",
|
|
256
255
|
"Open this map extent in a map editor to provide more accurate data to OpenStreetMap": "ለOpernStreetMap ይበልጥ ትክክል ይሆነ መረጃ ለመስጠ የካርታውን ኤክስቴንት በካርታ ማረሚያ ክፈት",
|
|
257
256
|
"OpenStreetMap": "OpenStreetMap",
|
|
258
|
-
"Optional intensity property for heatmap": "ለሙቀት ካርታው ባህርይ አማራጭ ኢንቴንሲቲ",
|
|
259
257
|
"Optional. Same as color if not set.": "አማራጭ፣ ካልተመረጠለት እንደቀለሙ የሚሆን",
|
|
260
258
|
"Optional.": "Optional.",
|
|
261
259
|
"Override clustering radius (default 80)": "የራዲየስ ክለስተሪንግ አልፈህ ሂድ (ዲፎልት 80)",
|
|
@@ -631,7 +629,6 @@
|
|
|
631
629
|
"Are you sure you want to delete this field on all the data?": "Are you sure you want to delete this field on all the data?",
|
|
632
630
|
"Anonymous map": "Anonymous map",
|
|
633
631
|
"Edit filter for this field": "Edit filter for this field",
|
|
634
|
-
"Fields, filters and keys": "Fields, filters and keys",
|
|
635
632
|
"Hey, you created a map without an account!": "Hey, you created a map without an account!",
|
|
636
633
|
"This map is anonymous, do you want to attach it to your account?": "This map is anonymous, do you want to attach it to your account?",
|
|
637
634
|
"The map has been upgraded to latest version, please save it.": "The map has been upgraded to latest version, please save it.",
|
|
@@ -641,5 +638,17 @@
|
|
|
641
638
|
"Wikipedia contributors": "Wikipedia contributors",
|
|
642
639
|
"See on Wikipedia": "See on Wikipedia",
|
|
643
640
|
"Anonymous map: update who can see and edit it": "Anonymous map: update who can see and edit it",
|
|
644
|
-
"Login": "Login"
|
|
641
|
+
"Login": "Login",
|
|
642
|
+
"Manage filters": "Manage filters",
|
|
643
|
+
"Map (all layers)": "Map (all layers)",
|
|
644
|
+
"Add a filter for this field": "Add a filter for this field",
|
|
645
|
+
"Short text": "Short text",
|
|
646
|
+
"Text": "Text",
|
|
647
|
+
"Number": "Number",
|
|
648
|
+
"Date": "Date",
|
|
649
|
+
"Date and time": "Date and time",
|
|
650
|
+
"List of values": "List of values",
|
|
651
|
+
"Yes / No": "Yes / No",
|
|
652
|
+
"Select field to compute intensity": "Select field to compute intensity",
|
|
653
|
+
"Optional intensity field to compute heatmap": "Optional intensity field to compute heatmap"
|
|
645
654
|
}
|
umap/static/umap/locale/ar.js
CHANGED
|
@@ -70,7 +70,7 @@ const locale = {
|
|
|
70
70
|
"color": "لون",
|
|
71
71
|
"Comma separated list of numbers, including min and max values.": "Comma separated list of numbers, including min and max values.",
|
|
72
72
|
"Comma separated list of properties to use for sorting features. To reverse the sort, put a minus sign (-) before. Eg. mykey,-otherkey.": "Comma separated list of properties to use for sorting features. To reverse the sort, put a minus sign (-) before. Eg. mykey,-otherkey.",
|
|
73
|
-
"Comma, tab or semi-colon separated values. SRS WGS84 is implied. Only Point geometries are imported. The import will look at the column headers for any mention of «lat» and «lon» at the
|
|
73
|
+
"Comma, tab or semi-colon separated values. SRS WGS84 is implied. Only Point geometries are imported. The import will look at the column headers for any mention of «lat» and «lon» at the beginning of the header, case insensitive. All other column are imported as properties.": "Comma, tab or semi-colon separated values. SRS WGS84 is implied. Only Point geometries are imported. The import will look at the column headers for any mention of «lat» and «lon» at the beginning of the header, case insensitive. All other column are imported as properties.",
|
|
74
74
|
"Congratulations, your map has been created!": "Congratulations, your map has been created!",
|
|
75
75
|
"Continue line": "واصل الخط",
|
|
76
76
|
"Coordinates": "Coordinates",
|
|
@@ -159,7 +159,6 @@ const locale = {
|
|
|
159
159
|
"Go to \"{coords}\"": "Go to \"{coords}\"",
|
|
160
160
|
"Go to the homepage": "Go to the homepage",
|
|
161
161
|
"Go to «{feature}»": "Go to «{feature}»",
|
|
162
|
-
"Heatmap intensity property": "Heatmap intensity property",
|
|
163
162
|
"Heatmap radius": "Heatmap radius",
|
|
164
163
|
"Heatmap": "Heatmap",
|
|
165
164
|
"height": "height",
|
|
@@ -255,7 +254,6 @@ const locale = {
|
|
|
255
254
|
"Open share & download panel": "Open share & download panel",
|
|
256
255
|
"Open this map extent in a map editor to provide more accurate data to OpenStreetMap": "Open this map extent in a map editor to provide more accurate data to OpenStreetMap",
|
|
257
256
|
"OpenStreetMap": "OpenStreetMap",
|
|
258
|
-
"Optional intensity property for heatmap": "Optional intensity property for heatmap",
|
|
259
257
|
"Optional. Same as color if not set.": "Optional. Same as color if not set.",
|
|
260
258
|
"Optional.": "Optional.",
|
|
261
259
|
"Override clustering radius (default 80)": "Override clustering radius (default 80)",
|
|
@@ -631,7 +629,6 @@ const locale = {
|
|
|
631
629
|
"Are you sure you want to delete this field on all the data?": "Are you sure you want to delete this field on all the data?",
|
|
632
630
|
"Anonymous map": "Anonymous map",
|
|
633
631
|
"Edit filter for this field": "Edit filter for this field",
|
|
634
|
-
"Fields, filters and keys": "Fields, filters and keys",
|
|
635
632
|
"Hey, you created a map without an account!": "Hey, you created a map without an account!",
|
|
636
633
|
"This map is anonymous, do you want to attach it to your account?": "This map is anonymous, do you want to attach it to your account?",
|
|
637
634
|
"The map has been upgraded to latest version, please save it.": "The map has been upgraded to latest version, please save it.",
|
|
@@ -641,7 +638,19 @@ const locale = {
|
|
|
641
638
|
"Wikipedia contributors": "Wikipedia contributors",
|
|
642
639
|
"See on Wikipedia": "See on Wikipedia",
|
|
643
640
|
"Anonymous map: update who can see and edit it": "Anonymous map: update who can see and edit it",
|
|
644
|
-
"Login": "Login"
|
|
641
|
+
"Login": "Login",
|
|
642
|
+
"Manage filters": "Manage filters",
|
|
643
|
+
"Map (all layers)": "Map (all layers)",
|
|
644
|
+
"Add a filter for this field": "Add a filter for this field",
|
|
645
|
+
"Short text": "Short text",
|
|
646
|
+
"Text": "Text",
|
|
647
|
+
"Number": "Number",
|
|
648
|
+
"Date": "Date",
|
|
649
|
+
"Date and time": "Date and time",
|
|
650
|
+
"List of values": "List of values",
|
|
651
|
+
"Yes / No": "Yes / No",
|
|
652
|
+
"Select field to compute intensity": "Select field to compute intensity",
|
|
653
|
+
"Optional intensity field to compute heatmap": "Optional intensity field to compute heatmap"
|
|
645
654
|
}
|
|
646
655
|
L.registerLocale("ar", locale)
|
|
647
656
|
L.setLocale("ar")
|