umap-project 1.14.0a5__py3-none-any.whl → 2.0.0a0__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 (224) hide show
  1. umap/__init__.py +1 -1
  2. umap/decorators.py +0 -14
  3. umap/locale/br/LC_MESSAGES/django.mo +0 -0
  4. umap/locale/br/LC_MESSAGES/django.po +137 -85
  5. umap/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
  6. umap/locale/cs_CZ/LC_MESSAGES/django.po +136 -84
  7. umap/locale/el/LC_MESSAGES/django.mo +0 -0
  8. umap/locale/el/LC_MESSAGES/django.po +136 -84
  9. umap/locale/en/LC_MESSAGES/django.po +128 -88
  10. umap/locale/es/LC_MESSAGES/django.mo +0 -0
  11. umap/locale/es/LC_MESSAGES/django.po +136 -84
  12. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  13. umap/locale/fr/LC_MESSAGES/django.po +131 -91
  14. umap/locale/hu/LC_MESSAGES/django.mo +0 -0
  15. umap/locale/hu/LC_MESSAGES/django.po +137 -85
  16. umap/locale/it/LC_MESSAGES/django.mo +0 -0
  17. umap/locale/it/LC_MESSAGES/django.po +136 -84
  18. umap/locale/ms/LC_MESSAGES/django.mo +0 -0
  19. umap/locale/ms/LC_MESSAGES/django.po +136 -84
  20. umap/locale/pl/LC_MESSAGES/django.mo +0 -0
  21. umap/locale/pl/LC_MESSAGES/django.po +136 -84
  22. umap/locale/sv/LC_MESSAGES/django.mo +0 -0
  23. umap/locale/sv/LC_MESSAGES/django.po +135 -83
  24. umap/locale/zh_TW/LC_MESSAGES/django.mo +0 -0
  25. umap/locale/zh_TW/LC_MESSAGES/django.po +143 -91
  26. umap/models.py +23 -1
  27. umap/settings/__init__.py +1 -4
  28. umap/settings/base.py +1 -0
  29. umap/static/umap/base.css +5 -0
  30. umap/static/umap/content.css +185 -13
  31. umap/static/umap/favicons/icon.svg +2 -2
  32. umap/static/umap/img/edit.svg +3 -3
  33. umap/static/umap/img/icon-delete.svg +4 -0
  34. umap/static/umap/img/icon-download.svg +13 -0
  35. umap/static/umap/img/icon-duplicate.svg +5 -0
  36. umap/static/umap/img/icon-edit.svg +12 -0
  37. umap/static/umap/img/icon-share.svg +11 -0
  38. umap/static/umap/img/icon-view.svg +12 -0
  39. umap/static/umap/img/logo.svg +2 -2
  40. umap/static/umap/img/logo_small.svg +2 -2
  41. umap/static/umap/img/marker.svg +4 -0
  42. umap/static/umap/img/opensource.svg +2 -2
  43. umap/static/umap/img/osm.svg +2 -2
  44. umap/static/umap/js/components/fragment.js +1 -1
  45. umap/static/umap/js/modules/browser.js +159 -0
  46. umap/static/umap/js/modules/global.js +3 -1
  47. umap/static/umap/js/modules/request.js +155 -0
  48. umap/static/umap/js/umap.autocomplete.js +28 -38
  49. umap/static/umap/js/umap.controls.js +73 -58
  50. umap/static/umap/js/umap.core.js +4 -9
  51. umap/static/umap/js/umap.datalayer.permissions.js +13 -12
  52. umap/static/umap/js/umap.features.js +51 -49
  53. umap/static/umap/js/umap.forms.js +19 -19
  54. umap/static/umap/js/umap.icon.js +17 -17
  55. umap/static/umap/js/umap.importer.js +2 -1
  56. umap/static/umap/js/umap.js +242 -291
  57. umap/static/umap/js/umap.layer.js +173 -141
  58. umap/static/umap/js/umap.permissions.js +24 -25
  59. umap/static/umap/js/umap.popup.js +14 -14
  60. umap/static/umap/js/umap.share.js +4 -4
  61. umap/static/umap/js/umap.slideshow.js +4 -4
  62. umap/static/umap/js/umap.tableeditor.js +2 -2
  63. umap/static/umap/js/umap.ui.js +1 -1
  64. umap/static/umap/locale/am_ET.js +1 -11
  65. umap/static/umap/locale/am_ET.json +1 -11
  66. umap/static/umap/locale/ar.js +1 -11
  67. umap/static/umap/locale/ar.json +1 -11
  68. umap/static/umap/locale/ast.js +1 -11
  69. umap/static/umap/locale/ast.json +1 -11
  70. umap/static/umap/locale/bg.js +1 -11
  71. umap/static/umap/locale/bg.json +1 -11
  72. umap/static/umap/locale/br.js +1 -11
  73. umap/static/umap/locale/br.json +1 -11
  74. umap/static/umap/locale/ca.js +1 -11
  75. umap/static/umap/locale/ca.json +1 -11
  76. umap/static/umap/locale/cs_CZ.js +1 -11
  77. umap/static/umap/locale/cs_CZ.json +1 -11
  78. umap/static/umap/locale/da.js +1 -11
  79. umap/static/umap/locale/da.json +1 -11
  80. umap/static/umap/locale/de.js +1 -11
  81. umap/static/umap/locale/de.json +1 -11
  82. umap/static/umap/locale/el.js +1 -11
  83. umap/static/umap/locale/el.json +1 -11
  84. umap/static/umap/locale/en.js +1 -11
  85. umap/static/umap/locale/en.json +1 -11
  86. umap/static/umap/locale/en_US.json +1 -11
  87. umap/static/umap/locale/es.js +1 -11
  88. umap/static/umap/locale/es.json +1 -11
  89. umap/static/umap/locale/et.js +1 -11
  90. umap/static/umap/locale/et.json +1 -11
  91. umap/static/umap/locale/fa_IR.js +6 -16
  92. umap/static/umap/locale/fa_IR.json +6 -16
  93. umap/static/umap/locale/fi.js +1 -11
  94. umap/static/umap/locale/fi.json +1 -11
  95. umap/static/umap/locale/fr.js +1 -11
  96. umap/static/umap/locale/fr.json +1 -11
  97. umap/static/umap/locale/gl.js +1 -11
  98. umap/static/umap/locale/gl.json +1 -11
  99. umap/static/umap/locale/he.js +1 -11
  100. umap/static/umap/locale/he.json +1 -11
  101. umap/static/umap/locale/hr.js +1 -11
  102. umap/static/umap/locale/hr.json +1 -11
  103. umap/static/umap/locale/hu.js +1 -11
  104. umap/static/umap/locale/hu.json +1 -11
  105. umap/static/umap/locale/id.js +1 -11
  106. umap/static/umap/locale/id.json +1 -11
  107. umap/static/umap/locale/is.js +1 -11
  108. umap/static/umap/locale/is.json +1 -11
  109. umap/static/umap/locale/it.js +1 -11
  110. umap/static/umap/locale/it.json +1 -11
  111. umap/static/umap/locale/ja.js +1 -11
  112. umap/static/umap/locale/ja.json +1 -11
  113. umap/static/umap/locale/ko.js +1 -11
  114. umap/static/umap/locale/ko.json +1 -11
  115. umap/static/umap/locale/lt.js +1 -11
  116. umap/static/umap/locale/lt.json +1 -11
  117. umap/static/umap/locale/ms.js +1 -11
  118. umap/static/umap/locale/ms.json +1 -11
  119. umap/static/umap/locale/nl.js +1 -11
  120. umap/static/umap/locale/nl.json +1 -11
  121. umap/static/umap/locale/no.js +1 -11
  122. umap/static/umap/locale/no.json +1 -11
  123. umap/static/umap/locale/pl.js +1 -11
  124. umap/static/umap/locale/pl.json +1 -11
  125. umap/static/umap/locale/pl_PL.json +1 -11
  126. umap/static/umap/locale/pt.js +1 -11
  127. umap/static/umap/locale/pt.json +1 -11
  128. umap/static/umap/locale/pt_BR.js +1 -11
  129. umap/static/umap/locale/pt_BR.json +1 -11
  130. umap/static/umap/locale/pt_PT.js +1 -11
  131. umap/static/umap/locale/pt_PT.json +1 -11
  132. umap/static/umap/locale/ro.js +1 -11
  133. umap/static/umap/locale/ro.json +1 -11
  134. umap/static/umap/locale/ru.js +1 -11
  135. umap/static/umap/locale/ru.json +1 -11
  136. umap/static/umap/locale/sk_SK.js +1 -11
  137. umap/static/umap/locale/sk_SK.json +1 -11
  138. umap/static/umap/locale/sl.js +1 -11
  139. umap/static/umap/locale/sl.json +1 -11
  140. umap/static/umap/locale/sr.js +1 -11
  141. umap/static/umap/locale/sr.json +1 -11
  142. umap/static/umap/locale/sv.js +1 -11
  143. umap/static/umap/locale/sv.json +1 -11
  144. umap/static/umap/locale/th_TH.js +1 -11
  145. umap/static/umap/locale/th_TH.json +1 -11
  146. umap/static/umap/locale/tr.js +1 -11
  147. umap/static/umap/locale/tr.json +1 -11
  148. umap/static/umap/locale/uk_UA.js +1 -11
  149. umap/static/umap/locale/uk_UA.json +1 -11
  150. umap/static/umap/locale/vi.js +1 -11
  151. umap/static/umap/locale/vi.json +1 -11
  152. umap/static/umap/locale/vi_VN.json +1 -11
  153. umap/static/umap/locale/zh.js +1 -11
  154. umap/static/umap/locale/zh.json +1 -11
  155. umap/static/umap/locale/zh_CN.json +1 -11
  156. umap/static/umap/locale/zh_TW.Big5.json +1 -11
  157. umap/static/umap/locale/zh_TW.js +17 -27
  158. umap/static/umap/locale/zh_TW.json +17 -27
  159. umap/static/umap/map.css +2 -2
  160. umap/static/umap/nav.css +2 -1
  161. umap/static/umap/test/.eslintrc +0 -1
  162. umap/static/umap/test/Choropleth.js +29 -27
  163. umap/static/umap/test/DataLayer.js +207 -239
  164. umap/static/umap/test/Feature.js +33 -58
  165. umap/static/umap/test/Map.Export.js +11 -11
  166. umap/static/umap/test/Map.js +66 -67
  167. umap/static/umap/test/Marker.js +36 -32
  168. umap/static/umap/test/Polygon.js +95 -95
  169. umap/static/umap/test/Polyline.js +31 -31
  170. umap/static/umap/test/TableEditor.js +29 -25
  171. umap/static/umap/test/_pre.js +2 -7
  172. umap/static/umap/test/index.html +4 -4
  173. umap/static/umap/vendors/contextmenu/leaflet.contextmenu.css +54 -0
  174. umap/static/umap/vendors/contextmenu/leaflet.contextmenu.js +586 -0
  175. umap/static/umap/vendors/csv2geojson/index.js +259 -0
  176. umap/static/umap/vendors/dompurify/purify.js +1633 -0
  177. umap/static/umap/vendors/locatecontrol/L.Control.Locate.css +63 -0
  178. umap/static/umap/vendors/locatecontrol/L.Control.Locate.js +950 -0
  179. umap/static/umap/vendors/minimap/Control.MiniMap.css +88 -0
  180. umap/static/umap/vendors/minimap/Control.MiniMap.js +352 -0
  181. umap/static/umap/vendors/togeojson/togeojson.js +2 -0
  182. umap/templates/auth/user_form.html +3 -2
  183. umap/templates/base.html +1 -0
  184. umap/templates/registration/login.html +51 -36
  185. umap/templates/umap/about_summary.html +1 -1
  186. umap/templates/umap/branding.html +3 -0
  187. umap/templates/umap/content.html +15 -39
  188. umap/templates/umap/header.html +0 -0
  189. umap/templates/umap/home.html +4 -2
  190. umap/templates/umap/js.html +0 -1
  191. umap/templates/umap/map_detail.html +9 -0
  192. umap/templates/umap/map_init.html +1 -1
  193. umap/templates/umap/map_messages.html +4 -2
  194. umap/templates/umap/map_table.html +130 -69
  195. umap/templates/umap/navigation.html +2 -4
  196. umap/templates/umap/user_dashboard.html +29 -6
  197. umap/tests/base.py +1 -1
  198. umap/tests/integration/conftest.py +18 -0
  199. umap/tests/integration/test_anonymous_owned_map.py +6 -3
  200. umap/tests/integration/test_browser.py +166 -6
  201. umap/tests/integration/test_collaborative_editing.py +23 -5
  202. umap/tests/integration/test_dashboard.py +17 -0
  203. umap/tests/integration/test_edit_datalayer.py +4 -3
  204. umap/tests/integration/test_export_map.py +1 -1
  205. umap/tests/integration/test_import.py +9 -4
  206. umap/tests/integration/test_map.py +64 -0
  207. umap/tests/integration/test_map_preview.py +75 -0
  208. umap/tests/integration/test_owned_map.py +11 -25
  209. umap/tests/integration/test_picto.py +3 -3
  210. umap/tests/integration/test_querystring.py +52 -0
  211. umap/tests/integration/test_share.py +22 -0
  212. umap/tests/test_map_views.py +157 -14
  213. umap/tests/test_views.py +50 -11
  214. umap/urls.py +6 -12
  215. umap/views.py +170 -47
  216. {umap_project-1.14.0a5.dist-info → umap_project-2.0.0a0.dist-info}/METADATA +13 -15
  217. {umap_project-1.14.0a5.dist-info → umap_project-2.0.0a0.dist-info}/RECORD +220 -199
  218. umap/static/umap/js/umap.browser.js +0 -148
  219. umap/static/umap/js/umap.xhr.js +0 -304
  220. umap/static/umap/test/Controls.js +0 -100
  221. umap/static/umap/test/Map.Init.js +0 -46
  222. {umap_project-1.14.0a5.dist-info → umap_project-2.0.0a0.dist-info}/WHEEL +0 -0
  223. {umap_project-1.14.0a5.dist-info → umap_project-2.0.0a0.dist-info}/entry_points.txt +0 -0
  224. {umap_project-1.14.0a5.dist-info → umap_project-2.0.0a0.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
1
- L.U.FeatureMixin = {
1
+ U.FeatureMixin = {
2
2
  staticOptions: { mainColor: 'color' },
3
3
 
4
4
  initialize: function (map, latlng, options) {
@@ -94,7 +94,7 @@ L.U.FeatureMixin = {
94
94
  L._('Feature properties')
95
95
  )
96
96
 
97
- let builder = new L.U.FormBuilder(this, ['datalayer'], {
97
+ let builder = new U.FormBuilder(this, ['datalayer'], {
98
98
  callback: function () {
99
99
  this.edit(e)
100
100
  }, // removeLayer step will close the edit panel, let's reopen it
@@ -113,7 +113,7 @@ L.U.FeatureMixin = {
113
113
  // We always want name and description for now (properties management to come)
114
114
  properties.unshift('properties.description')
115
115
  properties.unshift('properties.name')
116
- builder = new L.U.FormBuilder(this, properties, {
116
+ builder = new U.FormBuilder(this, properties, {
117
117
  id: 'umap-feature-properties',
118
118
  callback: this._redraw, // In case we have dynamic options…
119
119
  })
@@ -144,7 +144,7 @@ L.U.FeatureMixin = {
144
144
 
145
145
  appendEditFieldsets: function (container) {
146
146
  const optionsFields = this.getShapeOptions()
147
- let builder = new L.U.FormBuilder(this, optionsFields, {
147
+ let builder = new U.FormBuilder(this, optionsFields, {
148
148
  id: 'umap-feature-shape-properties',
149
149
  callback: this._redraw,
150
150
  })
@@ -152,7 +152,7 @@ L.U.FeatureMixin = {
152
152
  shapeProperties.appendChild(builder.build())
153
153
 
154
154
  const advancedOptions = this.getAdvancedOptions()
155
- builder = new L.U.FormBuilder(this, advancedOptions, {
155
+ builder = new U.FormBuilder(this, advancedOptions, {
156
156
  id: 'umap-feature-advanced-properties',
157
157
  callback: this._redraw,
158
158
  })
@@ -163,7 +163,7 @@ L.U.FeatureMixin = {
163
163
  advancedProperties.appendChild(builder.build())
164
164
 
165
165
  const interactionOptions = this.getInteractionOptions()
166
- builder = new L.U.FormBuilder(this, interactionOptions, {
166
+ builder = new U.FormBuilder(this, interactionOptions, {
167
167
  callback: this._redraw,
168
168
  })
169
169
  const popupFieldset = L.DomUtil.createFieldset(
@@ -205,7 +205,7 @@ L.U.FeatureMixin = {
205
205
 
206
206
  getPopupClass: function () {
207
207
  const old = this.getOption('popupTemplate') // Retrocompat.
208
- return L.U.Popup[this.getOption('popupShape') || old] || L.U.Popup
208
+ return U.Popup[this.getOption('popupShape') || old] || U.Popup
209
209
  },
210
210
 
211
211
  attachPopup: function () {
@@ -382,7 +382,7 @@ L.U.FeatureMixin = {
382
382
  },
383
383
 
384
384
  getInplaceToolbarActions: function (e) {
385
- return [L.U.ToggleEditAction, L.U.DeleteFeatureAction]
385
+ return [U.ToggleEditAction, U.DeleteFeatureAction]
386
386
  },
387
387
 
388
388
  _showContextMenu: function (e) {
@@ -502,7 +502,7 @@ L.U.FeatureMixin = {
502
502
  },
503
503
 
504
504
  getVertexActions: function () {
505
- return [L.U.DeleteVertexAction]
505
+ return [U.DeleteVertexAction]
506
506
  },
507
507
 
508
508
  isMulti: function () {
@@ -539,9 +539,9 @@ L.U.FeatureMixin = {
539
539
  },
540
540
  }
541
541
 
542
- L.U.Marker = L.Marker.extend({
542
+ U.Marker = L.Marker.extend({
543
543
  parentClass: L.Marker,
544
- includes: [L.U.FeatureMixin],
544
+ includes: [U.FeatureMixin],
545
545
 
546
546
  preInit: function () {
547
547
  this.setIcon(this.getIcon())
@@ -556,7 +556,7 @@ L.U.Marker = L.Marker.extend({
556
556
  },
557
557
 
558
558
  addInteractions: function () {
559
- L.U.FeatureMixin.addInteractions.call(this)
559
+ U.FeatureMixin.addInteractions.call(this)
560
560
  this.on(
561
561
  'dragend',
562
562
  function (e) {
@@ -639,7 +639,7 @@ L.U.Marker = L.Marker.extend({
639
639
 
640
640
  disconnectFromDataLayer: function (datalayer) {
641
641
  this.options.icon.datalayer = null
642
- L.U.FeatureMixin.disconnectFromDataLayer.call(this, datalayer)
642
+ U.FeatureMixin.disconnectFromDataLayer.call(this, datalayer)
643
643
  },
644
644
 
645
645
  _getIconUrl: function (name) {
@@ -652,7 +652,7 @@ L.U.Marker = L.Marker.extend({
652
652
  },
653
653
 
654
654
  getIcon: function () {
655
- const Class = L.U.Icon[this.getIconClass()] || L.U.Icon.Default
655
+ const Class = U.Icon[this.getIconClass()] || U.Icon.Default
656
656
  return new Class(this.map, { feature: this })
657
657
  },
658
658
 
@@ -678,12 +678,12 @@ L.U.Marker = L.Marker.extend({
678
678
  },
679
679
 
680
680
  appendEditFieldsets: function (container) {
681
- L.U.FeatureMixin.appendEditFieldsets.call(this, container)
681
+ U.FeatureMixin.appendEditFieldsets.call(this, container)
682
682
  const coordinatesOptions = [
683
683
  ['_latlng.lat', { handler: 'FloatInput', label: L._('Latitude') }],
684
684
  ['_latlng.lng', { handler: 'FloatInput', label: L._('Longitude') }],
685
685
  ]
686
- const builder = new L.U.FormBuilder(this, coordinatesOptions, {
686
+ const builder = new U.FormBuilder(this, coordinatesOptions, {
687
687
  callback: function () {
688
688
  if (!this._latlng.isValid()) {
689
689
  this.map.ui.alert({
@@ -707,7 +707,7 @@ L.U.Marker = L.Marker.extend({
707
707
  // callback is mandatory for zoomToShowLayer
708
708
  this.datalayer.layer.zoomToShowLayer(this, e.callback || (() => {}))
709
709
  } else {
710
- L.U.FeatureMixin.zoomTo.call(this, e)
710
+ U.FeatureMixin.zoomTo.call(this, e)
711
711
  }
712
712
  },
713
713
 
@@ -721,13 +721,13 @@ L.U.Marker = L.Marker.extend({
721
721
  },
722
722
  })
723
723
 
724
- L.U.PathMixin = {
724
+ U.PathMixin = {
725
725
  hasGeom: function () {
726
726
  return !this.isEmpty()
727
727
  },
728
728
 
729
729
  connectToDataLayer: function (datalayer) {
730
- L.U.FeatureMixin.connectToDataLayer.call(this, datalayer)
730
+ U.FeatureMixin.connectToDataLayer.call(this, datalayer)
731
731
  // We keep markers on their own layer on top of the paths.
732
732
  this.options.pane = this.datalayer.pane
733
733
  },
@@ -735,7 +735,7 @@ L.U.PathMixin = {
735
735
  edit: function (e) {
736
736
  if (this.map.editEnabled) {
737
737
  if (!this.editEnabled()) this.enableEdit()
738
- L.U.FeatureMixin.edit.call(this, e)
738
+ U.FeatureMixin.edit.call(this, e)
739
739
  }
740
740
  },
741
741
 
@@ -794,8 +794,10 @@ L.U.PathMixin = {
794
794
  },
795
795
 
796
796
  _redraw: function () {
797
- this.setStyle()
798
- this.resetTooltip()
797
+ if (this.datalayer && this.datalayer.isVisible()) {
798
+ this.setStyle()
799
+ this.resetTooltip()
800
+ }
799
801
  },
800
802
 
801
803
  onAdd: function (map) {
@@ -814,7 +816,7 @@ L.U.PathMixin = {
814
816
  // this.map.off('showmeasure', this.showMeasureTooltip, this);
815
817
  // this.map.off('hidemeasure', this.removeTooltip, this);
816
818
  if (this.editing && this.editing.enabled()) this.editing.removeHooks()
817
- L.U.FeatureMixin.onRemove.call(this, map)
819
+ U.FeatureMixin.onRemove.call(this, map)
818
820
  },
819
821
 
820
822
  getBestZoom: function () {
@@ -823,7 +825,7 @@ L.U.PathMixin = {
823
825
 
824
826
  endEdit: function () {
825
827
  this.disableEdit()
826
- L.U.FeatureMixin.endEdit.call(this)
828
+ U.FeatureMixin.endEdit.call(this)
827
829
  },
828
830
 
829
831
  highlightPath: function () {
@@ -843,7 +845,7 @@ L.U.PathMixin = {
843
845
  },
844
846
 
845
847
  addInteractions: function () {
846
- L.U.FeatureMixin.addInteractions.call(this)
848
+ U.FeatureMixin.addInteractions.call(this)
847
849
  this.on('mouseover', this._onMouseOver)
848
850
  this.on('edit', this.makeDirty)
849
851
  this.on('drag editable:drag', this._onDrag)
@@ -869,7 +871,7 @@ L.U.PathMixin = {
869
871
  this.disableEdit()
870
872
  if (!shape) return
871
873
  const properties = this.cloneProperties()
872
- const other = new (this instanceof L.U.Polyline ? L.U.Polyline : L.U.Polygon)(
874
+ const other = new (this instanceof U.Polyline ? U.Polyline : U.Polygon)(
873
875
  this.map,
874
876
  shape,
875
877
  { geojson: { properties: properties } }
@@ -880,7 +882,7 @@ L.U.PathMixin = {
880
882
  },
881
883
 
882
884
  getContextMenuItems: function (e) {
883
- let items = L.U.FeatureMixin.getContextMenuItems.call(this, e)
885
+ let items = U.FeatureMixin.getContextMenuItems.call(this, e)
884
886
  items.push({
885
887
  text: L._('Display measure'),
886
888
  callback: function () {
@@ -920,7 +922,7 @@ L.U.PathMixin = {
920
922
  },
921
923
 
922
924
  getContextMenuEditItems: function (e) {
923
- const items = L.U.FeatureMixin.getContextMenuEditItems.call(this, e)
925
+ const items = U.FeatureMixin.getContextMenuEditItems.call(this, e)
924
926
  if (
925
927
  this.map.editedFeature &&
926
928
  this.isSameClass(this.map.editedFeature) &&
@@ -947,10 +949,10 @@ L.U.PathMixin = {
947
949
  },
948
950
 
949
951
  getInplaceToolbarActions: function (e) {
950
- const items = L.U.FeatureMixin.getInplaceToolbarActions.call(this, e)
952
+ const items = U.FeatureMixin.getInplaceToolbarActions.call(this, e)
951
953
  if (this.isMulti()) {
952
- items.push(L.U.DeleteShapeAction)
953
- items.push(L.U.ExtractShapeFromMultiAction)
954
+ items.push(U.DeleteShapeAction)
955
+ items.push(U.ExtractShapeFromMultiAction)
954
956
  }
955
957
  return items
956
958
  },
@@ -973,9 +975,9 @@ L.U.PathMixin = {
973
975
  },
974
976
  }
975
977
 
976
- L.U.Polyline = L.Polyline.extend({
978
+ U.Polyline = L.Polyline.extend({
977
979
  parentClass: L.Polyline,
978
- includes: [L.U.FeatureMixin, L.U.PathMixin],
980
+ includes: [U.FeatureMixin, U.PathMixin],
979
981
 
980
982
  staticOptions: {
981
983
  stroke: true,
@@ -984,7 +986,7 @@ L.U.Polyline = L.Polyline.extend({
984
986
  },
985
987
 
986
988
  isSameClass: function (other) {
987
- return other instanceof L.U.Polyline
989
+ return other instanceof U.Polyline
988
990
  },
989
991
 
990
992
  getClassName: function () {
@@ -997,7 +999,7 @@ L.U.Polyline = L.Polyline.extend({
997
999
  },
998
1000
 
999
1001
  getContextMenuEditItems: function (e) {
1000
- const items = L.U.PathMixin.getContextMenuEditItems.call(this, e)
1002
+ const items = U.PathMixin.getContextMenuEditItems.call(this, e)
1001
1003
  const vertexClicked = e.vertex
1002
1004
  let index
1003
1005
  if (!this.isMulti()) {
@@ -1027,7 +1029,7 @@ L.U.Polyline = L.Polyline.extend({
1027
1029
  },
1028
1030
 
1029
1031
  getContextMenuMultiItems: function (e) {
1030
- const items = L.U.PathMixin.getContextMenuMultiItems.call(this, e)
1032
+ const items = U.PathMixin.getContextMenuMultiItems.call(this, e)
1031
1033
  items.push({
1032
1034
  text: L._('Merge lines'),
1033
1035
  callback: this.mergeShapes,
@@ -1048,7 +1050,7 @@ L.U.Polyline = L.Polyline.extend({
1048
1050
  },
1049
1051
 
1050
1052
  getAdvancedEditActions: function (container) {
1051
- L.U.FeatureMixin.getAdvancedEditActions.call(this, container)
1053
+ U.FeatureMixin.getAdvancedEditActions.call(this, container)
1052
1054
  const toPolygon = L.DomUtil.createButton(
1053
1055
  'button umap-to-polygon',
1054
1056
  container,
@@ -1108,24 +1110,24 @@ L.U.Polyline = L.Polyline.extend({
1108
1110
  },
1109
1111
 
1110
1112
  getVertexActions: function (e) {
1111
- const actions = L.U.FeatureMixin.getVertexActions.call(this, e),
1113
+ const actions = U.FeatureMixin.getVertexActions.call(this, e),
1112
1114
  index = e.vertex.getIndex()
1113
1115
  if (index === 0 || index === e.vertex.getLastIndex())
1114
- actions.push(L.U.ContinueLineAction)
1115
- else actions.push(L.U.SplitLineAction)
1116
+ actions.push(U.ContinueLineAction)
1117
+ else actions.push(U.SplitLineAction)
1116
1118
  return actions
1117
1119
  },
1118
1120
  })
1119
1121
 
1120
- L.U.Polygon = L.Polygon.extend({
1122
+ U.Polygon = L.Polygon.extend({
1121
1123
  parentClass: L.Polygon,
1122
- includes: [L.U.FeatureMixin, L.U.PathMixin],
1124
+ includes: [U.FeatureMixin, U.PathMixin],
1123
1125
  staticOptions: {
1124
1126
  mainColor: 'fillColor',
1125
1127
  },
1126
1128
 
1127
1129
  isSameClass: function (other) {
1128
- return other instanceof L.U.Polygon
1130
+ return other instanceof U.Polygon
1129
1131
  },
1130
1132
 
1131
1133
  getClassName: function () {
@@ -1133,7 +1135,7 @@ L.U.Polygon = L.Polygon.extend({
1133
1135
  },
1134
1136
 
1135
1137
  getShapeOptions: function () {
1136
- const options = L.U.PathMixin.getShapeOptions()
1138
+ const options = U.PathMixin.getShapeOptions()
1137
1139
  options.push(
1138
1140
  'properties._umap_options.stroke',
1139
1141
  'properties._umap_options.fill',
@@ -1144,7 +1146,7 @@ L.U.Polygon = L.Polygon.extend({
1144
1146
  },
1145
1147
 
1146
1148
  getInteractionOptions: function () {
1147
- const options = L.U.FeatureMixin.getInteractionOptions()
1149
+ const options = U.FeatureMixin.getInteractionOptions()
1148
1150
  options.push('properties._umap_options.interactive')
1149
1151
  return options
1150
1152
  },
@@ -1155,7 +1157,7 @@ L.U.Polygon = L.Polygon.extend({
1155
1157
  },
1156
1158
 
1157
1159
  getContextMenuEditItems: function (e) {
1158
- const items = L.U.PathMixin.getContextMenuEditItems.call(this, e),
1160
+ const items = U.PathMixin.getContextMenuEditItems.call(this, e),
1159
1161
  shape = this.shapeAt(e.latlng)
1160
1162
  // No multi and no holes.
1161
1163
  if (shape && !this.isMulti() && (L.LineUtil.isFlat(shape) || shape.length === 1)) {
@@ -1189,7 +1191,7 @@ L.U.Polygon = L.Polygon.extend({
1189
1191
  },
1190
1192
 
1191
1193
  getAdvancedEditActions: function (container) {
1192
- L.U.FeatureMixin.getAdvancedEditActions.call(this, container)
1194
+ U.FeatureMixin.getAdvancedEditActions.call(this, container)
1193
1195
  const toPolyline = L.DomUtil.createButton(
1194
1196
  'button umap-to-polyline',
1195
1197
  container,
@@ -1209,8 +1211,8 @@ L.U.Polygon = L.Polygon.extend({
1209
1211
  },
1210
1212
 
1211
1213
  getInplaceToolbarActions: function (e) {
1212
- const items = L.U.PathMixin.getInplaceToolbarActions.call(this, e)
1213
- items.push(L.U.CreateHoleAction)
1214
+ const items = U.PathMixin.getInplaceToolbarActions.call(this, e)
1215
+ items.push(U.CreateHoleAction)
1214
1216
  return items
1215
1217
  },
1216
1218
  })
@@ -379,10 +379,10 @@ L.FormBuilder.PopupContent = L.FormBuilder.Select.extend({
379
379
  L.FormBuilder.LayerTypeChooser = L.FormBuilder.Select.extend({
380
380
  getOptions: function () {
381
381
  const layer_classes = [
382
- L.U.Layer.Default,
383
- L.U.Layer.Cluster,
384
- L.U.Layer.Heat,
385
- L.U.Layer.Choropleth,
382
+ U.Layer.Default,
383
+ U.Layer.Cluster,
384
+ U.Layer.Heat,
385
+ U.Layer.Choropleth,
386
386
  ]
387
387
  return layer_classes.map((class_) => [class_.TYPE, class_.NAME])
388
388
  },
@@ -405,7 +405,7 @@ L.FormBuilder.DataLayerSwitcher = L.FormBuilder.Select.extend({
405
405
  if (
406
406
  datalayer.isLoaded() &&
407
407
  !datalayer.isDataReadOnly() &&
408
- datalayer.canBrowse()
408
+ datalayer.isBrowsable()
409
409
  ) {
410
410
  options.push([L.stamp(datalayer), datalayer.getName()])
411
411
  }
@@ -607,7 +607,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
607
607
  // Do not try to render URL with variables
608
608
  const box = L.DomUtil.create('div', 'umap-pictogram-choice', this.buttons)
609
609
  L.DomEvent.on(box, 'click', this.onDefine, this)
610
- const icon = L.U.Icon.makeIconElement(this.value(), box)
610
+ const icon = U.Icon.makeIconElement(this.value(), box)
611
611
  }
612
612
  this.button = L.DomUtil.createButton(
613
613
  'button action-button',
@@ -685,7 +685,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
685
685
  return !this.value() || this.value() === this.obj.getMap().options.default_iconUrl
686
686
  },
687
687
 
688
- showSymbolsTab: function () {
688
+ showSymbolsTab: async function () {
689
689
  this.openTab('symbols')
690
690
  this.searchInput = L.DomUtil.create('input', '', this.body)
691
691
  this.searchInput.type = 'search'
@@ -695,19 +695,19 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
695
695
  if (this.pictogram_list) {
696
696
  this.buildSymbolsList()
697
697
  } else {
698
- this.builder.map.get(this.builder.map.options.urls.pictogram_list_json, {
699
- callback: (data) => {
700
- this.pictogram_list = data.pictogram_list
701
- this.buildSymbolsList()
702
- },
703
- context: this,
704
- })
698
+ const [{ pictogram_list }, response, error] = await this.builder.map.server.get(
699
+ this.builder.map.options.urls.pictogram_list_json
700
+ )
701
+ if (!error) {
702
+ this.pictogram_list = pictogram_list
703
+ this.buildSymbolsList()
704
+ }
705
705
  }
706
706
  },
707
707
 
708
708
  showCharsTab: function () {
709
709
  this.openTab('chars')
710
- const value = !L.U.Icon.isImg(this.value()) ? this.value() : null
710
+ const value = !U.Icon.isImg(this.value()) ? this.value() : null
711
711
  const input = this.buildInput(this.body, value)
712
712
  input.placeholder = L._('Type char or paste emoji')
713
713
  input.type = 'text'
@@ -960,7 +960,7 @@ L.FormBuilder.ManageOwner = L.FormBuilder.Element.extend({
960
960
  className: 'edit-owner',
961
961
  on_select: L.bind(this.onSelect, this),
962
962
  }
963
- this.autocomplete = new L.U.AutoComplete.Ajax.Select(this.parentNode, options)
963
+ this.autocomplete = new U.AutoComplete.Ajax.Select(this.parentNode, options)
964
964
  const owner = this.toHTML()
965
965
  if (owner)
966
966
  this.autocomplete.displaySelected({
@@ -989,7 +989,7 @@ L.FormBuilder.ManageEditors = L.FormBuilder.Element.extend({
989
989
  on_select: L.bind(this.onSelect, this),
990
990
  on_unselect: L.bind(this.onUnselect, this),
991
991
  }
992
- this.autocomplete = new L.U.AutoComplete.Ajax.SelectMultiple(
992
+ this.autocomplete = new U.AutoComplete.Ajax.SelectMultiple(
993
993
  this.parentNode,
994
994
  options
995
995
  )
@@ -1023,7 +1023,7 @@ L.FormBuilder.ManageEditors = L.FormBuilder.Element.extend({
1023
1023
  },
1024
1024
  })
1025
1025
 
1026
- L.U.FormBuilder = L.FormBuilder.extend({
1026
+ U.FormBuilder = L.FormBuilder.extend({
1027
1027
  options: {
1028
1028
  className: 'umap-form',
1029
1029
  },
@@ -1114,7 +1114,7 @@ L.U.FormBuilder = L.FormBuilder.extend({
1114
1114
  handler: 'IconUrl',
1115
1115
  label: L._('Icon symbol'),
1116
1116
  inheritable: true,
1117
- helpText: L.U.Help.formatIconSymbol,
1117
+ helpText: U.Help.formatIconSymbol,
1118
1118
  },
1119
1119
  popupShape: { handler: 'PopupShape', label: L._('Popup shape'), inheritable: true },
1120
1120
  popupTemplate: {
@@ -1,4 +1,4 @@
1
- L.U.Icon = L.DivIcon.extend({
1
+ U.Icon = L.DivIcon.extend({
2
2
  initialize: function (map, options) {
3
3
  this.map = map
4
4
  const default_options = {
@@ -42,7 +42,7 @@ L.U.Icon = L.DivIcon.extend({
42
42
  onAdd: function () {},
43
43
  })
44
44
 
45
- L.U.Icon.Default = L.U.Icon.extend({
45
+ U.Icon.Default = U.Icon.extend({
46
46
  default_options: {
47
47
  iconAnchor: new L.Point(16, 40),
48
48
  popupAnchor: new L.Point(0, -40),
@@ -52,11 +52,11 @@ L.U.Icon.Default = L.U.Icon.extend({
52
52
 
53
53
  initialize: function (map, options) {
54
54
  options = L.Util.extend({}, this.default_options, options)
55
- L.U.Icon.prototype.initialize.call(this, map, options)
55
+ U.Icon.prototype.initialize.call(this, map, options)
56
56
  },
57
57
 
58
58
  _setIconStyles: function (img, name) {
59
- L.U.Icon.prototype._setIconStyles.call(this, img, name)
59
+ U.Icon.prototype._setIconStyles.call(this, img, name)
60
60
  const color = this._getColor(),
61
61
  opacity = this._getOpacity()
62
62
  this.elements.container.style.backgroundColor = color
@@ -68,7 +68,7 @@ L.U.Icon.Default = L.U.Icon.extend({
68
68
  onAdd: function () {
69
69
  const src = this._getIconUrl('icon')
70
70
  const bgcolor = this._getColor()
71
- L.U.Icon.setIconContrast(this.elements.icon, this.elements.container, src, bgcolor)
71
+ U.Icon.setIconContrast(this.elements.icon, this.elements.container, src, bgcolor)
72
72
  },
73
73
 
74
74
  createIcon: function () {
@@ -82,14 +82,14 @@ L.U.Icon.Default = L.U.Icon.extend({
82
82
  this.elements.arrow = L.DomUtil.create('div', 'icon_arrow', this.elements.main)
83
83
  const src = this._getIconUrl('icon')
84
84
  if (src) {
85
- this.elements.icon = L.U.Icon.makeIconElement(src, this.elements.container)
85
+ this.elements.icon = U.Icon.makeIconElement(src, this.elements.container)
86
86
  }
87
87
  this._setIconStyles(this.elements.main, 'icon')
88
88
  return this.elements.main
89
89
  },
90
90
  })
91
91
 
92
- L.U.Icon.Circle = L.U.Icon.extend({
92
+ U.Icon.Circle = U.Icon.extend({
93
93
  initialize: function (map, options) {
94
94
  const default_options = {
95
95
  popupAnchor: new L.Point(0, -6),
@@ -97,11 +97,11 @@ L.U.Icon.Circle = L.U.Icon.extend({
97
97
  className: 'umap-circle-icon',
98
98
  }
99
99
  options = L.Util.extend({}, default_options, options)
100
- L.U.Icon.prototype.initialize.call(this, map, options)
100
+ U.Icon.prototype.initialize.call(this, map, options)
101
101
  },
102
102
 
103
103
  _setIconStyles: function (img, name) {
104
- L.U.Icon.prototype._setIconStyles.call(this, img, name)
104
+ U.Icon.prototype._setIconStyles.call(this, img, name)
105
105
  this.elements.main.style.backgroundColor = this._getColor()
106
106
  this.elements.main.style.opacity = this._getOpacity()
107
107
  },
@@ -115,7 +115,7 @@ L.U.Icon.Circle = L.U.Icon.extend({
115
115
  },
116
116
  })
117
117
 
118
- L.U.Icon.Drop = L.U.Icon.Default.extend({
118
+ U.Icon.Drop = U.Icon.Default.extend({
119
119
  default_options: {
120
120
  iconAnchor: new L.Point(16, 42),
121
121
  popupAnchor: new L.Point(0, -42),
@@ -124,7 +124,7 @@ L.U.Icon.Drop = L.U.Icon.Default.extend({
124
124
  },
125
125
  })
126
126
 
127
- L.U.Icon.Ball = L.U.Icon.Default.extend({
127
+ U.Icon.Ball = U.Icon.Default.extend({
128
128
  default_options: {
129
129
  iconAnchor: new L.Point(8, 30),
130
130
  popupAnchor: new L.Point(0, -28),
@@ -146,7 +146,7 @@ L.U.Icon.Ball = L.U.Icon.Default.extend({
146
146
  },
147
147
 
148
148
  _setIconStyles: function (img, name) {
149
- L.U.Icon.prototype._setIconStyles.call(this, img, name)
149
+ U.Icon.prototype._setIconStyles.call(this, img, name)
150
150
  const color = this._getColor('color')
151
151
  let background
152
152
  if (L.Browser.ielt9) {
@@ -161,7 +161,7 @@ L.U.Icon.Ball = L.U.Icon.Default.extend({
161
161
  },
162
162
  })
163
163
 
164
- L.U.Icon.Cluster = L.DivIcon.extend({
164
+ U.Icon.Cluster = L.DivIcon.extend({
165
165
  options: {
166
166
  iconSize: [40, 40],
167
167
  },
@@ -191,13 +191,13 @@ L.U.Icon.Cluster = L.DivIcon.extend({
191
191
  },
192
192
  })
193
193
 
194
- L.U.Icon.isImg = function (src) {
194
+ U.Icon.isImg = function (src) {
195
195
  return L.Util.isPath(src) || L.Util.isRemoteUrl(src) || L.Util.isDataImage(src)
196
196
  }
197
197
 
198
- L.U.Icon.makeIconElement = function (src, parent) {
198
+ U.Icon.makeIconElement = function (src, parent) {
199
199
  let icon
200
- if (L.U.Icon.isImg(src)) {
200
+ if (U.Icon.isImg(src)) {
201
201
  icon = L.DomUtil.create('img')
202
202
  icon.src = src
203
203
  } else {
@@ -208,7 +208,7 @@ L.U.Icon.makeIconElement = function (src, parent) {
208
208
  return icon
209
209
  }
210
210
 
211
- L.U.Icon.setIconContrast = function (icon, parent, src, bgcolor) {
211
+ U.Icon.setIconContrast = function (icon, parent, src, bgcolor) {
212
212
  /*
213
213
  * icon: the element we'll adapt the style, it can be an image or text
214
214
  * parent: the element we'll consider to decide whether to adapt the style,
@@ -1,4 +1,4 @@
1
- L.U.Importer = L.Class.extend({
1
+ U.Importer = L.Class.extend({
2
2
  TYPES: ['geojson', 'csv', 'gpx', 'kml', 'osm', 'georss', 'umap'],
3
3
  initialize: function (map) {
4
4
  this.map = map
@@ -16,6 +16,7 @@ L.U.Importer = L.Class.extend({
16
16
  { type: 'file', multiple: 'multiple', autofocus: true },
17
17
  this.fileBox
18
18
  )
19
+ this.map.ui.once('panel:closed', () => (this.fileInput.value = null))
19
20
  this.urlInput = L.DomUtil.element(
20
21
  'input',
21
22
  { type: 'text', placeholder: L._('Provide an URL here') },