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.
Files changed (202) 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 +20 -16
  5. umap/locale/en/LC_MESSAGES/django.po +18 -14
  6. umap/locale/es/LC_MESSAGES/django.mo +0 -0
  7. umap/locale/es/LC_MESSAGES/django.po +20 -16
  8. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  9. umap/locale/fr/LC_MESSAGES/django.po +18 -14
  10. umap/locale/pl/LC_MESSAGES/django.mo +0 -0
  11. umap/locale/pl/LC_MESSAGES/django.po +72 -71
  12. umap/migrations/0018_datalayer_uuid.py +1 -1
  13. umap/models.py +7 -3
  14. umap/settings/local.py.sample +1 -1
  15. umap/static/umap/content.css +0 -3
  16. umap/static/umap/css/bar.css +9 -6
  17. umap/static/umap/css/form.css +27 -11
  18. umap/static/umap/css/popup.css +1 -0
  19. umap/static/umap/js/components/base.js +1 -1
  20. umap/static/umap/js/components/copiable.js +47 -0
  21. umap/static/umap/js/modules/autocomplete.js +31 -58
  22. umap/static/umap/js/modules/browser.js +8 -8
  23. umap/static/umap/js/modules/data/features.js +33 -36
  24. umap/static/umap/js/modules/data/fields.js +446 -0
  25. umap/static/umap/js/modules/data/layer.js +76 -93
  26. umap/static/umap/js/modules/domutils.js +24 -4
  27. umap/static/umap/js/modules/filters.js +20 -47
  28. umap/static/umap/js/modules/form/fields.js +4 -4
  29. umap/static/umap/js/modules/formatter.js +9 -1
  30. umap/static/umap/js/modules/help.js +13 -14
  31. umap/static/umap/js/modules/i18n.js +1 -1
  32. umap/static/umap/js/modules/importer.js +18 -27
  33. umap/static/umap/js/modules/importers/banfr.js +0 -1
  34. umap/static/umap/js/modules/importers/cadastrefr.js +19 -19
  35. umap/static/umap/js/modules/importers/communesfr.js +7 -8
  36. umap/static/umap/js/modules/importers/datasets.js +14 -14
  37. umap/static/umap/js/modules/importers/geodatamine.js +20 -22
  38. umap/static/umap/js/modules/importers/opendata.js +10 -0
  39. umap/static/umap/js/modules/importers/overpass.js +19 -18
  40. umap/static/umap/js/modules/managers.js +1 -265
  41. umap/static/umap/js/modules/permissions.js +5 -3
  42. umap/static/umap/js/modules/rendering/controls.js +6 -4
  43. umap/static/umap/js/modules/rendering/icon.js +5 -9
  44. umap/static/umap/js/modules/rendering/layers/base.js +1 -1
  45. umap/static/umap/js/modules/rendering/layers/classified.js +16 -11
  46. umap/static/umap/js/modules/rendering/layers/heat.js +27 -21
  47. umap/static/umap/js/modules/rendering/map.js +22 -22
  48. umap/static/umap/js/modules/rendering/popup.js +6 -3
  49. umap/static/umap/js/modules/rendering/template.js +31 -37
  50. umap/static/umap/js/modules/rendering/ui.js +1 -2
  51. umap/static/umap/js/modules/rules.js +34 -41
  52. umap/static/umap/js/modules/schema.js +0 -7
  53. umap/static/umap/js/modules/share.js +36 -69
  54. umap/static/umap/js/modules/slideshow.js +3 -3
  55. umap/static/umap/js/modules/tableeditor.js +0 -1
  56. umap/static/umap/js/modules/ui/bar.js +51 -32
  57. umap/static/umap/js/modules/ui/dialog.js +10 -1
  58. umap/static/umap/js/modules/ui/panel.js +28 -23
  59. umap/static/umap/js/modules/ui/tooltip.js +1 -1
  60. umap/static/umap/js/modules/umap.js +84 -84
  61. umap/static/umap/js/modules/utils.js +13 -4
  62. umap/static/umap/js/umap.controls.js +33 -14
  63. umap/static/umap/locale/am_ET.js +19 -8
  64. umap/static/umap/locale/am_ET.json +19 -8
  65. umap/static/umap/locale/ar.js +19 -8
  66. umap/static/umap/locale/ar.json +19 -8
  67. umap/static/umap/locale/ast.js +19 -8
  68. umap/static/umap/locale/ast.json +19 -8
  69. umap/static/umap/locale/bg.js +19 -8
  70. umap/static/umap/locale/bg.json +19 -8
  71. umap/static/umap/locale/br.js +20 -9
  72. umap/static/umap/locale/br.json +20 -9
  73. umap/static/umap/locale/ca.js +19 -8
  74. umap/static/umap/locale/ca.json +19 -8
  75. umap/static/umap/locale/cs_CZ.js +20 -9
  76. umap/static/umap/locale/cs_CZ.json +20 -9
  77. umap/static/umap/locale/da.js +54 -43
  78. umap/static/umap/locale/da.json +54 -43
  79. umap/static/umap/locale/de.js +44 -33
  80. umap/static/umap/locale/de.json +44 -33
  81. umap/static/umap/locale/el.js +20 -9
  82. umap/static/umap/locale/el.json +20 -9
  83. umap/static/umap/locale/en.js +20 -9
  84. umap/static/umap/locale/en.json +20 -9
  85. umap/static/umap/locale/en_US.json +19 -8
  86. umap/static/umap/locale/es.js +55 -44
  87. umap/static/umap/locale/es.json +55 -44
  88. umap/static/umap/locale/et.js +20 -9
  89. umap/static/umap/locale/et.json +20 -9
  90. umap/static/umap/locale/eu.js +25 -14
  91. umap/static/umap/locale/eu.json +25 -14
  92. umap/static/umap/locale/fa_IR.js +20 -9
  93. umap/static/umap/locale/fa_IR.json +20 -9
  94. umap/static/umap/locale/fi.js +19 -8
  95. umap/static/umap/locale/fi.json +19 -8
  96. umap/static/umap/locale/fr.js +21 -10
  97. umap/static/umap/locale/fr.json +21 -10
  98. umap/static/umap/locale/gl.js +147 -136
  99. umap/static/umap/locale/gl.json +147 -136
  100. umap/static/umap/locale/he.js +19 -8
  101. umap/static/umap/locale/he.json +19 -8
  102. umap/static/umap/locale/hr.js +19 -8
  103. umap/static/umap/locale/hr.json +19 -8
  104. umap/static/umap/locale/hu.js +62 -51
  105. umap/static/umap/locale/hu.json +62 -51
  106. umap/static/umap/locale/id.js +19 -8
  107. umap/static/umap/locale/id.json +19 -8
  108. umap/static/umap/locale/is.js +20 -9
  109. umap/static/umap/locale/is.json +20 -9
  110. umap/static/umap/locale/it.js +20 -9
  111. umap/static/umap/locale/it.json +20 -9
  112. umap/static/umap/locale/ja.js +19 -8
  113. umap/static/umap/locale/ja.json +19 -8
  114. umap/static/umap/locale/ko.js +19 -8
  115. umap/static/umap/locale/ko.json +19 -8
  116. umap/static/umap/locale/lt.js +19 -8
  117. umap/static/umap/locale/lt.json +19 -8
  118. umap/static/umap/locale/ms.js +20 -9
  119. umap/static/umap/locale/ms.json +20 -9
  120. umap/static/umap/locale/nl.js +20 -9
  121. umap/static/umap/locale/nl.json +20 -9
  122. umap/static/umap/locale/no.js +19 -8
  123. umap/static/umap/locale/no.json +19 -8
  124. umap/static/umap/locale/pl.js +56 -45
  125. umap/static/umap/locale/pl.json +56 -45
  126. umap/static/umap/locale/pl_PL.json +19 -8
  127. umap/static/umap/locale/pt.js +20 -9
  128. umap/static/umap/locale/pt.json +20 -9
  129. umap/static/umap/locale/pt_BR.js +19 -8
  130. umap/static/umap/locale/pt_BR.json +19 -8
  131. umap/static/umap/locale/pt_PT.js +19 -8
  132. umap/static/umap/locale/pt_PT.json +19 -8
  133. umap/static/umap/locale/ro.js +19 -8
  134. umap/static/umap/locale/ro.json +19 -8
  135. umap/static/umap/locale/ru.js +19 -8
  136. umap/static/umap/locale/ru.json +19 -8
  137. umap/static/umap/locale/si.js +1 -1
  138. umap/static/umap/locale/si.json +1 -1
  139. umap/static/umap/locale/sk_SK.js +19 -8
  140. umap/static/umap/locale/sk_SK.json +19 -8
  141. umap/static/umap/locale/sl.js +19 -8
  142. umap/static/umap/locale/sl.json +19 -8
  143. umap/static/umap/locale/sr.js +19 -8
  144. umap/static/umap/locale/sr.json +19 -8
  145. umap/static/umap/locale/sv.js +19 -8
  146. umap/static/umap/locale/sv.json +19 -8
  147. umap/static/umap/locale/th_TH.js +19 -8
  148. umap/static/umap/locale/th_TH.json +19 -8
  149. umap/static/umap/locale/tr.js +19 -8
  150. umap/static/umap/locale/tr.json +19 -8
  151. umap/static/umap/locale/uk_UA.js +19 -8
  152. umap/static/umap/locale/uk_UA.json +19 -8
  153. umap/static/umap/locale/vi.js +19 -8
  154. umap/static/umap/locale/vi.json +19 -8
  155. umap/static/umap/locale/vi_VN.json +19 -8
  156. umap/static/umap/locale/zh.js +19 -8
  157. umap/static/umap/locale/zh.json +19 -8
  158. umap/static/umap/locale/zh_CN.json +19 -8
  159. umap/static/umap/locale/zh_TW.Big5.json +19 -8
  160. umap/static/umap/locale/zh_TW.js +53 -42
  161. umap/static/umap/locale/zh_TW.json +53 -42
  162. umap/static/umap/map.css +8 -7
  163. umap/static/umap/unittests/utils.js +7 -7
  164. umap/templates/umap/content_footer.html +1 -0
  165. umap/templates/umap/css.html +0 -2
  166. umap/templates/umap/js.html +1 -3
  167. umap/templates/umap/login_popup_end.html +2 -2
  168. umap/tests/integration/conftest.py +11 -2
  169. umap/tests/integration/test_anonymous_owned_map.py +2 -2
  170. umap/tests/integration/test_conditional_rules.py +107 -52
  171. umap/tests/integration/test_draw_polygon.py +4 -0
  172. umap/tests/integration/test_draw_polyline.py +11 -0
  173. umap/tests/integration/test_edit_datalayer.py +1 -1
  174. umap/tests/integration/test_fields.py +19 -0
  175. umap/tests/integration/test_filters.py +6 -7
  176. umap/tests/integration/test_iframe.py +1 -1
  177. umap/tests/integration/test_import.py +23 -0
  178. umap/tests/integration/test_map.py +2 -2
  179. umap/tests/integration/test_map_preview.py +1 -1
  180. umap/tests/integration/test_owned_map.py +2 -2
  181. umap/tests/integration/test_picto.py +1 -1
  182. umap/tests/integration/test_popup.py +31 -0
  183. umap/tests/integration/test_remote_data.py +4 -4
  184. umap/tests/integration/test_save.py +1 -1
  185. umap/tests/integration/test_search.py +41 -0
  186. umap/tests/integration/test_share.py +2 -2
  187. umap/tests/integration/test_team.py +1 -1
  188. umap/tests/integration/test_websocket_sync.py +69 -20
  189. umap/tests/test_dashboard.py +1 -1
  190. umap/tests/test_statics.py +2 -2
  191. umap/tests/test_utils.py +4 -1
  192. umap/tests/test_views.py +1 -1
  193. umap/utils.py +3 -2
  194. {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/METADATA +17 -17
  195. {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/RECORD +198 -199
  196. umap/static/umap/js/umap.core.js +0 -93
  197. umap/static/umap/vendors/editinosm/Leaflet.EditInOSM.css +0 -46
  198. umap/static/umap/vendors/editinosm/Leaflet.EditInOSM.js +0 -240
  199. umap/static/umap/vendors/editinosm/edit-in-osm.png +0 -0
  200. {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/WHEEL +0 -0
  201. {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/entry_points.txt +0 -0
  202. {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 = DomUtil.element({
45
- tagName: 'input',
46
- type: 'text',
47
- parent: this.parent,
48
- placeholder: this.options.placeholder,
49
- autocomplete: 'off',
50
- className: this.options.className,
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 = DomUtil.element({
60
- tagName: 'ul',
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 el = DomUtil.element({
171
- tagName: 'li',
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: el,
162
+ el: li,
178
163
  }
179
- DomEvent.on(el, 'mouseover', () => {
164
+ li.addEventListener('mouseover', () => {
180
165
  this.current = result
181
166
  this.highlight()
182
167
  })
183
- DomEvent.on(el, 'mousedown', () => this.setChoice())
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
- if (index === this.current) DomUtil.addClass(result.el, 'on')
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 result_el = DomUtil.element({
302
- tagName: 'div',
303
- parent: this.selectedContainer,
304
- })
305
- result_el.textContent = result.item.label
306
- const close = DomUtil.element({
307
- tagName: 'span',
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
- DomEvent.on(close, 'click', () => {
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 result_el = DomUtil.element({
332
- tagName: 'li',
333
- parent: this.selectedContainer,
334
- })
335
- result_el.textContent = result.item.label
336
- const close = DomUtil.element({
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, DomUtil, stamp } from '../../vendors/leaflet/leaflet-src.esm.js'
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.hasFilters())
101
- Utils.toggleBadge('.umap-control-browse', this.hasFilters())
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
- hasFilters() {
122
- return !!this.options.filter || this._umap.hasFilters()
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().map((datalayer) => {
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.autoLoaded = false
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.datalayer.fields.all(), ...this._umap.fields.all()]
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 = DomUtil.create('div', 'umap-feature-container')
247
- DomUtil.createTitle(
248
- container,
249
- translate('Feature properties'),
250
- `icon-${this.getClassName()}`
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.type === 'Text') {
257
+ if (field.key === 'description' || field.TYPE === 'Text') {
264
258
  options.handler = 'Textarea'
265
259
  options.helpEntries = ['textFormatting']
266
- } else if (field.type === 'Number') {
260
+ } else if (field.TYPE === 'Number') {
267
261
  options.handler = 'FloatInput'
268
- } else if (field.type === 'Date') {
262
+ } else if (field.TYPE === 'Date') {
269
263
  options.handler = 'DateInput'
270
- } else if (field.type === 'Datetime') {
264
+ } else if (field.TYPE === 'Datetime') {
271
265
  options.handler = 'DateTimeInput'
272
- } else if (field.type === 'Boolean') {
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 = DomUtil.createFieldset(
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 = DomUtil.createFieldset(
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 = DomUtil.createFieldset(
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 = L.extend(
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 = L.extend({}, this.properties)
518
- properties._umap_options = L.extend({}, 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 = L.getLocale()
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.isValid()) {
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 = DomUtil.createFieldset(container, translate('Coordinates'))
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 = DomUtil.createFieldset(container, translate('Line decoration'))
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 class="button" type="button"><i class="icon icon-24 icon-polygon"></i>${translate('Transform to polygon')}</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 = DomUtil.createButton(
1387
- 'button umap-to-polyline',
1388
- container,
1389
- translate('Transform to lines'),
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() {