umap-project 3.4.0b1__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.
Files changed (146) hide show
  1. umap/__init__.py +1 -1
  2. umap/context_processors.py +1 -1
  3. umap/locale/da/LC_MESSAGES/django.mo +0 -0
  4. umap/locale/da/LC_MESSAGES/django.po +2 -2
  5. umap/locale/en/LC_MESSAGES/django.po +14 -14
  6. umap/migrations/0018_datalayer_uuid.py +1 -1
  7. umap/models.py +7 -3
  8. umap/settings/local.py.sample +1 -1
  9. umap/static/umap/css/form.css +2 -2
  10. umap/static/umap/js/components/base.js +1 -1
  11. umap/static/umap/js/modules/browser.js +4 -4
  12. umap/static/umap/js/modules/data/features.js +1 -1
  13. umap/static/umap/js/modules/data/fields.js +280 -0
  14. umap/static/umap/js/modules/data/layer.js +7 -9
  15. umap/static/umap/js/modules/domutils.js +3 -3
  16. umap/static/umap/js/modules/filters.js +7 -7
  17. umap/static/umap/js/modules/help.js +1 -1
  18. umap/static/umap/js/modules/i18n.js +1 -1
  19. umap/static/umap/js/modules/importer.js +1 -1
  20. umap/static/umap/js/modules/managers.js +0 -264
  21. umap/static/umap/js/modules/rendering/controls.js +4 -2
  22. umap/static/umap/js/modules/rendering/layers/classified.js +1 -1
  23. umap/static/umap/js/modules/rendering/layers/heat.js +26 -21
  24. umap/static/umap/js/modules/rendering/template.js +4 -4
  25. umap/static/umap/js/modules/ui/dialog.js +10 -1
  26. umap/static/umap/js/modules/ui/panel.js +2 -2
  27. umap/static/umap/js/modules/umap.js +9 -4
  28. umap/static/umap/js/modules/utils.js +1 -1
  29. umap/static/umap/locale/am_ET.js +14 -5
  30. umap/static/umap/locale/am_ET.json +14 -5
  31. umap/static/umap/locale/ar.js +14 -5
  32. umap/static/umap/locale/ar.json +14 -5
  33. umap/static/umap/locale/ast.js +14 -5
  34. umap/static/umap/locale/ast.json +14 -5
  35. umap/static/umap/locale/bg.js +14 -5
  36. umap/static/umap/locale/bg.json +14 -5
  37. umap/static/umap/locale/br.js +1 -1
  38. umap/static/umap/locale/br.json +1 -1
  39. umap/static/umap/locale/ca.js +14 -5
  40. umap/static/umap/locale/ca.json +14 -5
  41. umap/static/umap/locale/cs_CZ.js +14 -5
  42. umap/static/umap/locale/cs_CZ.json +14 -5
  43. umap/static/umap/locale/da.js +48 -39
  44. umap/static/umap/locale/da.json +48 -39
  45. umap/static/umap/locale/de.js +14 -5
  46. umap/static/umap/locale/de.json +14 -5
  47. umap/static/umap/locale/el.js +14 -5
  48. umap/static/umap/locale/el.json +14 -5
  49. umap/static/umap/locale/en.js +14 -5
  50. umap/static/umap/locale/en.json +14 -5
  51. umap/static/umap/locale/en_US.json +14 -5
  52. umap/static/umap/locale/es.js +49 -40
  53. umap/static/umap/locale/es.json +49 -40
  54. umap/static/umap/locale/et.js +14 -5
  55. umap/static/umap/locale/et.json +14 -5
  56. umap/static/umap/locale/eu.js +14 -5
  57. umap/static/umap/locale/eu.json +14 -5
  58. umap/static/umap/locale/fa_IR.js +14 -5
  59. umap/static/umap/locale/fa_IR.json +14 -5
  60. umap/static/umap/locale/fi.js +14 -5
  61. umap/static/umap/locale/fi.json +14 -5
  62. umap/static/umap/locale/fr.js +14 -5
  63. umap/static/umap/locale/fr.json +14 -5
  64. umap/static/umap/locale/gl.js +14 -5
  65. umap/static/umap/locale/gl.json +14 -5
  66. umap/static/umap/locale/he.js +14 -5
  67. umap/static/umap/locale/he.json +14 -5
  68. umap/static/umap/locale/hr.js +14 -5
  69. umap/static/umap/locale/hr.json +14 -5
  70. umap/static/umap/locale/hu.js +56 -47
  71. umap/static/umap/locale/hu.json +56 -47
  72. umap/static/umap/locale/id.js +14 -5
  73. umap/static/umap/locale/id.json +14 -5
  74. umap/static/umap/locale/is.js +14 -5
  75. umap/static/umap/locale/is.json +14 -5
  76. umap/static/umap/locale/it.js +14 -5
  77. umap/static/umap/locale/it.json +14 -5
  78. umap/static/umap/locale/ja.js +14 -5
  79. umap/static/umap/locale/ja.json +14 -5
  80. umap/static/umap/locale/ko.js +14 -5
  81. umap/static/umap/locale/ko.json +14 -5
  82. umap/static/umap/locale/lt.js +14 -5
  83. umap/static/umap/locale/lt.json +14 -5
  84. umap/static/umap/locale/ms.js +14 -5
  85. umap/static/umap/locale/ms.json +14 -5
  86. umap/static/umap/locale/nl.js +14 -5
  87. umap/static/umap/locale/nl.json +14 -5
  88. umap/static/umap/locale/no.js +14 -5
  89. umap/static/umap/locale/no.json +14 -5
  90. umap/static/umap/locale/pl.js +14 -5
  91. umap/static/umap/locale/pl.json +14 -5
  92. umap/static/umap/locale/pl_PL.json +14 -5
  93. umap/static/umap/locale/pt.js +14 -5
  94. umap/static/umap/locale/pt.json +14 -5
  95. umap/static/umap/locale/pt_BR.js +14 -5
  96. umap/static/umap/locale/pt_BR.json +14 -5
  97. umap/static/umap/locale/pt_PT.js +14 -5
  98. umap/static/umap/locale/pt_PT.json +14 -5
  99. umap/static/umap/locale/ro.js +14 -5
  100. umap/static/umap/locale/ro.json +14 -5
  101. umap/static/umap/locale/ru.js +14 -5
  102. umap/static/umap/locale/ru.json +14 -5
  103. umap/static/umap/locale/si.js +1 -1
  104. umap/static/umap/locale/si.json +1 -1
  105. umap/static/umap/locale/sk_SK.js +14 -5
  106. umap/static/umap/locale/sk_SK.json +14 -5
  107. umap/static/umap/locale/sl.js +14 -5
  108. umap/static/umap/locale/sl.json +14 -5
  109. umap/static/umap/locale/sr.js +14 -5
  110. umap/static/umap/locale/sr.json +14 -5
  111. umap/static/umap/locale/sv.js +14 -5
  112. umap/static/umap/locale/sv.json +14 -5
  113. umap/static/umap/locale/th_TH.js +14 -5
  114. umap/static/umap/locale/th_TH.json +14 -5
  115. umap/static/umap/locale/tr.js +14 -5
  116. umap/static/umap/locale/tr.json +14 -5
  117. umap/static/umap/locale/uk_UA.js +14 -5
  118. umap/static/umap/locale/uk_UA.json +14 -5
  119. umap/static/umap/locale/vi.js +14 -5
  120. umap/static/umap/locale/vi.json +14 -5
  121. umap/static/umap/locale/vi_VN.json +14 -5
  122. umap/static/umap/locale/zh.js +14 -5
  123. umap/static/umap/locale/zh.json +14 -5
  124. umap/static/umap/locale/zh_CN.json +14 -5
  125. umap/static/umap/locale/zh_TW.Big5.json +14 -5
  126. umap/static/umap/locale/zh_TW.js +47 -38
  127. umap/static/umap/locale/zh_TW.json +47 -38
  128. umap/static/umap/map.css +3 -3
  129. umap/templates/umap/login_popup_end.html +2 -2
  130. umap/tests/integration/conftest.py +8 -0
  131. umap/tests/integration/test_anonymous_owned_map.py +1 -1
  132. umap/tests/integration/test_conditional_rules.py +1 -1
  133. umap/tests/integration/test_filters.py +6 -7
  134. umap/tests/integration/test_map_preview.py +1 -1
  135. umap/tests/integration/test_picto.py +1 -1
  136. umap/tests/integration/test_save.py +1 -1
  137. umap/tests/integration/test_websocket_sync.py +63 -19
  138. umap/tests/test_dashboard.py +1 -1
  139. umap/tests/test_statics.py +2 -2
  140. umap/tests/test_views.py +1 -1
  141. umap/utils.py +2 -2
  142. {umap_project-3.4.0b1.dist-info → umap_project-3.4.0b3.dist-info}/METADATA +4 -4
  143. {umap_project-3.4.0b1.dist-info → umap_project-3.4.0b3.dist-info}/RECORD +146 -145
  144. {umap_project-3.4.0b1.dist-info → umap_project-3.4.0b3.dist-info}/WHEEL +0 -0
  145. {umap_project-3.4.0b1.dist-info → umap_project-3.4.0b3.dist-info}/entry_points.txt +0 -0
  146. {umap_project-3.4.0b1.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.options.permanentCreditBackground ? '#FFFFFFB0' : ''
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?.hasFilters())
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 behing able to set one
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
- 'properties.heat.radius',
74
- {
75
- handler: 'Range',
76
- min: 10,
77
- max: 100,
78
- step: 5,
79
- label: translate('Heatmap radius'),
80
- helpText: translate('Override heatmap radius (default 25)'),
81
- },
82
- ],
83
- [
84
- 'properties.heat.intensityProperty',
85
- {
86
- handler: 'BlurInput',
87
- placeholder: translate('Heatmap intensity property'),
88
- helpText: translate('Optional intensity property for heatmap'),
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 key in feature.properties) {
130
- if (typeof feature.properties[key] === 'object' || U.LABEL_KEYS.includes(key)) {
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 writting addresses
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
- this.close()
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 configurated at load
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 callabck to be called anyway.
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, FieldManager } from './managers.js'
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 FieldManager(this, this.dialog)
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
- // TOOD: map.save may not always be the first call during save process
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 whould be merged with `render`` method and the
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 ommited, global U.SCHEMA will be used.
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) {
@@ -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 begining of the header, case insensitive. All other column are imported as properties.": "በኮማ፣ታብ፣ግማሽኮለን የተከፋፈሉ ውጤቶች። SRSWG84 ተመላክቷል። የነጥብ ጂኦሜትሪዎች ብቻ መጥተዋል። የማምጣት ሂደቱ የኮለምን ሄደሮችን በማሰስ «ላቲትዩድ» እና «ሎንጊትዩድ» የሚሉትን ቃላት መኖር ከመጀመሪያው በመነሳት ያጣራል። ሁሉም ኮለምኖች እንደባህርይ መጥተዋል።",
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 begining of the header, case insensitive. All other column are imported as properties.": "በኮማ፣ታብ፣ግማሽኮለን የተከፋፈሉ ውጤቶች። SRSWG84 ተመላክቷል። የነጥብ ጂኦሜትሪዎች ብቻ መጥተዋል። የማምጣት ሂደቱ የኮለምን ሄደሮችን በማሰስ «ላቲትዩድ» እና «ሎንጊትዩድ» የሚሉትን ቃላት መኖር ከመጀመሪያው በመነሳት ያጣራል። ሁሉም ኮለምኖች እንደባህርይ መጥተዋል።",
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
  }
@@ -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 begining 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 begining of the header, case insensitive. All other column are imported as properties.",
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")