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.BaseAction = L.ToolbarAction.extend({
1
+ U.BaseAction = L.ToolbarAction.extend({
2
2
  initialize: function (map) {
3
3
  this.map = map
4
4
  if (this.options.label) {
@@ -17,7 +17,7 @@ L.U.BaseAction = L.ToolbarAction.extend({
17
17
  },
18
18
  })
19
19
 
20
- L.U.ImportAction = L.U.BaseAction.extend({
20
+ U.ImportAction = U.BaseAction.extend({
21
21
  options: {
22
22
  helpMenu: true,
23
23
  className: 'upload-data dark',
@@ -29,7 +29,7 @@ L.U.ImportAction = L.U.BaseAction.extend({
29
29
  },
30
30
  })
31
31
 
32
- L.U.EditPropertiesAction = L.U.BaseAction.extend({
32
+ U.EditPropertiesAction = U.BaseAction.extend({
33
33
  options: {
34
34
  helpMenu: true,
35
35
  className: 'update-map-settings dark',
@@ -41,7 +41,7 @@ L.U.EditPropertiesAction = L.U.BaseAction.extend({
41
41
  },
42
42
  })
43
43
 
44
- L.U.ChangeTileLayerAction = L.U.BaseAction.extend({
44
+ U.ChangeTileLayerAction = U.BaseAction.extend({
45
45
  options: {
46
46
  helpMenu: true,
47
47
  className: 'dark update-map-tilelayers',
@@ -53,7 +53,7 @@ L.U.ChangeTileLayerAction = L.U.BaseAction.extend({
53
53
  },
54
54
  })
55
55
 
56
- L.U.ManageDatalayersAction = L.U.BaseAction.extend({
56
+ U.ManageDatalayersAction = U.BaseAction.extend({
57
57
  options: {
58
58
  className: 'dark manage-datalayers',
59
59
  tooltip: L._('Manage layers'),
@@ -64,7 +64,7 @@ L.U.ManageDatalayersAction = L.U.BaseAction.extend({
64
64
  },
65
65
  })
66
66
 
67
- L.U.UpdateExtentAction = L.U.BaseAction.extend({
67
+ U.UpdateExtentAction = U.BaseAction.extend({
68
68
  options: {
69
69
  className: 'update-map-extent dark',
70
70
  tooltip: L._('Save this center and zoom'),
@@ -75,7 +75,7 @@ L.U.UpdateExtentAction = L.U.BaseAction.extend({
75
75
  },
76
76
  })
77
77
 
78
- L.U.UpdatePermsAction = L.U.BaseAction.extend({
78
+ U.UpdatePermsAction = U.BaseAction.extend({
79
79
  options: {
80
80
  className: 'update-map-permissions dark',
81
81
  tooltip: L._('Update permissions and editors'),
@@ -86,7 +86,7 @@ L.U.UpdatePermsAction = L.U.BaseAction.extend({
86
86
  },
87
87
  })
88
88
 
89
- L.U.DrawMarkerAction = L.U.BaseAction.extend({
89
+ U.DrawMarkerAction = U.BaseAction.extend({
90
90
  options: {
91
91
  helpMenu: true,
92
92
  className: 'umap-draw-marker dark',
@@ -98,7 +98,7 @@ L.U.DrawMarkerAction = L.U.BaseAction.extend({
98
98
  },
99
99
  })
100
100
 
101
- L.U.DrawPolylineAction = L.U.BaseAction.extend({
101
+ U.DrawPolylineAction = U.BaseAction.extend({
102
102
  options: {
103
103
  helpMenu: true,
104
104
  className: 'umap-draw-polyline dark',
@@ -110,7 +110,7 @@ L.U.DrawPolylineAction = L.U.BaseAction.extend({
110
110
  },
111
111
  })
112
112
 
113
- L.U.DrawPolygonAction = L.U.BaseAction.extend({
113
+ U.DrawPolygonAction = U.BaseAction.extend({
114
114
  options: {
115
115
  helpMenu: true,
116
116
  className: 'umap-draw-polygon dark',
@@ -122,7 +122,7 @@ L.U.DrawPolygonAction = L.U.BaseAction.extend({
122
122
  },
123
123
  })
124
124
 
125
- L.U.AddPolylineShapeAction = L.U.BaseAction.extend({
125
+ U.AddPolylineShapeAction = U.BaseAction.extend({
126
126
  options: {
127
127
  className: 'umap-draw-polyline-multi dark',
128
128
  tooltip: L._('Add a line to the current multi'),
@@ -133,14 +133,14 @@ L.U.AddPolylineShapeAction = L.U.BaseAction.extend({
133
133
  },
134
134
  })
135
135
 
136
- L.U.AddPolygonShapeAction = L.U.AddPolylineShapeAction.extend({
136
+ U.AddPolygonShapeAction = U.AddPolylineShapeAction.extend({
137
137
  options: {
138
138
  className: 'umap-draw-polygon-multi dark',
139
139
  tooltip: L._('Add a polygon to the current multi'),
140
140
  },
141
141
  })
142
142
 
143
- L.U.BaseFeatureAction = L.ToolbarAction.extend({
143
+ U.BaseFeatureAction = L.ToolbarAction.extend({
144
144
  initialize: function (map, feature, latlng) {
145
145
  this.map = map
146
146
  this.feature = feature
@@ -161,7 +161,7 @@ L.U.BaseFeatureAction = L.ToolbarAction.extend({
161
161
  },
162
162
  })
163
163
 
164
- L.U.CreateHoleAction = L.U.BaseFeatureAction.extend({
164
+ U.CreateHoleAction = U.BaseFeatureAction.extend({
165
165
  options: {
166
166
  toolbarIcon: {
167
167
  className: 'umap-new-hole',
@@ -174,7 +174,7 @@ L.U.CreateHoleAction = L.U.BaseFeatureAction.extend({
174
174
  },
175
175
  })
176
176
 
177
- L.U.ToggleEditAction = L.U.BaseFeatureAction.extend({
177
+ U.ToggleEditAction = U.BaseFeatureAction.extend({
178
178
  options: {
179
179
  toolbarIcon: {
180
180
  className: 'umap-toggle-edit',
@@ -188,7 +188,7 @@ L.U.ToggleEditAction = L.U.BaseFeatureAction.extend({
188
188
  },
189
189
  })
190
190
 
191
- L.U.DeleteFeatureAction = L.U.BaseFeatureAction.extend({
191
+ U.DeleteFeatureAction = U.BaseFeatureAction.extend({
192
192
  options: {
193
193
  toolbarIcon: {
194
194
  className: 'umap-delete-all',
@@ -206,7 +206,7 @@ L.U.DeleteFeatureAction = L.U.BaseFeatureAction.extend({
206
206
  },
207
207
  })
208
208
 
209
- L.U.DeleteShapeAction = L.U.BaseFeatureAction.extend({
209
+ U.DeleteShapeAction = U.BaseFeatureAction.extend({
210
210
  options: {
211
211
  toolbarIcon: {
212
212
  className: 'umap-delete-one-of-multi',
@@ -219,7 +219,7 @@ L.U.DeleteShapeAction = L.U.BaseFeatureAction.extend({
219
219
  },
220
220
  })
221
221
 
222
- L.U.ExtractShapeFromMultiAction = L.U.BaseFeatureAction.extend({
222
+ U.ExtractShapeFromMultiAction = U.BaseFeatureAction.extend({
223
223
  options: {
224
224
  toolbarIcon: {
225
225
  className: 'umap-extract-shape-from-multi',
@@ -232,14 +232,14 @@ L.U.ExtractShapeFromMultiAction = L.U.BaseFeatureAction.extend({
232
232
  },
233
233
  })
234
234
 
235
- L.U.BaseVertexAction = L.U.BaseFeatureAction.extend({
235
+ U.BaseVertexAction = U.BaseFeatureAction.extend({
236
236
  initialize: function (map, feature, latlng, vertex) {
237
237
  this.vertex = vertex
238
- L.U.BaseFeatureAction.prototype.initialize.call(this, map, feature, latlng)
238
+ U.BaseFeatureAction.prototype.initialize.call(this, map, feature, latlng)
239
239
  },
240
240
  })
241
241
 
242
- L.U.DeleteVertexAction = L.U.BaseVertexAction.extend({
242
+ U.DeleteVertexAction = U.BaseVertexAction.extend({
243
243
  options: {
244
244
  toolbarIcon: {
245
245
  className: 'umap-delete-vertex',
@@ -252,7 +252,7 @@ L.U.DeleteVertexAction = L.U.BaseVertexAction.extend({
252
252
  },
253
253
  })
254
254
 
255
- L.U.SplitLineAction = L.U.BaseVertexAction.extend({
255
+ U.SplitLineAction = U.BaseVertexAction.extend({
256
256
  options: {
257
257
  toolbarIcon: {
258
258
  className: 'umap-split-line',
@@ -265,7 +265,7 @@ L.U.SplitLineAction = L.U.BaseVertexAction.extend({
265
265
  },
266
266
  })
267
267
 
268
- L.U.ContinueLineAction = L.U.BaseVertexAction.extend({
268
+ U.ContinueLineAction = U.BaseVertexAction.extend({
269
269
  options: {
270
270
  toolbarIcon: {
271
271
  className: 'umap-continue-line',
@@ -279,13 +279,13 @@ L.U.ContinueLineAction = L.U.BaseVertexAction.extend({
279
279
  })
280
280
 
281
281
  // Leaflet.Toolbar doesn't allow twice same toolbar class…
282
- L.U.SettingsToolbar = L.Toolbar.Control.extend({
282
+ U.SettingsToolbar = L.Toolbar.Control.extend({
283
283
  addTo: function (map) {
284
284
  if (map.options.editMode !== 'advanced') return
285
285
  L.Toolbar.Control.prototype.addTo.call(this, map)
286
286
  },
287
287
  })
288
- L.U.DrawToolbar = L.Toolbar.Control.extend({
288
+ U.DrawToolbar = L.Toolbar.Control.extend({
289
289
  initialize: function (options) {
290
290
  L.Toolbar.Control.prototype.initialize.call(this, options)
291
291
  this.map = this.options.map
@@ -295,18 +295,18 @@ L.U.DrawToolbar = L.Toolbar.Control.extend({
295
295
  appendToContainer: function (container) {
296
296
  this.options.actions = []
297
297
  if (this.map.options.enableMarkerDraw) {
298
- this.options.actions.push(L.U.DrawMarkerAction)
298
+ this.options.actions.push(U.DrawMarkerAction)
299
299
  }
300
300
  if (this.map.options.enablePolylineDraw) {
301
- this.options.actions.push(L.U.DrawPolylineAction)
302
- if (this.map.editedFeature && this.map.editedFeature instanceof L.U.Polyline) {
303
- this.options.actions.push(L.U.AddPolylineShapeAction)
301
+ this.options.actions.push(U.DrawPolylineAction)
302
+ if (this.map.editedFeature && this.map.editedFeature instanceof U.Polyline) {
303
+ this.options.actions.push(U.AddPolylineShapeAction)
304
304
  }
305
305
  }
306
306
  if (this.map.options.enablePolygonDraw) {
307
- this.options.actions.push(L.U.DrawPolygonAction)
308
- if (this.map.editedFeature && this.map.editedFeature instanceof L.U.Polygon) {
309
- this.options.actions.push(L.U.AddPolygonShapeAction)
307
+ this.options.actions.push(U.DrawPolygonAction)
308
+ if (this.map.editedFeature && this.map.editedFeature instanceof U.Polygon) {
309
+ this.options.actions.push(U.AddPolygonShapeAction)
310
310
  }
311
311
  }
312
312
  L.Toolbar.Control.prototype.appendToContainer.call(this, container)
@@ -319,7 +319,7 @@ L.U.DrawToolbar = L.Toolbar.Control.extend({
319
319
  },
320
320
  })
321
321
 
322
- L.U.DropControl = L.Class.extend({
322
+ U.DropControl = L.Class.extend({
323
323
  initialize: function (map) {
324
324
  this.map = map
325
325
  this.dropzone = map._container
@@ -365,7 +365,7 @@ L.U.DropControl = L.Class.extend({
365
365
  },
366
366
  })
367
367
 
368
- L.U.EditControl = L.Control.extend({
368
+ U.EditControl = L.Control.extend({
369
369
  options: {
370
370
  position: 'topright',
371
371
  },
@@ -418,7 +418,7 @@ L.Control.Embed = L.Control.extend({
418
418
  },
419
419
  })
420
420
 
421
- L.U.MoreControls = L.Control.extend({
421
+ U.MoreControls = L.Control.extend({
422
422
  options: {
423
423
  position: 'topleft',
424
424
  },
@@ -451,7 +451,7 @@ L.U.MoreControls = L.Control.extend({
451
451
  },
452
452
  })
453
453
 
454
- L.U.PermanentCreditsControl = L.Control.extend({
454
+ U.PermanentCreditsControl = L.Control.extend({
455
455
  options: {
456
456
  position: 'bottomleft',
457
457
  },
@@ -488,7 +488,7 @@ L.U.PermanentCreditsControl = L.Control.extend({
488
488
  },
489
489
  })
490
490
 
491
- L.U.DataLayersControl = L.Control.extend({
491
+ U.DataLayersControl = L.Control.extend({
492
492
  options: {
493
493
  position: 'topleft',
494
494
  },
@@ -626,7 +626,7 @@ L.U.DataLayersControl = L.Control.extend({
626
626
  this.map.eachDataLayerReverse(function (datalayer) {
627
627
  this.addDataLayer(container, datalayer, true)
628
628
  }, this)
629
- const orderable = new L.U.Orderable(container)
629
+ const orderable = new U.Orderable(container)
630
630
  orderable.on(
631
631
  'drop',
632
632
  function (e) {
@@ -659,7 +659,7 @@ L.U.DataLayersControl = L.Control.extend({
659
659
  },
660
660
  })
661
661
 
662
- L.U.DataLayer.include({
662
+ U.DataLayer.include({
663
663
  renderLegend: function (container) {
664
664
  if (this.layer.renderLegend) return this.layer.renderLegend(container)
665
665
  const color = L.DomUtil.create('span', 'datalayer-color', container)
@@ -733,13 +733,25 @@ L.U.DataLayer.include({
733
733
  },
734
734
  })
735
735
 
736
- L.U.DataLayer.addInitHook(function () {
736
+ U.DataLayer.addInitHook(function () {
737
737
  this.on('hide', this.propagateHide)
738
738
  this.on('show', this.propagateShow)
739
739
  if (this.isVisible()) this.propagateShow()
740
740
  })
741
741
 
742
- L.U.Map.include({
742
+ const ControlsMixin = {
743
+ HIDDABLE_CONTROLS: [
744
+ 'zoom',
745
+ 'search',
746
+ 'fullscreen',
747
+ 'embed',
748
+ 'locate',
749
+ 'measure',
750
+ 'editinosm',
751
+ 'datalayers',
752
+ 'star',
753
+ 'tilelayers',
754
+ ],
743
755
  _openFacet: function () {
744
756
  const container = L.DomUtil.create('div', 'umap-facet-search'),
745
757
  title = L.DomUtil.add('h3', 'umap-filter-title', container, L._('Facet search')),
@@ -782,7 +794,7 @@ L.U.Map.include({
782
794
  label: this.getFacetKeys()[current],
783
795
  },
784
796
  ])
785
- const builder = new L.U.FormBuilder(this, fields, {
797
+ const builder = new U.FormBuilder(this, fields, {
786
798
  makeDirty: false,
787
799
  callback: filterFeatures,
788
800
  callbackContext: this,
@@ -1043,10 +1055,10 @@ L.U.Map.include({
1043
1055
  this
1044
1056
  )
1045
1057
  },
1046
- })
1058
+ }
1047
1059
 
1048
1060
  /* Used in view mode to define the current tilelayer */
1049
- L.U.TileLayerControl = L.Control.IconLayers.extend({
1061
+ U.TileLayerControl = L.Control.IconLayers.extend({
1050
1062
  initialize: function (map, options) {
1051
1063
  this.map = map
1052
1064
  L.Control.IconLayers.prototype.initialize.call(this, {
@@ -1065,7 +1077,10 @@ L.U.TileLayerControl = L.Control.IconLayers.extend({
1065
1077
  // when the tilelayer is actually added to the map (needs this._tileZoom
1066
1078
  // to be defined)
1067
1079
  // Fixme when https://github.com/Leaflet/Leaflet/pull/9201 is released
1068
- const icon = L.Util.template(layer.options.url_template, this.map.demoTileInfos)
1080
+ const icon = L.Util.template(
1081
+ layer.options.url_template,
1082
+ this.map.demoTileInfos
1083
+ )
1069
1084
  layers.push({
1070
1085
  title: layer.options.name,
1071
1086
  layer: layer,
@@ -1084,7 +1099,7 @@ L.U.TileLayerControl = L.Control.IconLayers.extend({
1084
1099
  })
1085
1100
 
1086
1101
  /* Used in edit mode to define the default tilelayer */
1087
- L.U.TileLayerChooser = L.Control.extend({
1102
+ U.TileLayerChooser = L.Control.extend({
1088
1103
  options: {
1089
1104
  position: 'topleft',
1090
1105
  },
@@ -1151,7 +1166,7 @@ L.U.TileLayerChooser = L.Control.extend({
1151
1166
  },
1152
1167
  })
1153
1168
 
1154
- L.U.AttributionControl = L.Control.Attribution.extend({
1169
+ U.AttributionControl = L.Control.Attribution.extend({
1155
1170
  options: {
1156
1171
  prefix: '',
1157
1172
  },
@@ -1192,14 +1207,14 @@ L.U.AttributionControl = L.Control.Attribution.extend({
1192
1207
  '',
1193
1208
  container,
1194
1209
  ` — ${L._('Powered by uMap')}`,
1195
- 'https://github.com/umap-project/umap/'
1210
+ 'https://umap-project.org/'
1196
1211
  )
1197
1212
  }
1198
1213
  L.DomUtil.createLink('attribution-toggle', this._container, '')
1199
1214
  },
1200
1215
  })
1201
1216
 
1202
- L.U.StarControl = L.Control.extend({
1217
+ U.StarControl = L.Control.extend({
1203
1218
  options: {
1204
1219
  position: 'topleft',
1205
1220
  },
@@ -1222,7 +1237,7 @@ L.U.StarControl = L.Control.extend({
1222
1237
  },
1223
1238
  })
1224
1239
 
1225
- L.U.Search = L.PhotonSearch.extend({
1240
+ U.Search = L.PhotonSearch.extend({
1226
1241
  initialize: function (map, input, options) {
1227
1242
  this.options.placeholder = L._('Type a place name or coordinates')
1228
1243
  L.PhotonSearch.prototype.initialize.call(this, map, input, options)
@@ -1309,7 +1324,7 @@ L.U.Search = L.PhotonSearch.extend({
1309
1324
  },
1310
1325
  })
1311
1326
 
1312
- L.U.SearchControl = L.Control.extend({
1327
+ U.SearchControl = L.Control.extend({
1313
1328
  options: {
1314
1329
  position: 'topleft',
1315
1330
  },
@@ -1342,7 +1357,7 @@ L.U.SearchControl = L.Control.extend({
1342
1357
  title.textContent = L._('Search location')
1343
1358
  const input = L.DomUtil.create('input', 'photon-input', container)
1344
1359
  const resultsContainer = L.DomUtil.create('div', 'photon-autocomplete', container)
1345
- this.search = new L.U.Search(map, input, options)
1360
+ this.search = new U.Search(map, input, options)
1346
1361
  const id = Math.random()
1347
1362
  this.search.on('ajax:send', () => {
1348
1363
  map.fire('dataloading', { id: id })
@@ -1398,7 +1413,7 @@ L.Control.Loading.include({
1398
1413
  /*
1399
1414
  * Make it dynamic
1400
1415
  */
1401
- L.U.ContextMenu = L.Map.ContextMenu.extend({
1416
+ U.ContextMenu = L.Map.ContextMenu.extend({
1402
1417
  _createItems: function (e) {
1403
1418
  this._map.setContextMenuItems(e)
1404
1419
  L.Map.ContextMenu.prototype._createItems.call(this)
@@ -1412,7 +1427,7 @@ L.U.ContextMenu = L.Map.ContextMenu.extend({
1412
1427
  },
1413
1428
  })
1414
1429
 
1415
- L.U.Editable = L.Editable.extend({
1430
+ U.Editable = L.Editable.extend({
1416
1431
  initialize: function (map, options) {
1417
1432
  L.Editable.prototype.initialize.call(this, map, options)
1418
1433
  this.on(
@@ -1428,7 +1443,7 @@ L.U.Editable = L.Editable.extend({
1428
1443
  })
1429
1444
  // Layer for items added by users
1430
1445
  this.on('editable:drawing:cancel', (e) => {
1431
- if (e.layer instanceof L.U.Marker) e.layer.del()
1446
+ if (e.layer instanceof U.Marker) e.layer.del()
1432
1447
  })
1433
1448
  this.on('editable:drawing:commit', function (e) {
1434
1449
  e.layer.isDirty = true
@@ -1454,15 +1469,15 @@ L.U.Editable = L.Editable.extend({
1454
1469
  },
1455
1470
 
1456
1471
  createPolyline: function (latlngs) {
1457
- return new L.U.Polyline(this.map, latlngs, this._getDefaultProperties())
1472
+ return new U.Polyline(this.map, latlngs, this._getDefaultProperties())
1458
1473
  },
1459
1474
 
1460
1475
  createPolygon: function (latlngs) {
1461
- return new L.U.Polygon(this.map, latlngs, this._getDefaultProperties())
1476
+ return new U.Polygon(this.map, latlngs, this._getDefaultProperties())
1462
1477
  },
1463
1478
 
1464
1479
  createMarker: function (latlng) {
1465
- return new L.U.Marker(this.map, latlng, this._getDefaultProperties())
1480
+ return new U.Marker(this.map, latlng, this._getDefaultProperties())
1466
1481
  },
1467
1482
 
1468
1483
  _getDefaultProperties: function () {
@@ -1,9 +1,3 @@
1
- /* Poor man pub/sub handler, enough for now */
2
-
3
- L.UmapSingleton = L.Evented.extend({})
4
- L.U = new L.UmapSingleton()
5
- L.U.Map = L.Map.extend({})
6
-
7
1
  /*
8
2
  * Utils
9
3
  */
@@ -441,7 +435,7 @@ L.DomEvent.once = (el, types, fn, context) => {
441
435
  /*
442
436
  * Global events
443
437
  */
444
- L.U.Keys = {
438
+ U.Keys = {
445
439
  LEFT: 37,
446
440
  UP: 38,
447
441
  RIGHT: 39,
@@ -465,7 +459,7 @@ L.U.Keys = {
465
459
  Z: 90,
466
460
  }
467
461
 
468
- L.U.Help = L.Class.extend({
462
+ U.Help = L.Class.extend({
469
463
  SHORTCUTS: {
470
464
  DRAW_MARKER: {
471
465
  shortcut: 'Modifier+M',
@@ -548,6 +542,7 @@ L.U.Help = L.Class.extend({
548
542
  label.title = label.textContent = L._('Close')
549
543
  this.content = L.DomUtil.create('div', 'umap-help-content', this.box)
550
544
  this.isMacOS = /mac/i.test(
545
+ // eslint-disable-next-line compat/compat -- Fallback available.
551
546
  navigator.userAgentData ? navigator.userAgentData.platform : navigator.platform
552
547
  )
553
548
  },
@@ -753,7 +748,7 @@ L.U.Help = L.Class.extend({
753
748
  ),
754
749
  })
755
750
 
756
- L.U.Orderable = L.Evented.extend({
751
+ U.Orderable = L.Evented.extend({
757
752
  options: {
758
753
  selector: 'li',
759
754
  color: '#374E75',
@@ -1,4 +1,4 @@
1
- L.U.DataLayerPermissions = L.Class.extend({
1
+ U.DataLayerPermissions = L.Class.extend({
2
2
  options: {
3
3
  edit_status: null,
4
4
  },
@@ -38,7 +38,7 @@ L.U.DataLayerPermissions = L.Class.extend({
38
38
  },
39
39
  ],
40
40
  ],
41
- builder = new L.U.FormBuilder(this, fields, {
41
+ builder = new U.FormBuilder(this, fields, {
42
42
  className: 'umap-form datalayer-permissions',
43
43
  }),
44
44
  form = builder.build()
@@ -51,19 +51,20 @@ L.U.DataLayerPermissions = L.Class.extend({
51
51
  pk: this.datalayer.umap_id,
52
52
  })
53
53
  },
54
- save: function () {
54
+ save: async function () {
55
55
  if (!this.isDirty) return this.datalayer.map.continueSaving()
56
56
  const formData = new FormData()
57
57
  formData.append('edit_status', this.options.edit_status)
58
- this.datalayer.map.post(this.getUrl(), {
59
- data: formData,
60
- context: this,
61
- callback: function (data) {
62
- this.commit()
63
- this.isDirty = false
64
- this.datalayer.map.continueSaving()
65
- },
66
- })
58
+ const [data, response, error] = await this.datalayer.map.server.post(
59
+ this.getUrl(),
60
+ {},
61
+ formData
62
+ )
63
+ if (!error) {
64
+ this.commit()
65
+ this.isDirty = false
66
+ this.datalayer.map.continueSaving()
67
+ }
67
68
  },
68
69
 
69
70
  commit: function () {