umap-project 2.3.0__py3-none-any.whl → 2.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of umap-project might be problematic. Click here for more details.

Files changed (211) hide show
  1. umap/__init__.py +1 -1
  2. umap/locale/en/LC_MESSAGES/django.po +81 -31
  3. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  4. umap/locale/fr/LC_MESSAGES/django.po +117 -66
  5. umap/locale/pl/LC_MESSAGES/django.mo +0 -0
  6. umap/locale/pl/LC_MESSAGES/django.po +83 -78
  7. umap/locale/pt/LC_MESSAGES/django.mo +0 -0
  8. umap/locale/pt/LC_MESSAGES/django.po +129 -123
  9. umap/management/commands/run_websocket_server.py +23 -0
  10. umap/models.py +6 -1
  11. umap/settings/base.py +11 -3
  12. umap/static/umap/base.css +68 -186
  13. umap/static/umap/content.css +3 -2
  14. umap/static/umap/css/dialog.css +18 -0
  15. umap/static/umap/css/icon.css +8 -0
  16. umap/static/umap/css/importers.css +51 -0
  17. umap/static/umap/css/panel.css +18 -57
  18. umap/static/umap/css/tooltip.css +59 -0
  19. umap/static/umap/css/window.css +35 -0
  20. umap/static/umap/img/16-white.svg +1 -3
  21. umap/static/umap/img/alert-icon-error.svg +8 -0
  22. umap/static/umap/img/alert-icon-info.svg +4 -0
  23. umap/static/umap/img/alert-icon-success.svg +3 -0
  24. umap/static/umap/img/icon-external-link.svg +3 -0
  25. umap/static/umap/img/importers/communesfr.svg +5 -0
  26. umap/static/umap/img/importers/datasets.svg +13 -0
  27. umap/static/umap/img/importers/geodatamine.svg +10 -0
  28. umap/static/umap/img/importers/overpass.svg +7 -0
  29. umap/static/umap/img/importers/random.svg +18 -0
  30. umap/static/umap/img/importers/random1.svg +4 -0
  31. umap/static/umap/img/importers/random2.svg +4 -0
  32. umap/static/umap/img/source/16-white.svg +2 -4
  33. umap/static/umap/js/components/alerts/alert.css +160 -0
  34. umap/static/umap/js/components/alerts/alert.js +169 -0
  35. umap/static/umap/js/components/base.js +54 -0
  36. umap/static/umap/js/modules/autocomplete.js +347 -0
  37. umap/static/umap/js/modules/browser.js +14 -21
  38. umap/static/umap/js/modules/caption.js +119 -0
  39. umap/static/umap/js/modules/global.js +37 -11
  40. umap/static/umap/js/modules/help.js +255 -0
  41. umap/static/umap/js/modules/importer.js +308 -0
  42. umap/static/umap/js/modules/importers/communesfr.js +44 -0
  43. umap/static/umap/js/modules/importers/datasets.js +42 -0
  44. umap/static/umap/js/modules/importers/geodatamine.js +95 -0
  45. umap/static/umap/js/modules/importers/overpass.js +84 -0
  46. umap/static/umap/js/modules/request.js +12 -14
  47. umap/static/umap/js/modules/rules.js +241 -0
  48. umap/static/umap/js/modules/schema.js +63 -14
  49. umap/static/umap/js/modules/sync/engine.js +93 -0
  50. umap/static/umap/js/modules/sync/updaters.js +109 -0
  51. umap/static/umap/js/modules/sync/websocket.js +25 -0
  52. umap/static/umap/js/modules/ui/dialog.js +52 -0
  53. umap/static/umap/js/modules/{panel.js → ui/panel.js} +37 -20
  54. umap/static/umap/js/modules/ui/tooltip.js +116 -0
  55. umap/static/umap/js/modules/utils.js +25 -18
  56. umap/static/umap/js/umap.controls.js +37 -112
  57. umap/static/umap/js/umap.core.js +1 -327
  58. umap/static/umap/js/umap.features.js +77 -29
  59. umap/static/umap/js/umap.forms.js +17 -19
  60. umap/static/umap/js/umap.js +265 -228
  61. umap/static/umap/js/umap.layer.js +154 -76
  62. umap/static/umap/js/umap.permissions.js +5 -9
  63. umap/static/umap/js/umap.popup.js +2 -1
  64. umap/static/umap/js/umap.tableeditor.js +8 -8
  65. umap/static/umap/locale/am_ET.js +51 -16
  66. umap/static/umap/locale/am_ET.json +51 -16
  67. umap/static/umap/locale/ar.js +51 -16
  68. umap/static/umap/locale/ar.json +51 -16
  69. umap/static/umap/locale/ast.js +51 -16
  70. umap/static/umap/locale/ast.json +51 -16
  71. umap/static/umap/locale/bg.js +51 -16
  72. umap/static/umap/locale/bg.json +51 -16
  73. umap/static/umap/locale/br.js +55 -20
  74. umap/static/umap/locale/br.json +55 -20
  75. umap/static/umap/locale/ca.js +51 -16
  76. umap/static/umap/locale/ca.json +51 -16
  77. umap/static/umap/locale/cs_CZ.js +93 -58
  78. umap/static/umap/locale/cs_CZ.json +93 -58
  79. umap/static/umap/locale/da.js +51 -16
  80. umap/static/umap/locale/da.json +51 -16
  81. umap/static/umap/locale/de.js +56 -21
  82. umap/static/umap/locale/de.json +56 -21
  83. umap/static/umap/locale/el.js +51 -16
  84. umap/static/umap/locale/el.json +51 -16
  85. umap/static/umap/locale/en.js +52 -16
  86. umap/static/umap/locale/en.json +52 -16
  87. umap/static/umap/locale/en_US.json +51 -16
  88. umap/static/umap/locale/es.js +51 -16
  89. umap/static/umap/locale/es.json +51 -16
  90. umap/static/umap/locale/et.js +51 -16
  91. umap/static/umap/locale/et.json +51 -16
  92. umap/static/umap/locale/eu.js +51 -16
  93. umap/static/umap/locale/eu.json +51 -16
  94. umap/static/umap/locale/fa_IR.js +51 -16
  95. umap/static/umap/locale/fa_IR.json +51 -16
  96. umap/static/umap/locale/fi.js +51 -16
  97. umap/static/umap/locale/fi.json +51 -16
  98. umap/static/umap/locale/fr.js +61 -25
  99. umap/static/umap/locale/fr.json +61 -25
  100. umap/static/umap/locale/gl.js +51 -16
  101. umap/static/umap/locale/gl.json +51 -16
  102. umap/static/umap/locale/he.js +51 -16
  103. umap/static/umap/locale/he.json +51 -16
  104. umap/static/umap/locale/hr.js +51 -16
  105. umap/static/umap/locale/hr.json +51 -16
  106. umap/static/umap/locale/hu.js +51 -16
  107. umap/static/umap/locale/hu.json +51 -16
  108. umap/static/umap/locale/id.js +51 -16
  109. umap/static/umap/locale/id.json +51 -16
  110. umap/static/umap/locale/is.js +51 -16
  111. umap/static/umap/locale/is.json +51 -16
  112. umap/static/umap/locale/it.js +51 -16
  113. umap/static/umap/locale/it.json +51 -16
  114. umap/static/umap/locale/ja.js +51 -16
  115. umap/static/umap/locale/ja.json +51 -16
  116. umap/static/umap/locale/ko.js +51 -16
  117. umap/static/umap/locale/ko.json +51 -16
  118. umap/static/umap/locale/lt.js +51 -16
  119. umap/static/umap/locale/lt.json +51 -16
  120. umap/static/umap/locale/ms.js +51 -16
  121. umap/static/umap/locale/ms.json +51 -16
  122. umap/static/umap/locale/nl.js +51 -16
  123. umap/static/umap/locale/nl.json +51 -16
  124. umap/static/umap/locale/no.js +51 -16
  125. umap/static/umap/locale/no.json +51 -16
  126. umap/static/umap/locale/pl.js +93 -58
  127. umap/static/umap/locale/pl.json +93 -58
  128. umap/static/umap/locale/pl_PL.json +51 -16
  129. umap/static/umap/locale/pt.js +215 -180
  130. umap/static/umap/locale/pt.json +215 -180
  131. umap/static/umap/locale/pt_BR.js +51 -16
  132. umap/static/umap/locale/pt_BR.json +51 -16
  133. umap/static/umap/locale/pt_PT.js +51 -16
  134. umap/static/umap/locale/pt_PT.json +51 -16
  135. umap/static/umap/locale/ro.js +51 -16
  136. umap/static/umap/locale/ro.json +51 -16
  137. umap/static/umap/locale/ru.js +51 -16
  138. umap/static/umap/locale/ru.json +51 -16
  139. umap/static/umap/locale/si.js +51 -16
  140. umap/static/umap/locale/si.json +51 -16
  141. umap/static/umap/locale/sk_SK.js +51 -16
  142. umap/static/umap/locale/sk_SK.json +51 -16
  143. umap/static/umap/locale/sl.js +51 -16
  144. umap/static/umap/locale/sl.json +51 -16
  145. umap/static/umap/locale/sr.js +51 -16
  146. umap/static/umap/locale/sr.json +51 -16
  147. umap/static/umap/locale/sv.js +51 -16
  148. umap/static/umap/locale/sv.json +51 -16
  149. umap/static/umap/locale/th_TH.js +51 -16
  150. umap/static/umap/locale/th_TH.json +51 -16
  151. umap/static/umap/locale/tr.js +51 -16
  152. umap/static/umap/locale/tr.json +51 -16
  153. umap/static/umap/locale/uk_UA.js +51 -16
  154. umap/static/umap/locale/uk_UA.json +51 -16
  155. umap/static/umap/locale/vi.js +51 -16
  156. umap/static/umap/locale/vi.json +51 -16
  157. umap/static/umap/locale/vi_VN.json +51 -16
  158. umap/static/umap/locale/zh.js +51 -16
  159. umap/static/umap/locale/zh.json +51 -16
  160. umap/static/umap/locale/zh_CN.json +51 -16
  161. umap/static/umap/locale/zh_TW.Big5.json +51 -16
  162. umap/static/umap/locale/zh_TW.js +51 -16
  163. umap/static/umap/locale/zh_TW.json +51 -16
  164. umap/static/umap/map.css +40 -53
  165. umap/static/umap/unittests/sync.js +105 -0
  166. umap/static/umap/unittests/utils.js +78 -36
  167. umap/static/umap/vars.css +19 -1
  168. umap/static/umap/vendors/dompurify/purify.es.js +50 -15
  169. umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -1
  170. umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +2 -2
  171. umap/templates/umap/components/alerts/alert.html +89 -0
  172. umap/templates/umap/content.html +4 -3
  173. umap/templates/umap/css.html +4 -0
  174. umap/templates/umap/home.html +3 -0
  175. umap/templates/umap/js.html +0 -3
  176. umap/templates/umap/map_init.html +2 -8
  177. umap/templates/umap/messages.html +9 -11
  178. umap/templates/umap/search.html +3 -0
  179. umap/tests/base.py +3 -0
  180. umap/tests/integration/conftest.py +30 -0
  181. umap/tests/integration/test_anonymous_owned_map.py +8 -13
  182. umap/tests/integration/test_browser.py +81 -6
  183. umap/tests/integration/test_caption.py +27 -0
  184. umap/tests/integration/test_conditional_rules.py +201 -0
  185. umap/tests/integration/test_dashboard.py +1 -1
  186. umap/tests/integration/test_datalayer.py +2 -3
  187. umap/tests/integration/test_edit_datalayer.py +32 -3
  188. umap/tests/integration/test_edit_map.py +1 -1
  189. umap/tests/integration/test_facets_browser.py +7 -4
  190. umap/tests/integration/test_import.py +185 -49
  191. umap/tests/integration/test_map.py +31 -17
  192. umap/tests/integration/{test_collaborative_editing.py → test_optimistic_merge.py} +7 -7
  193. umap/tests/integration/test_owned_map.py +1 -1
  194. umap/tests/integration/test_picto.py +2 -2
  195. umap/tests/integration/test_statics.py +1 -1
  196. umap/tests/integration/test_view_marker.py +19 -2
  197. umap/tests/integration/test_websocket_sync.py +283 -0
  198. umap/tests/settings.py +5 -0
  199. umap/tests/test_datalayer_views.py +0 -1
  200. umap/tests/test_views.py +53 -0
  201. umap/urls.py +5 -0
  202. umap/views.py +40 -11
  203. umap/websocket_server.py +92 -0
  204. {umap_project-2.3.0.dist-info → umap_project-2.4.0.dist-info}/METADATA +13 -11
  205. {umap_project-2.3.0.dist-info → umap_project-2.4.0.dist-info}/RECORD +208 -172
  206. umap/static/umap/js/umap.autocomplete.js +0 -341
  207. umap/static/umap/js/umap.importer.js +0 -187
  208. umap/static/umap/js/umap.ui.js +0 -190
  209. {umap_project-2.3.0.dist-info → umap_project-2.4.0.dist-info}/WHEEL +0 -0
  210. {umap_project-2.3.0.dist-info → umap_project-2.4.0.dist-info}/entry_points.txt +0 -0
  211. {umap_project-2.3.0.dist-info → umap_project-2.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,25 +1,61 @@
1
1
  U.FeatureMixin = {
2
2
  staticOptions: { mainColor: 'color' },
3
3
 
4
- initialize: function (map, latlng, options) {
4
+ getSyncMetadata: function () {
5
+ return {
6
+ subject: 'feature',
7
+ metadata: {
8
+ id: this.id,
9
+ layerId: this.datalayer?.id || null,
10
+ featureType: this.getClassName(),
11
+ },
12
+ }
13
+ },
14
+
15
+ onCommit: function () {
16
+ // When the layer is a remote layer, we don't want to sync the creation of the
17
+ // points via the websocket, as the other peers will get them themselves.
18
+ if (this.datalayer.isRemoteLayer()) return
19
+ this.sync.upsert(this.toGeoJSON())
20
+ },
21
+
22
+ getGeometry: function () {
23
+ return this.toGeoJSON().geometry
24
+ },
25
+
26
+ syncDelete: function () {
27
+ this.sync.delete()
28
+ },
29
+
30
+ initialize: function (map, latlng, options, id) {
5
31
  this.map = map
32
+ this.sync = map.sync_engine.proxy(this)
33
+
6
34
  if (typeof options === 'undefined') {
7
35
  options = {}
8
36
  }
9
37
  // DataLayer the marker belongs to
10
38
  this.datalayer = options.datalayer || null
11
39
  this.properties = { _umap_options: {} }
12
- let geojson_id
40
+
13
41
  if (options.geojson) {
14
42
  this.populate(options.geojson)
15
- geojson_id = options.geojson.id
16
43
  }
17
44
 
18
- // Each feature needs an unique identifier
19
- if (U.Utils.checkId(geojson_id)) {
20
- this.id = geojson_id
45
+ if (id) {
46
+ this.id = id
21
47
  } else {
22
- this.id = U.Utils.generateId()
48
+ let geojson_id
49
+ if (options.geojson) {
50
+ geojson_id = options.geojson.id
51
+ }
52
+
53
+ // Each feature needs an unique identifier
54
+ if (U.Utils.checkId(geojson_id)) {
55
+ this.id = geojson_id
56
+ } else {
57
+ this.id = U.Utils.generateId()
58
+ }
23
59
  }
24
60
  let isDirty = false
25
61
  const self = this
@@ -98,6 +134,7 @@ U.FeatureMixin = {
98
134
  this.view()
99
135
  }
100
136
  }
137
+ this._redraw()
101
138
  },
102
139
 
103
140
  openPopup: function () {
@@ -107,7 +144,11 @@ U.FeatureMixin = {
107
144
  edit: function (e) {
108
145
  if (!this.map.editEnabled || this.isReadOnly()) return
109
146
  const container = L.DomUtil.create('div', 'umap-feature-container')
110
- L.DomUtil.createTitle(container, L._('Feature properties'), this.getClassName())
147
+ L.DomUtil.createTitle(
148
+ container,
149
+ L._('Feature properties'),
150
+ `icon-${this.getClassName()}`
151
+ )
111
152
 
112
153
  let builder = new U.FormBuilder(
113
154
  this,
@@ -134,7 +175,6 @@ U.FeatureMixin = {
134
175
  properties.unshift('properties.name')
135
176
  builder = new U.FormBuilder(this, properties, {
136
177
  id: 'umap-feature-properties',
137
- callback: this._redraw, // In case we have dynamic options…
138
178
  })
139
179
  container.appendChild(builder.build())
140
180
  this.appendEditFieldsets(container)
@@ -149,7 +189,7 @@ U.FeatureMixin = {
149
189
  },
150
190
 
151
191
  getAdvancedEditActions: function (container) {
152
- const deleteButton = L.DomUtil.createButton(
192
+ L.DomUtil.createButton(
153
193
  'button umap-delete',
154
194
  container,
155
195
  L._('Delete'),
@@ -165,7 +205,6 @@ U.FeatureMixin = {
165
205
  const optionsFields = this.getShapeOptions()
166
206
  let builder = new U.FormBuilder(this, optionsFields, {
167
207
  id: 'umap-feature-shape-properties',
168
- callback: this._redraw,
169
208
  })
170
209
  const shapeProperties = L.DomUtil.createFieldset(container, L._('Shape properties'))
171
210
  shapeProperties.appendChild(builder.build())
@@ -173,7 +212,6 @@ U.FeatureMixin = {
173
212
  const advancedOptions = this.getAdvancedOptions()
174
213
  builder = new U.FormBuilder(this, advancedOptions, {
175
214
  id: 'umap-feature-advanced-properties',
176
- callback: this._redraw,
177
215
  })
178
216
  const advancedProperties = L.DomUtil.createFieldset(
179
217
  container,
@@ -182,9 +220,7 @@ U.FeatureMixin = {
182
220
  advancedProperties.appendChild(builder.build())
183
221
 
184
222
  const interactionOptions = this.getInteractionOptions()
185
- builder = new U.FormBuilder(this, interactionOptions, {
186
- callback: this._redraw,
187
- })
223
+ builder = new U.FormBuilder(this, interactionOptions)
188
224
  const popupFieldset = L.DomUtil.createFieldset(
189
225
  container,
190
226
  L._('Interaction options')
@@ -240,13 +276,14 @@ U.FeatureMixin = {
240
276
  }
241
277
  return false
242
278
  },
243
-
244
- del: function () {
279
+ del: function (sync) {
245
280
  this.isDirty = true
246
281
  this.map.closePopup()
247
282
  if (this.datalayer) {
248
283
  this.datalayer.removeLayer(this)
249
284
  this.disconnectFromDataLayer(this.datalayer)
285
+
286
+ if (sync !== false) this.syncDelete()
250
287
  }
251
288
  },
252
289
 
@@ -495,7 +532,7 @@ U.FeatureMixin = {
495
532
  },
496
533
 
497
534
  isFiltered: function () {
498
- const filterKeys = this.map.getFilterKeys()
535
+ const filterKeys = this.datalayer.getFilterKeys()
499
536
  const filter = this.map.browser.options.filter
500
537
  if (filter && !this.matchFilter(filter, filterKeys)) return true
501
538
  if (!this.matchFacets()) return true
@@ -504,6 +541,10 @@ U.FeatureMixin = {
504
541
 
505
542
  matchFilter: function (filter, keys) {
506
543
  filter = filter.toLowerCase()
544
+ if (U.Utils.hasVar(keys)) {
545
+ return this.getDisplayName().toLowerCase().indexOf(filter) !== -1
546
+ }
547
+ keys = keys.split(',')
507
548
  for (let i = 0, value; i < keys.length; i++) {
508
549
  value = (this.properties[keys[i]] || '') + ''
509
550
  if (value.toLowerCase().indexOf(filter) !== -1) return true
@@ -549,7 +590,10 @@ U.FeatureMixin = {
549
590
  },
550
591
 
551
592
  clone: function () {
552
- const layer = this.datalayer.geojsonToFeatures(this.toGeoJSON())
593
+ const geoJSON = this.toGeoJSON()
594
+ delete geoJSON.id
595
+ delete geoJSON.properties.id
596
+ const layer = this.datalayer.geojsonToFeatures(geoJSON)
553
597
  layer.isDirty = true
554
598
  layer.edit()
555
599
  return layer
@@ -562,7 +606,7 @@ U.FeatureMixin = {
562
606
  if (locale) properties.locale = locale
563
607
  if (L.lang) properties.lang = L.lang
564
608
  properties.rank = this.getRank() + 1
565
- if (this.hasGeom()) {
609
+ if (this._map && this.hasGeom()) {
566
610
  center = this.getCenter()
567
611
  properties.lat = center.lat
568
612
  properties.lon = center.lng
@@ -602,9 +646,11 @@ U.Marker = L.Marker.extend({
602
646
  function (e) {
603
647
  this.isDirty = true
604
648
  this.edit(e)
649
+ this.sync.update('geometry', this.getGeometry())
605
650
  },
606
651
  this
607
652
  )
653
+ this.on('editable:drawing:commit', this.onCommit)
608
654
  if (!this.isReadOnly()) this.on('mouseover', this._enableDragging)
609
655
  this.on('mouseout', this._onMouseOut)
610
656
  this._popupHandlersAdded = true // prevent Leaflet from binding event on bindPopup
@@ -726,14 +772,10 @@ U.Marker = L.Marker.extend({
726
772
  const builder = new U.FormBuilder(this, coordinatesOptions, {
727
773
  callback: function () {
728
774
  if (!this._latlng.isValid()) {
729
- this.map.ui.alert({
730
- content: L._('Invalid latitude or longitude'),
731
- level: 'error',
732
- })
775
+ U.Alert.error(L._('Invalid latitude or longitude'))
733
776
  builder.resetField('_latlng.lat')
734
777
  builder.resetField('_latlng.lng')
735
778
  }
736
- this._redraw()
737
779
  this.zoomTo({ easing: false })
738
780
  },
739
781
  callbackContext: this,
@@ -878,14 +920,15 @@ U.PathMixin = {
878
920
 
879
921
  _onMouseOver: function () {
880
922
  if (this.map.measureTools && this.map.measureTools.enabled()) {
881
- this.map.ui.tooltip({ content: this.getMeasure(), anchor: this })
923
+ this.map.tooltip.open({ content: this.getMeasure(), anchor: this })
882
924
  } else if (this.map.editEnabled && !this.map.editedFeature) {
883
- this.map.ui.tooltip({ content: L._('Click to edit'), anchor: this })
925
+ this.map.tooltip.open({ content: L._('Click to edit'), anchor: this })
884
926
  }
885
927
  },
886
928
 
887
929
  addInteractions: function () {
888
930
  U.FeatureMixin.addInteractions.call(this)
931
+ this.on('editable:disable', this.onCommit)
889
932
  this.on('mouseover', this._onMouseOver)
890
933
  this.on('edit', this.makeDirty)
891
934
  this.on('drag editable:drag', this._onDrag)
@@ -928,7 +971,7 @@ U.PathMixin = {
928
971
  items.push({
929
972
  text: L._('Display measure'),
930
973
  callback: function () {
931
- this.map.ui.alert({ content: this.getMeasure(), level: 'info' })
974
+ U.Alert.info(this.getMeasure())
932
975
  },
933
976
  context: this,
934
977
  })
@@ -1086,6 +1129,9 @@ U.Polyline = L.Polyline.extend({
1086
1129
  geojson.geometry.coordinates = [
1087
1130
  U.Utils.flattenCoordinates(geojson.geometry.coordinates),
1088
1131
  ]
1132
+
1133
+ delete geojson.id // delete the copied id, a new one will be generated.
1134
+
1089
1135
  const polygon = this.datalayer.geojsonToFeatures(geojson)
1090
1136
  polygon.edit()
1091
1137
  this.del()
@@ -1093,7 +1139,7 @@ U.Polyline = L.Polyline.extend({
1093
1139
 
1094
1140
  getAdvancedEditActions: function (container) {
1095
1141
  U.FeatureMixin.getAdvancedEditActions.call(this, container)
1096
- const toPolygon = L.DomUtil.createButton(
1142
+ L.DomUtil.createButton(
1097
1143
  'button umap-to-polygon',
1098
1144
  container,
1099
1145
  L._('Transform to polygon'),
@@ -1223,6 +1269,8 @@ U.Polygon = L.Polygon.extend({
1223
1269
 
1224
1270
  toPolyline: function () {
1225
1271
  const geojson = this.toGeoJSON()
1272
+ delete geojson.id
1273
+ delete geojson.properties.id
1226
1274
  geojson.geometry.type = 'LineString'
1227
1275
  geojson.geometry.coordinates = U.Utils.flattenCoordinates(
1228
1276
  geojson.geometry.coordinates
@@ -78,7 +78,7 @@ L.FormBuilder.Element.include({
78
78
  info,
79
79
  'mouseover',
80
80
  function () {
81
- this.builder.map.ui.tooltip({
81
+ this.builder.map.tooltip.open({
82
82
  anchor: info,
83
83
  content: this.options.helpTooltip,
84
84
  position: 'top',
@@ -340,15 +340,6 @@ L.FormBuilder.TextColorPicker = L.FormBuilder.ColorPicker.extend({
340
340
  ],
341
341
  })
342
342
 
343
- L.FormBuilder.ProxyTTLSelect = L.FormBuilder.Select.extend({
344
- selectOptions: [
345
- [undefined, L._('No cache')],
346
- ['300', L._('5 min')],
347
- ['3600', L._('1 hour')],
348
- ['86400', L._('1 day')],
349
- ],
350
- })
351
-
352
343
  L.FormBuilder.LayerTypeChooser = L.FormBuilder.Select.extend({
353
344
  getOptions: function () {
354
345
  const layer_classes = [
@@ -745,14 +736,12 @@ L.FormBuilder.Switch = L.FormBuilder.CheckBox.extend({
745
736
  })
746
737
 
747
738
  L.FormBuilder.FacetSearchBase = L.FormBuilder.Element.extend({
748
-
749
739
  buildLabel: function () {
750
740
  this.label = L.DomUtil.element({
751
741
  tagName: 'legend',
752
742
  textContent: this.options.label,
753
743
  })
754
- }
755
-
744
+ },
756
745
  })
757
746
  L.FormBuilder.FacetSearchChoices = L.FormBuilder.FacetSearchBase.extend({
758
747
  build: function () {
@@ -865,13 +854,13 @@ L.FormBuilder.MinMaxBase = L.FormBuilder.FacetSearchBase.extend({
865
854
  },
866
855
 
867
856
  isMinModified: function () {
868
- const default_ = this.minInput.getAttribute("value")
857
+ const default_ = this.minInput.getAttribute('value')
869
858
  const current = this.minInput.value
870
859
  return current != default_
871
860
  },
872
861
 
873
862
  isMaxModified: function () {
874
- const default_ = this.maxInput.getAttribute("value")
863
+ const default_ = this.maxInput.getAttribute('value')
875
864
  const current = this.maxInput.value
876
865
  return current != default_
877
866
  },
@@ -943,7 +932,11 @@ L.FormBuilder.MultiChoice = L.FormBuilder.Element.extend({
943
932
  if (!this.container.querySelector(`input[type="radio"][value="${value}"]`)) {
944
933
  value = this.options.default !== undefined ? this.options.default : this.default
945
934
  }
946
- this.container.querySelector(`input[type="radio"][value="${value}"]`).checked = true
935
+ const choices = this.getChoices().map(([value, label]) => value)
936
+ if (choices.includes(value)) {
937
+ this.container.querySelector(`input[type="radio"][value="${value}"]`).checked =
938
+ true
939
+ }
947
940
  },
948
941
 
949
942
  value: function () {
@@ -1065,7 +1058,7 @@ L.FormBuilder.ManageOwner = L.FormBuilder.Element.extend({
1065
1058
  className: 'edit-owner',
1066
1059
  on_select: L.bind(this.onSelect, this),
1067
1060
  }
1068
- this.autocomplete = new U.AutoComplete.Ajax.Select(this.parentNode, options)
1061
+ this.autocomplete = new U.AjaxAutocomplete(this.parentNode, options)
1069
1062
  const owner = this.toHTML()
1070
1063
  if (owner)
1071
1064
  this.autocomplete.displaySelected({
@@ -1094,7 +1087,7 @@ L.FormBuilder.ManageEditors = L.FormBuilder.Element.extend({
1094
1087
  on_select: L.bind(this.onSelect, this),
1095
1088
  on_unselect: L.bind(this.onUnselect, this),
1096
1089
  }
1097
- this.autocomplete = new U.AutoComplete.Ajax.SelectMultiple(this.parentNode, options)
1090
+ this.autocomplete = new U.AjaxAutocompleteMultiple(this.parentNode, options)
1098
1091
  this._values = this.toHTML()
1099
1092
  if (this._values)
1100
1093
  for (let i = 0; i < this._values.length; i++)
@@ -1183,7 +1176,12 @@ U.FormBuilder = L.FormBuilder.extend({
1183
1176
  setter: function (field, value) {
1184
1177
  L.FormBuilder.prototype.setter.call(this, field, value)
1185
1178
  this.obj.isDirty = true
1186
- if ('render' in this.obj) this.obj.render([field], this)
1179
+ if ('render' in this.obj) {
1180
+ this.obj.render([field], this)
1181
+ }
1182
+ if ('sync' in this.obj) {
1183
+ this.obj.sync.update(field, value)
1184
+ }
1187
1185
  },
1188
1186
 
1189
1187
  finish: function () {