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
- describe('L.U.Polyline', function () {
1
+ describe('U.Polyline', function () {
2
2
  var p2ll, map
3
3
 
4
4
  before(function () {
@@ -22,7 +22,7 @@ describe('L.U.Polyline', function () {
22
22
 
23
23
  describe('#isMulti()', function () {
24
24
  it('should return false for basic Polyline', function () {
25
- var layer = new L.U.Polyline(
25
+ var layer = new U.Polyline(
26
26
  this.map,
27
27
  [
28
28
  [1, 2],
@@ -35,7 +35,7 @@ describe('L.U.Polyline', function () {
35
35
  })
36
36
 
37
37
  it('should return false for nested basic Polyline', function () {
38
- var layer = new L.U.Polyline(
38
+ var layer = new U.Polyline(
39
39
  this.map,
40
40
  [
41
41
  [
@@ -66,7 +66,7 @@ describe('L.U.Polyline', function () {
66
66
  ],
67
67
  ],
68
68
  ]
69
- var layer = new L.U.Polyline(this.map, latLngs, { datalayer: this.datalayer })
69
+ var layer = new U.Polyline(this.map, latLngs, { datalayer: this.datalayer })
70
70
  assert.ok(layer.isMulti())
71
71
  })
72
72
  })
@@ -83,7 +83,7 @@ describe('L.U.Polyline', function () {
83
83
  [p2ll(100, 100), p2ll(100, 200)],
84
84
  [p2ll(300, 350), p2ll(350, 400), p2ll(400, 300)],
85
85
  ],
86
- layer = new L.U.Polyline(this.map, latlngs, {
86
+ layer = new U.Polyline(this.map, latlngs, {
87
87
  datalayer: this.datalayer,
88
88
  }).addTo(this.datalayer)
89
89
  happen.once(layer._path, { type: 'contextmenu' })
@@ -92,7 +92,7 @@ describe('L.U.Polyline', function () {
92
92
 
93
93
  it('should not allow to remove shape when not multi', function () {
94
94
  var latlngs = [[p2ll(100, 100), p2ll(100, 200)]],
95
- layer = new L.U.Polyline(this.map, latlngs, {
95
+ layer = new U.Polyline(this.map, latlngs, {
96
96
  datalayer: this.datalayer,
97
97
  }).addTo(this.datalayer)
98
98
  happen.once(layer._path, { type: 'contextmenu' })
@@ -101,7 +101,7 @@ describe('L.U.Polyline', function () {
101
101
 
102
102
  it('should not allow to isolate shape when not multi', function () {
103
103
  var latlngs = [[p2ll(100, 100), p2ll(100, 200)]],
104
- layer = new L.U.Polyline(this.map, latlngs, {
104
+ layer = new U.Polyline(this.map, latlngs, {
105
105
  datalayer: this.datalayer,
106
106
  }).addTo(this.datalayer)
107
107
  happen.once(layer._path, { type: 'contextmenu' })
@@ -113,7 +113,7 @@ describe('L.U.Polyline', function () {
113
113
  [p2ll(100, 150), p2ll(100, 200)],
114
114
  [p2ll(300, 350), p2ll(350, 400), p2ll(400, 300)],
115
115
  ],
116
- layer = new L.U.Polyline(this.map, latlngs, {
116
+ layer = new U.Polyline(this.map, latlngs, {
117
117
  datalayer: this.datalayer,
118
118
  }).addTo(this.datalayer)
119
119
  happen.once(layer._path, { type: 'contextmenu' })
@@ -125,7 +125,7 @@ describe('L.U.Polyline', function () {
125
125
  [p2ll(100, 150), p2ll(100, 200)],
126
126
  [p2ll(300, 350), p2ll(350, 400), p2ll(400, 300)],
127
127
  ],
128
- layer = new L.U.Polyline(this.map, latlngs, {
128
+ layer = new U.Polyline(this.map, latlngs, {
129
129
  datalayer: this.datalayer,
130
130
  }).addTo(this.datalayer)
131
131
  happen.once(layer._path, { type: 'contextmenu' })
@@ -134,7 +134,7 @@ describe('L.U.Polyline', function () {
134
134
 
135
135
  it('should allow to transform to polygon when not multi', function () {
136
136
  var latlngs = [p2ll(100, 150), p2ll(100, 200), p2ll(200, 100)],
137
- layer = new L.U.Polyline(this.map, latlngs, {
137
+ layer = new U.Polyline(this.map, latlngs, {
138
138
  datalayer: this.datalayer,
139
139
  }).addTo(this.datalayer)
140
140
  happen.once(layer._path, { type: 'contextmenu' })
@@ -142,7 +142,7 @@ describe('L.U.Polyline', function () {
142
142
  })
143
143
 
144
144
  it('should not allow to transfer shape when not editedFeature', function () {
145
- var layer = new L.U.Polyline(this.map, [p2ll(100, 150), p2ll(100, 200)], {
145
+ var layer = new U.Polyline(this.map, [p2ll(100, 150), p2ll(100, 200)], {
146
146
  datalayer: this.datalayer,
147
147
  }).addTo(this.datalayer)
148
148
  happen.once(layer._path, { type: 'contextmenu' })
@@ -150,10 +150,10 @@ describe('L.U.Polyline', function () {
150
150
  })
151
151
 
152
152
  it('should not allow to transfer shape when editedFeature is not a line', function () {
153
- var layer = new L.U.Polyline(this.map, [p2ll(100, 150), p2ll(100, 200)], {
153
+ var layer = new U.Polyline(this.map, [p2ll(100, 150), p2ll(100, 200)], {
154
154
  datalayer: this.datalayer,
155
155
  }).addTo(this.datalayer),
156
- other = new L.U.Polygon(
156
+ other = new U.Polygon(
157
157
  this.map,
158
158
  [p2ll(200, 300), p2ll(300, 200), p2ll(200, 100)],
159
159
  { datalayer: this.datalayer }
@@ -164,12 +164,12 @@ describe('L.U.Polyline', function () {
164
164
  })
165
165
 
166
166
  it('should allow to transfer shape when another line is edited', function () {
167
- var layer = new L.U.Polyline(
167
+ var layer = new U.Polyline(
168
168
  this.map,
169
169
  [p2ll(100, 150), p2ll(100, 200), p2ll(200, 100)],
170
170
  { datalayer: this.datalayer }
171
171
  ).addTo(this.datalayer),
172
- other = new L.U.Polyline(this.map, [p2ll(200, 300), p2ll(300, 200)], {
172
+ other = new U.Polyline(this.map, [p2ll(200, 300), p2ll(300, 200)], {
173
173
  datalayer: this.datalayer,
174
174
  }).addTo(this.datalayer)
175
175
  other.edit()
@@ -184,7 +184,7 @@ describe('L.U.Polyline', function () {
184
184
  [p2ll(100, 100), p2ll(100, 200)],
185
185
  [p2ll(300, 350), p2ll(350, 400), p2ll(400, 300)],
186
186
  ],
187
- layer = new L.U.Polyline(this.map, latlngs, {
187
+ layer = new U.Polyline(this.map, latlngs, {
188
188
  datalayer: this.datalayer,
189
189
  }).addTo(this.datalayer)
190
190
  happen.once(layer._path, { type: 'contextmenu' })
@@ -193,7 +193,7 @@ describe('L.U.Polyline', function () {
193
193
 
194
194
  it('should not allow to merge lines when not multi', function () {
195
195
  var latlngs = [[p2ll(100, 100), p2ll(100, 200)]],
196
- layer = new L.U.Polyline(this.map, latlngs, {
196
+ layer = new U.Polyline(this.map, latlngs, {
197
197
  datalayer: this.datalayer,
198
198
  }).addTo(this.datalayer)
199
199
  happen.once(layer._path, { type: 'contextmenu' })
@@ -202,7 +202,7 @@ describe('L.U.Polyline', function () {
202
202
 
203
203
  it('should allow to split lines when clicking on vertex', function () {
204
204
  var latlngs = [[p2ll(300, 350), p2ll(350, 400), p2ll(400, 300)]],
205
- layer = new L.U.Polyline(this.map, latlngs, {
205
+ layer = new U.Polyline(this.map, latlngs, {
206
206
  datalayer: this.datalayer,
207
207
  }).addTo(this.datalayer)
208
208
  layer.enableEdit()
@@ -212,7 +212,7 @@ describe('L.U.Polyline', function () {
212
212
 
213
213
  it('should not allow to split lines when clicking on first vertex', function () {
214
214
  var latlngs = [[p2ll(300, 350), p2ll(350, 400), p2ll(400, 300)]],
215
- layer = new L.U.Polyline(this.map, latlngs, {
215
+ layer = new U.Polyline(this.map, latlngs, {
216
216
  datalayer: this.datalayer,
217
217
  }).addTo(this.datalayer)
218
218
  layer.enableEdit()
@@ -223,7 +223,7 @@ describe('L.U.Polyline', function () {
223
223
 
224
224
  it('should not allow to split lines when clicking on last vertex', function () {
225
225
  var latlngs = [[p2ll(300, 350), p2ll(350, 400), p2ll(400, 300)]],
226
- layer = new L.U.Polyline(this.map, latlngs, {
226
+ layer = new U.Polyline(this.map, latlngs, {
227
227
  datalayer: this.datalayer,
228
228
  }).addTo(this.datalayer)
229
229
  layer.enableEdit()
@@ -240,7 +240,7 @@ describe('L.U.Polyline', function () {
240
240
  })
241
241
 
242
242
  it('"add shape" control should be visible when editing a Polyline', function () {
243
- var layer = new L.U.Polyline(this.map, [p2ll(100, 100), p2ll(100, 200)], {
243
+ var layer = new U.Polyline(this.map, [p2ll(100, 100), p2ll(100, 200)], {
244
244
  datalayer: this.datalayer,
245
245
  }).addTo(this.datalayer)
246
246
  layer.edit()
@@ -248,7 +248,7 @@ describe('L.U.Polyline', function () {
248
248
  })
249
249
 
250
250
  it('"add shape" control should extend the same multi', function () {
251
- var layer = new L.U.Polyline(this.map, [p2ll(100, 100), p2ll(100, 200)], {
251
+ var layer = new U.Polyline(this.map, [p2ll(100, 100), p2ll(100, 200)], {
252
252
  datalayer: this.datalayer,
253
253
  }).addTo(this.datalayer)
254
254
  layer.edit()
@@ -267,10 +267,10 @@ describe('L.U.Polyline', function () {
267
267
  describe('#transferShape', function () {
268
268
  it('should transfer simple line shape to another line', function () {
269
269
  var latlngs = [p2ll(100, 150), p2ll(100, 200), p2ll(200, 100)],
270
- layer = new L.U.Polyline(this.map, latlngs, {
270
+ layer = new U.Polyline(this.map, latlngs, {
271
271
  datalayer: this.datalayer,
272
272
  }).addTo(this.datalayer),
273
- other = new L.U.Polyline(this.map, [p2ll(200, 300), p2ll(300, 200)], {
273
+ other = new U.Polyline(this.map, [p2ll(200, 300), p2ll(300, 200)], {
274
274
  datalayer: this.datalayer,
275
275
  }).addTo(this.datalayer)
276
276
  assert.ok(this.map.hasLayer(layer))
@@ -285,10 +285,10 @@ describe('L.U.Polyline', function () {
285
285
  [p2ll(100, 150), p2ll(100, 200), p2ll(200, 100)],
286
286
  [p2ll(200, 300), p2ll(300, 200)],
287
287
  ],
288
- layer = new L.U.Polyline(this.map, latlngs, {
288
+ layer = new U.Polyline(this.map, latlngs, {
289
289
  datalayer: this.datalayer,
290
290
  }).addTo(this.datalayer),
291
- other = new L.U.Polyline(this.map, [p2ll(250, 300), p2ll(350, 200)], {
291
+ other = new U.Polyline(this.map, [p2ll(250, 300), p2ll(350, 200)], {
292
292
  datalayer: this.datalayer,
293
293
  }).addTo(this.datalayer)
294
294
  assert.ok(this.map.hasLayer(layer))
@@ -312,7 +312,7 @@ describe('L.U.Polyline', function () {
312
312
  [0, 2],
313
313
  ],
314
314
  ],
315
- layer = new L.U.Polyline(this.map, latlngs, {
315
+ layer = new U.Polyline(this.map, latlngs, {
316
316
  datalayer: this.datalayer,
317
317
  }).addTo(this.datalayer)
318
318
  layer.mergeShapes()
@@ -336,7 +336,7 @@ describe('L.U.Polyline', function () {
336
336
  [0, 1],
337
337
  ],
338
338
  ],
339
- layer = new L.U.Polyline(this.map, latlngs, {
339
+ layer = new U.Polyline(this.map, latlngs, {
340
340
  datalayer: this.datalayer,
341
341
  }).addTo(this.datalayer)
342
342
  layer.mergeShapes()
@@ -352,7 +352,7 @@ describe('L.U.Polyline', function () {
352
352
  describe('#isolateShape', function () {
353
353
  it('should not allow to isolate simple line', function () {
354
354
  var latlngs = [p2ll(100, 150), p2ll(100, 200), p2ll(200, 100)],
355
- layer = new L.U.Polyline(this.map, latlngs, {
355
+ layer = new U.Polyline(this.map, latlngs, {
356
356
  datalayer: this.datalayer,
357
357
  }).addTo(this.datalayer)
358
358
  assert.equal(this.datalayer._index.length, 1)
@@ -367,7 +367,7 @@ describe('L.U.Polyline', function () {
367
367
  [p2ll(100, 150), p2ll(100, 200), p2ll(200, 100)],
368
368
  [[p2ll(200, 300), p2ll(300, 200)]],
369
369
  ],
370
- layer = new L.U.Polyline(this.map, latlngs, {
370
+ layer = new U.Polyline(this.map, latlngs, {
371
371
  datalayer: this.datalayer,
372
372
  }).addTo(this.datalayer)
373
373
  assert.equal(this.datalayer._index.length, 1)
@@ -386,7 +386,7 @@ describe('L.U.Polyline', function () {
386
386
  describe('#clone', function () {
387
387
  it('should clone polyline', function () {
388
388
  var latlngs = [p2ll(100, 150), p2ll(100, 200), p2ll(200, 100)],
389
- layer = new L.U.Polyline(this.map, latlngs, {
389
+ layer = new U.Polyline(this.map, latlngs, {
390
390
  datalayer: this.datalayer,
391
391
  }).addTo(this.datalayer)
392
392
  assert.equal(this.datalayer._index.length, 1)
@@ -1,50 +1,54 @@
1
- describe('L.TableEditor', function () {
2
- var path = '/map/99/datalayer/edit/62/'
1
+ describe('L.TableEditor', () => {
2
+ let path = '/map/99/datalayer/edit/62/',
3
+ datalayer
3
4
 
4
- before(function () {
5
- this.server = sinon.fakeServer.create()
6
- this.server.respondWith(
5
+ before(async () => {
6
+ await fetchMock.mock(
7
7
  /\/datalayer\/62\/\?.*/,
8
8
  JSON.stringify(RESPONSES.datalayer62_GET)
9
9
  )
10
- this.map = initMap({ umap_id: 99 })
11
- this.datalayer = this.map.getDataLayerByUmapId(62)
12
- this.server.respond()
10
+ this.options = {
11
+ umap_id: 99,
12
+ }
13
+ map = initMap({ umap_id: 99 })
14
+ const datalayer_options = defaultDatalayerData()
15
+ await map.initDataLayers([datalayer_options])
16
+ datalayer = map.getDataLayerByUmapId(62)
13
17
  enableEdit()
14
18
  })
15
- after(function () {
19
+ after(() => {
20
+ fetchMock.restore()
16
21
  clickCancel()
17
- this.server.restore()
18
22
  resetMap()
19
23
  })
20
24
 
21
- describe('#open()', function () {
25
+ describe('#open()', () => {
22
26
  var button
23
27
 
24
- it('should exist table click on edit mode', function () {
28
+ it('should exist table click on edit mode', () => {
25
29
  button = qs(
26
- '#browse_data_toggle_' + L.stamp(this.datalayer) + ' .layer-table-edit'
30
+ '#browse_data_toggle_' + L.stamp(datalayer) + ' .layer-table-edit'
27
31
  )
28
32
  expect(button).to.be.ok
29
33
  })
30
34
 
31
- it('should open table button click', function () {
35
+ it('should open table button click', () => {
32
36
  happen.click(button)
33
37
  expect(qs('#umap-ui-container div.table')).to.be.ok
34
38
  expect(qsa('#umap-ui-container div.table form').length).to.eql(3) // One per feature.
35
39
  expect(qsa('#umap-ui-container div.table input').length).to.eql(3) // One per feature and per property.
36
40
  })
37
41
  })
38
- describe('#properties()', function () {
42
+ describe('#properties()', () => {
39
43
  var feature
40
44
 
41
- before(function () {
42
- var firstIndex = this.datalayer._index[0]
43
- feature = this.datalayer._layers[firstIndex]
45
+ before(() => {
46
+ var firstIndex = datalayer._index[0]
47
+ feature = datalayer._layers[firstIndex]
44
48
  })
45
49
 
46
- it('should create new property column', function () {
47
- var newPrompt = function () {
50
+ it('should create new property column', () => {
51
+ var newPrompt = () => {
48
52
  return 'newprop'
49
53
  }
50
54
  var oldPrompt = window.prompt
@@ -56,7 +60,7 @@ describe('L.TableEditor', function () {
56
60
  window.prompt = oldPrompt
57
61
  })
58
62
 
59
- it('should populate feature property on fill', function () {
63
+ it('should populate feature property on fill', () => {
60
64
  var input = qs(
61
65
  'form#umap-feature-properties_' + L.stamp(feature) + ' input[name=newprop]'
62
66
  )
@@ -64,8 +68,8 @@ describe('L.TableEditor', function () {
64
68
  expect(feature.properties.newprop).to.eql('the value')
65
69
  })
66
70
 
67
- it('should update property name on update click', function () {
68
- var newPrompt = function () {
71
+ it('should update property name on update click', () => {
72
+ var newPrompt = () => {
69
73
  return 'newname'
70
74
  }
71
75
  var oldPrompt = window.prompt
@@ -79,9 +83,9 @@ describe('L.TableEditor', function () {
79
83
  window.prompt = oldPrompt
80
84
  })
81
85
 
82
- it('should update property on delete click', function () {
86
+ it('should update property on delete click', () => {
83
87
  var oldConfirm,
84
- newConfirm = function () {
88
+ newConfirm = () => {
85
89
  return true
86
90
  }
87
91
  oldConfirm = window.confirm
@@ -132,7 +132,7 @@ function initMap(options) {
132
132
  map_update_permissions: '/map/{map_id}/update/permissions/',
133
133
  map_download: '/map/{map_id}/download/',
134
134
  },
135
- default_iconUrl: '../src/img/marker.png',
135
+ default_iconUrl: '../src/img/marker.svg',
136
136
  zoom: 6,
137
137
  share_statuses: [
138
138
  [1, 'Tout le monde (public)'],
@@ -213,14 +213,13 @@ function initMap(options) {
213
213
  },
214
214
  },
215
215
  }
216
- default_options.properties.datalayers.push(defaultDatalayerData())
217
216
  options = options || {}
218
217
  options.properties = L.extend({}, default_options.properties, options)
219
218
  options.geometry = {
220
219
  type: 'Point',
221
220
  coordinates: [5.0592041015625, 52.05924589011585],
222
221
  }
223
- return new L.U.Map('map', options)
222
+ return new U.Map('map', options)
224
223
  }
225
224
 
226
225
  var RESPONSES = {
@@ -386,10 +385,6 @@ var RESPONSES = {
386
385
  },
387
386
  }
388
387
 
389
- sinon.fakeServer.flush = function () {
390
- this.responses = []
391
- }
392
-
393
388
  var kml_example =
394
389
  '<?xml version="1.0" encoding="UTF-8"?>' +
395
390
  '<kml xmlns="http://www.opengis.net/kml/2.2">' +
@@ -35,7 +35,6 @@
35
35
  <script src="../js/umap.core.js" defer></script>
36
36
  <script src="../js/umap.autocomplete.js" defer></script>
37
37
  <script src="../js/umap.popup.js" defer></script>
38
- <script src="../js/umap.xhr.js" defer></script>
39
38
  <script src="../js/umap.forms.js" defer></script>
40
39
  <script src="../js/umap.icon.js" defer></script>
41
40
  <script src="../js/umap.features.js" defer></script>
@@ -45,7 +44,6 @@
45
44
  <script src="../js/umap.controls.js" defer></script>
46
45
  <script src="../js/umap.slideshow.js" defer></script>
47
46
  <script src="../js/umap.tableeditor.js" defer></script>
48
- <script src="../js/umap.browser.js" defer></script>
49
47
  <script src="../js/umap.importer.js" defer></script>
50
48
  <script src="../js/umap.share.js" defer></script>
51
49
  <script src="../js/umap.js" defer></script>
@@ -76,6 +74,10 @@
76
74
  <script src="../../../../node_modules/chai/chai.js"></script>
77
75
  <script src="../../../../node_modules/happen/happen.js"></script>
78
76
  <link rel="stylesheet" href="../../../../node_modules/mocha/mocha.css" />
77
+ <script type="module">
78
+ import fetchMock from '../../../../node_modules/fetch-mock/esm/client.js';
79
+ window.fetchMock = fetchMock
80
+ </script>
79
81
  <script type="text/javascript">
80
82
  mocha.setup({
81
83
  ui: 'bdd',
@@ -86,7 +88,6 @@
86
88
  </script>
87
89
  <script src="./_pre.js" defer></script>
88
90
  <script src="./Map.js" defer></script>
89
- <script src="./Map.Init.js" defer></script>
90
91
  <script src="./Map.Export.js" defer></script>
91
92
  <script src="./DataLayer.js" defer></script>
92
93
  <script src="./TableEditor.js" defer></script>
@@ -95,7 +96,6 @@
95
96
  <script src="./Polyline.js" defer></script>
96
97
  <script src="./Polygon.js" defer></script>
97
98
  <script src="./Util.js" defer></script>
98
- <script src="./Controls.js" defer></script>
99
99
  <script src="./Permissions.js" defer></script>
100
100
  <script src="./Choropleth.js" defer></script>
101
101
  <script type="module" src="./URLs.js" defer></script>
@@ -0,0 +1,54 @@
1
+ .leaflet-contextmenu {
2
+ display: none;
3
+ box-shadow: 0 1px 7px rgba(0,0,0,0.4);
4
+ -webkit-border-radius: 4px;
5
+ border-radius: 4px;
6
+ padding: 4px 0;
7
+ background-color: #fff;
8
+ cursor: default;
9
+ -webkit-user-select: none;
10
+ -moz-user-select: none;
11
+ user-select: none;
12
+ }
13
+
14
+ .leaflet-contextmenu a.leaflet-contextmenu-item {
15
+ display: block;
16
+ color: #222;
17
+ font-size: 12px;
18
+ line-height: 20px;
19
+ text-decoration: none;
20
+ padding: 0 12px;
21
+ border-top: 1px solid transparent;
22
+ border-bottom: 1px solid transparent;
23
+ cursor: default;
24
+ outline: none;
25
+ }
26
+
27
+ .leaflet-contextmenu a.leaflet-contextmenu-item-disabled {
28
+ opacity: 0.5;
29
+ }
30
+
31
+ .leaflet-contextmenu a.leaflet-contextmenu-item.over {
32
+ background-color: #f4f4f4;
33
+ border-top: 1px solid #f0f0f0;
34
+ border-bottom: 1px solid #f0f0f0;
35
+ }
36
+
37
+ .leaflet-contextmenu a.leaflet-contextmenu-item-disabled.over {
38
+ background-color: inherit;
39
+ border-top: 1px solid transparent;
40
+ border-bottom: 1px solid transparent;
41
+ }
42
+
43
+ .leaflet-contextmenu-icon {
44
+ margin: 2px 8px 0 0;
45
+ width: 16px;
46
+ height: 16px;
47
+ float: left;
48
+ border: 0;
49
+ }
50
+
51
+ .leaflet-contextmenu-separator {
52
+ border-bottom: 1px solid #ccc;
53
+ margin: 5px 0;
54
+ }