umap-project 2.9.3__py3-none-any.whl → 3.0.1__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 (217) hide show
  1. umap/__init__.py +1 -1
  2. umap/context_processors.py +1 -0
  3. umap/forms.py +1 -2
  4. umap/locale/de/LC_MESSAGES/django.mo +0 -0
  5. umap/locale/de/LC_MESSAGES/django.po +218 -96
  6. umap/locale/en/LC_MESSAGES/django.po +128 -52
  7. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  8. umap/locale/fr/LC_MESSAGES/django.po +128 -52
  9. umap/locale/hu/LC_MESSAGES/django.mo +0 -0
  10. umap/locale/hu/LC_MESSAGES/django.po +209 -88
  11. umap/locale/is/LC_MESSAGES/django.mo +0 -0
  12. umap/locale/is/LC_MESSAGES/django.po +296 -175
  13. umap/migrations/0027_map_tags.py +23 -0
  14. umap/models.py +13 -2
  15. umap/settings/base.py +23 -5
  16. umap/static/umap/base.css +41 -8
  17. umap/static/umap/content.css +72 -37
  18. umap/static/umap/css/bar.css +43 -21
  19. umap/static/umap/css/dialog.css +4 -1
  20. umap/static/umap/css/form.css +40 -27
  21. umap/static/umap/css/icon.css +11 -1
  22. umap/static/umap/css/importers.css +7 -0
  23. umap/static/umap/img/16-white.svg +23 -2
  24. umap/static/umap/img/16.svg +1 -1
  25. umap/static/umap/img/24.svg +4 -4
  26. umap/static/umap/img/home.svg +7 -0
  27. umap/static/umap/img/importers/banfr.svg +1 -0
  28. umap/static/umap/img/marker.svg +2 -5
  29. umap/static/umap/img/source/16-white.svg +24 -3
  30. umap/static/umap/img/source/16.svg +1 -1
  31. umap/static/umap/img/source/24.svg +5 -5
  32. umap/static/umap/img/target.svg +1 -0
  33. umap/static/umap/js/components/alerts/alert.js +0 -1
  34. umap/static/umap/js/modules/browser.js +4 -4
  35. umap/static/umap/js/modules/caption.js +1 -1
  36. umap/static/umap/js/modules/data/features.js +25 -25
  37. umap/static/umap/js/modules/data/layer.js +91 -97
  38. umap/static/umap/js/modules/facets.js +9 -5
  39. umap/static/umap/js/modules/form/builder.js +19 -27
  40. umap/static/umap/js/modules/form/fields.js +40 -14
  41. umap/static/umap/js/modules/formatter.js +1 -1
  42. umap/static/umap/js/modules/global.js +9 -5
  43. umap/static/umap/js/modules/help.js +18 -5
  44. umap/static/umap/js/modules/importer.js +5 -2
  45. umap/static/umap/js/modules/importers/banfr.js +93 -0
  46. umap/static/umap/js/modules/importers/cadastrefr.js +2 -2
  47. umap/static/umap/js/modules/importers/communesfr.js +1 -1
  48. umap/static/umap/js/modules/permissions.js +20 -10
  49. umap/static/umap/js/modules/rendering/icon.js +15 -2
  50. umap/static/umap/js/modules/rendering/layers/classified.js +7 -7
  51. umap/static/umap/js/modules/rendering/layers/cluster.js +2 -2
  52. umap/static/umap/js/modules/rendering/layers/heat.js +4 -4
  53. umap/static/umap/js/modules/rendering/map.js +14 -6
  54. umap/static/umap/js/modules/rendering/popup.js +2 -2
  55. umap/static/umap/js/modules/rendering/template.js +3 -3
  56. umap/static/umap/js/modules/rendering/ui.js +17 -11
  57. umap/static/umap/js/modules/rules.js +13 -16
  58. umap/static/umap/js/modules/schema.js +23 -1
  59. umap/static/umap/js/modules/share.js +1 -1
  60. umap/static/umap/js/modules/slideshow.js +1 -0
  61. umap/static/umap/js/modules/sync/engine.js +141 -19
  62. umap/static/umap/js/modules/sync/undo.js +101 -0
  63. umap/static/umap/js/modules/sync/updaters.js +51 -28
  64. umap/static/umap/js/modules/tableeditor.js +1 -1
  65. umap/static/umap/js/modules/ui/bar.js +61 -21
  66. umap/static/umap/js/modules/ui/tooltip.js +1 -1
  67. umap/static/umap/js/modules/umap.js +190 -176
  68. umap/static/umap/js/modules/utils.js +30 -4
  69. umap/static/umap/js/umap.controls.js +82 -38
  70. umap/static/umap/locale/am_ET.js +11 -6
  71. umap/static/umap/locale/am_ET.json +11 -6
  72. umap/static/umap/locale/ar.js +11 -6
  73. umap/static/umap/locale/ar.json +11 -6
  74. umap/static/umap/locale/ast.js +11 -6
  75. umap/static/umap/locale/ast.json +11 -6
  76. umap/static/umap/locale/bg.js +11 -6
  77. umap/static/umap/locale/bg.json +11 -6
  78. umap/static/umap/locale/br.js +12 -7
  79. umap/static/umap/locale/br.json +12 -7
  80. umap/static/umap/locale/ca.js +11 -6
  81. umap/static/umap/locale/ca.json +11 -6
  82. umap/static/umap/locale/cs_CZ.js +11 -6
  83. umap/static/umap/locale/cs_CZ.json +11 -6
  84. umap/static/umap/locale/da.js +11 -6
  85. umap/static/umap/locale/da.json +11 -6
  86. umap/static/umap/locale/de.js +47 -42
  87. umap/static/umap/locale/de.json +47 -42
  88. umap/static/umap/locale/el.js +11 -6
  89. umap/static/umap/locale/el.json +11 -6
  90. umap/static/umap/locale/en.js +11 -6
  91. umap/static/umap/locale/en.json +11 -6
  92. umap/static/umap/locale/en_US.json +11 -6
  93. umap/static/umap/locale/es.js +11 -6
  94. umap/static/umap/locale/es.json +11 -6
  95. umap/static/umap/locale/et.js +11 -6
  96. umap/static/umap/locale/et.json +11 -6
  97. umap/static/umap/locale/eu.js +11 -6
  98. umap/static/umap/locale/eu.json +11 -6
  99. umap/static/umap/locale/fa_IR.js +11 -6
  100. umap/static/umap/locale/fa_IR.json +11 -6
  101. umap/static/umap/locale/fi.js +11 -6
  102. umap/static/umap/locale/fi.json +11 -6
  103. umap/static/umap/locale/fr.js +11 -6
  104. umap/static/umap/locale/fr.json +11 -6
  105. umap/static/umap/locale/gl.js +12 -7
  106. umap/static/umap/locale/gl.json +12 -7
  107. umap/static/umap/locale/he.js +11 -6
  108. umap/static/umap/locale/he.json +11 -6
  109. umap/static/umap/locale/hr.js +11 -6
  110. umap/static/umap/locale/hr.json +11 -6
  111. umap/static/umap/locale/hu.js +25 -20
  112. umap/static/umap/locale/hu.json +25 -20
  113. umap/static/umap/locale/id.js +11 -6
  114. umap/static/umap/locale/id.json +11 -6
  115. umap/static/umap/locale/is.js +151 -146
  116. umap/static/umap/locale/is.json +151 -146
  117. umap/static/umap/locale/it.js +11 -6
  118. umap/static/umap/locale/it.json +11 -6
  119. umap/static/umap/locale/ja.js +11 -6
  120. umap/static/umap/locale/ja.json +11 -6
  121. umap/static/umap/locale/ko.js +11 -6
  122. umap/static/umap/locale/ko.json +11 -6
  123. umap/static/umap/locale/lt.js +11 -6
  124. umap/static/umap/locale/lt.json +11 -6
  125. umap/static/umap/locale/ms.js +11 -6
  126. umap/static/umap/locale/ms.json +11 -6
  127. umap/static/umap/locale/nl.js +12 -7
  128. umap/static/umap/locale/nl.json +12 -7
  129. umap/static/umap/locale/no.js +11 -6
  130. umap/static/umap/locale/no.json +11 -6
  131. umap/static/umap/locale/pl.js +11 -6
  132. umap/static/umap/locale/pl.json +11 -6
  133. umap/static/umap/locale/pl_PL.json +11 -6
  134. umap/static/umap/locale/pt.js +11 -6
  135. umap/static/umap/locale/pt.json +11 -6
  136. umap/static/umap/locale/pt_BR.js +11 -6
  137. umap/static/umap/locale/pt_BR.json +11 -6
  138. umap/static/umap/locale/pt_PT.js +11 -6
  139. umap/static/umap/locale/pt_PT.json +11 -6
  140. umap/static/umap/locale/ro.js +11 -6
  141. umap/static/umap/locale/ro.json +11 -6
  142. umap/static/umap/locale/ru.js +11 -6
  143. umap/static/umap/locale/ru.json +11 -6
  144. umap/static/umap/locale/sk_SK.js +11 -6
  145. umap/static/umap/locale/sk_SK.json +11 -6
  146. umap/static/umap/locale/sl.js +11 -6
  147. umap/static/umap/locale/sl.json +11 -6
  148. umap/static/umap/locale/sr.js +11 -6
  149. umap/static/umap/locale/sr.json +11 -6
  150. umap/static/umap/locale/sv.js +11 -6
  151. umap/static/umap/locale/sv.json +11 -6
  152. umap/static/umap/locale/th_TH.js +11 -6
  153. umap/static/umap/locale/th_TH.json +11 -6
  154. umap/static/umap/locale/tr.js +11 -6
  155. umap/static/umap/locale/tr.json +11 -6
  156. umap/static/umap/locale/uk_UA.js +11 -6
  157. umap/static/umap/locale/uk_UA.json +11 -6
  158. umap/static/umap/locale/vi.js +11 -6
  159. umap/static/umap/locale/vi.json +11 -6
  160. umap/static/umap/locale/vi_VN.json +11 -6
  161. umap/static/umap/locale/zh.js +11 -6
  162. umap/static/umap/locale/zh.json +11 -6
  163. umap/static/umap/locale/zh_CN.json +11 -6
  164. umap/static/umap/locale/zh_TW.Big5.json +11 -6
  165. umap/static/umap/locale/zh_TW.js +19 -14
  166. umap/static/umap/locale/zh_TW.json +19 -14
  167. umap/static/umap/map.css +58 -28
  168. umap/static/umap/unittests/sync.js +0 -57
  169. umap/static/umap/unittests/utils.js +47 -0
  170. umap/static/umap/vars.css +5 -2
  171. umap/static/umap/vendors/photon/leaflet.photon.js +3 -0
  172. umap/sync/payloads.py +3 -2
  173. umap/templates/auth/user_detail.html +1 -1
  174. umap/templates/auth/user_stars.html +1 -1
  175. umap/templates/umap/content.html +17 -12
  176. umap/templates/umap/home.html +7 -5
  177. umap/templates/umap/map_fragment.html +1 -1
  178. umap/templates/umap/map_list.html +20 -13
  179. umap/templates/umap/search.html +7 -3
  180. umap/templates/umap/search_bar.html +13 -11
  181. umap/templates/umap/team_detail.html +1 -1
  182. umap/tests/base.py +2 -1
  183. umap/tests/fixtures/remote_data.umap +55 -0
  184. umap/tests/fixtures/test_upload_data_with_iconurl.umap +122 -0
  185. umap/tests/integration/test_browser.py +1 -3
  186. umap/tests/integration/test_conditional_rules.py +3 -0
  187. umap/tests/integration/test_edit_datalayer.py +2 -7
  188. umap/tests/integration/test_edit_map.py +15 -0
  189. umap/tests/integration/test_edit_polygon.py +1 -2
  190. umap/tests/integration/test_import.py +59 -2
  191. umap/tests/integration/test_optimistic_merge.py +4 -3
  192. umap/tests/integration/test_owned_map.py +0 -1
  193. umap/tests/integration/test_save.py +2 -4
  194. umap/tests/integration/test_undo_redo.py +267 -0
  195. umap/tests/integration/test_websocket_sync.py +78 -11
  196. umap/tests/settings.py +1 -3
  197. umap/tests/test_datalayer_s3.py +1 -0
  198. umap/tests/test_map_views.py +1 -0
  199. umap/tests/test_views.py +34 -0
  200. umap/utils.py +1 -1
  201. umap/views.py +23 -2
  202. {umap_project-2.9.3.dist-info → umap_project-3.0.1.dist-info}/METADATA +13 -12
  203. {umap_project-2.9.3.dist-info → umap_project-3.0.1.dist-info}/RECORD +206 -208
  204. umap/static/umap/js/modules/saving.js +0 -52
  205. umap/static/umap/test/.eslintrc +0 -21
  206. umap/static/umap/test/DataLayer.js +0 -463
  207. umap/static/umap/test/Feature.js +0 -131
  208. umap/static/umap/test/Map.js +0 -37
  209. umap/static/umap/test/Marker.js +0 -126
  210. umap/static/umap/test/Polygon.js +0 -111
  211. umap/static/umap/test/Polyline.js +0 -286
  212. umap/static/umap/test/Util.js +0 -28
  213. umap/static/umap/test/_pre.js +0 -455
  214. umap/static/umap/test/index.html +0 -139
  215. {umap_project-2.9.3.dist-info → umap_project-3.0.1.dist-info}/WHEEL +0 -0
  216. {umap_project-2.9.3.dist-info → umap_project-3.0.1.dist-info}/entry_points.txt +0 -0
  217. {umap_project-2.9.3.dist-info → umap_project-3.0.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,455 +0,0 @@
1
- window.assert = chai.assert
2
- window.expect = chai.expect
3
-
4
- var qs = function (selector, element) {
5
- return (element || document).querySelector(selector)
6
- }
7
- var qsa = function (selector) {
8
- return document.querySelectorAll(selector)
9
- }
10
- var qst = function (text, parent) {
11
- // find element by its text content
12
- var r = document.evaluate(
13
- "descendant::*[contains(text(),'" + text + "')]",
14
- parent || qs('#map'),
15
- null,
16
- XPathResult.UNORDERED_NODE_ITERATOR_TYPE,
17
- null
18
- ),
19
- count = 0
20
- while (r.iterateNext()) console.log(++count)
21
- return count
22
- }
23
- happen.at = function (what, x, y, props) {
24
- this.once(
25
- document.elementFromPoint(x, y),
26
- L.Util.extend(
27
- {
28
- type: what,
29
- clientX: x,
30
- clientY: y,
31
- screenX: x,
32
- screenY: y,
33
- which: 1,
34
- button: 0,
35
- },
36
- props || {}
37
- )
38
- )
39
- }
40
- var resetMap = function () {
41
- var mapElement = qs('#map')
42
- mapElement.innerHTML = 'Done'
43
- delete mapElement._leaflet_id
44
- document.body.className = ''
45
- }
46
- var enableEdit = function () {
47
- happen.click(qs('div.leaflet-control-edit-enable button'))
48
- }
49
- var disableEdit = function () {
50
- happen.click(qs('.leaflet-control-edit-disable'))
51
- }
52
- var clickSave = function () {
53
- happen.click(qs('.leaflet-control-edit-save'))
54
- }
55
- var clickCancel = function () {
56
- var _confirm = window.confirm
57
- window.confirm = function (text) {
58
- return true
59
- }
60
- happen.click(qs('button.leaflet-control-edit-cancel'))
61
- happen.once(document.body, { type: 'keypress', keyCode: 13 })
62
- window.confirm = _confirm
63
- }
64
- var changeInputValue = function (input, value) {
65
- input.value = value
66
- happen.once(input, { type: 'input' })
67
- happen.once(input, { type: 'blur' })
68
- }
69
- var changeSelectValue = function (path_or_select, value) {
70
- if (typeof path_or_select === 'string') path_or_select = qs(path_or_select)
71
- var found = false
72
- for (var i = 0; i < path_or_select.length; i++) {
73
- if (path_or_select.options[i].value === value) {
74
- path_or_select.options[i].selected = true
75
- found = true
76
- }
77
- }
78
- happen.once(path_or_select, { type: 'change' })
79
- if (!found)
80
- throw new Error('Value ' + value + 'not found in select ' + path_or_select)
81
- return path_or_select
82
- }
83
- var cleanAlert = function () {
84
- L.DomUtil.removeClass(qs('#map'), 'umap-alert')
85
- L.DomUtil.get('umap-alert-container').innerHTML = ''
86
- UI_ALERT_ID = null // Prevent setTimeout to be called
87
- }
88
- var defaultDatalayerData = function (custom) {
89
- var _default = {
90
- iconClass: 'Default',
91
- name: 'Elephants',
92
- displayOnLoad: true,
93
- id: 62,
94
- pictogram_url: null,
95
- weight: null,
96
- fillColor: '',
97
- color: '',
98
- stroke: true,
99
- smoothFactor: null,
100
- dashArray: '',
101
- fill: true,
102
- }
103
- return L.extend({}, _default, custom)
104
- }
105
-
106
- function initMap(options) {
107
- default_options = {
108
- type: 'Feature',
109
- properties: {
110
- umap_id: 42,
111
- datalayers: [],
112
- urls: {
113
- map: '/map/{slug}_{pk}',
114
- datalayer_view: '/datalayer/{pk}/',
115
- map_update: '/map/{map_id}/update/settings/',
116
- map_old_url: '/map/{username}/{slug}/',
117
- map_clone: '/map/{map_id}/update/clone/',
118
- map_short_url: '/m/{pk}/',
119
- map_anonymous_edit_url: '/map/anonymous-edit/{signature}',
120
- map_new: '/map/new/',
121
- datalayer_update: '/map/{map_id}/datalayer/update/{pk}/',
122
- map_delete: '/map/{map_id}/update/delete/',
123
- map_create: '/map/create/',
124
- logout: '/logout/',
125
- datalayer_create: '/map/{map_id}/datalayer/create/',
126
- login_popup_end: '/login/popupd/',
127
- login: '/login/',
128
- datalayer_delete: '/map/{map_id}/datalayer/delete/{pk}/',
129
- datalayer_versions: '/map/{map_id}/datalayer/{pk}/versions/',
130
- datalayer_version: '/datalayer/{pk}/{name}',
131
- pictogram_list_json: '/pictogram/json/',
132
- map_update_permissions: '/map/{map_id}/update/permissions/',
133
- map_download: '/map/{map_id}/download/',
134
- },
135
- default_iconUrl: '../src/img/marker.svg',
136
- zoom: 6,
137
- share_statuses: [
138
- [1, 'Tout le monde (public)'],
139
- [2, 'Quiconque a le lien'],
140
- [3, 'Éditeurs uniquement'],
141
- ],
142
- tilelayers: [
143
- {
144
- attribution: '\u00a9 OSM Contributors',
145
- name: 'OpenStreetMap',
146
- url_template: 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
147
- minZoom: 0,
148
- maxZoom: 18,
149
- id: 1,
150
- selected: true,
151
- },
152
- {
153
- attribution: 'HOT and friends',
154
- name: 'HOT OSM-fr server',
155
- url_template: 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
156
- rank: 99,
157
- minZoom: 0,
158
- maxZoom: 20,
159
- id: 2,
160
- },
161
- ],
162
- tilelayer: {
163
- attribution: 'HOT and friends',
164
- name: 'HOT OSM-fr server',
165
- url_template: 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
166
- rank: 99,
167
- minZoom: 0,
168
- maxZoom: 20,
169
- id: 2,
170
- },
171
- licences: {
172
- 'No licence set': {
173
- url: '',
174
- name: 'No licence set',
175
- },
176
- 'Licence ouverte/Open Licence': {
177
- url: 'http://www.data.gouv.fr/Licence-Ouverte-Open-Licence',
178
- name: 'Licence ouverte/Open Licence',
179
- },
180
- 'WTFPL': {
181
- url: 'http://www.wtfpl.net/',
182
- name: 'WTFPL',
183
- },
184
- 'ODbl': {
185
- url: 'http://opendatacommons.org/licenses/odbl/',
186
- name: 'ODbl',
187
- },
188
- },
189
- name: 'name of the map',
190
- description: 'The description of the map',
191
- locale: 'en',
192
- editMode: 'advanced',
193
- moreControl: true,
194
- scaleControl: true,
195
- miniMap: false,
196
- datalayersControl: true,
197
- displayCaptionOnLoad: false,
198
- displayPopupFooter: false,
199
- displayDataBrowserOnLoad: false,
200
- permissions: {
201
- share_status: 1,
202
- owner: {
203
- id: 1,
204
- name: 'ybon',
205
- url: '/en/user/ybon/',
206
- },
207
- editors: [],
208
- },
209
- user: {
210
- id: 1,
211
- name: 'foofoo',
212
- url: '/en/me',
213
- },
214
- },
215
- }
216
- options = options || {}
217
- options.properties = L.extend({}, default_options.properties, options)
218
- options.geometry = {
219
- type: 'Point',
220
- coordinates: [5.0592041015625, 52.05924589011585],
221
- }
222
- return new U.Map('map', options)
223
- }
224
-
225
- var RESPONSES = {
226
- datalayer62_GET: {
227
- crs: null,
228
- type: 'FeatureCollection',
229
- _umap_options: defaultDatalayerData(),
230
- features: [
231
- {
232
- geometry: {
233
- type: 'Point',
234
- coordinates: [-0.274658203125, 52.57634993749885],
235
- },
236
- type: 'Feature',
237
- id: 1807,
238
- properties: { _umap_options: { color: 'OliveDrab' }, name: 'test' },
239
- },
240
- {
241
- geometry: {
242
- type: 'LineString',
243
- coordinates: [
244
- [-0.5712890625, 54.47642158429295],
245
- [0.439453125, 54.610254981579146],
246
- [1.724853515625, 53.44880683542759],
247
- [4.163818359375, 53.98839506479995],
248
- [5.306396484375, 53.533778184257805],
249
- [6.591796875, 53.70971358510174],
250
- [7.042236328124999, 53.35055131839989],
251
- ],
252
- },
253
- type: 'Feature',
254
- id: 20,
255
- properties: { _umap_options: { fill: false, opacity: 0.6 }, name: 'test' },
256
- },
257
- {
258
- geometry: {
259
- type: 'Polygon',
260
- coordinates: [
261
- [
262
- [11.25, 53.585983654559804],
263
- [10.1513671875, 52.9751081817353],
264
- [12.689208984375, 52.16719363541221],
265
- [14.084472656249998, 53.199451902831555],
266
- [12.63427734375, 53.61857936489517],
267
- [11.25, 53.585983654559804],
268
- [11.25, 53.585983654559804],
269
- ],
270
- ],
271
- },
272
- type: 'Feature',
273
- id: 76,
274
- properties: { name: 'name poly' },
275
- },
276
- ],
277
- },
278
- // This one is non browsable
279
- datalayer63_GET: {
280
- crs: null,
281
- type: 'FeatureCollection',
282
- _umap_options: defaultDatalayerData({ id: 63, browsable: false }),
283
- features: [
284
- {
285
- geometry: {
286
- type: 'Polygon',
287
- coordinates: [
288
- [
289
- [5.545478, 45.068383],
290
- [5.545907, 45.067277],
291
- [5.548439, 45.067565],
292
- [5.552516, 45.06752],
293
- [5.553288, 45.068217],
294
- [5.549405, 45.069247],
295
- [5.548224, 45.071005],
296
- [5.545907, 45.071096],
297
- [5.545478, 45.068383],
298
- ],
299
- ],
300
- },
301
- type: 'Feature',
302
- id: 76,
303
- properties: { name: 'non browsable 1' },
304
- },
305
- {
306
- type: 'Feature',
307
- properties: {
308
- _umap_options: {
309
- color: 'SteelBlue',
310
- },
311
- name: 'non browsable 2',
312
- },
313
- geometry: {
314
- type: 'Polygon',
315
- coordinates: [
316
- [
317
- [5.550542, 45.071717],
318
- [5.548182, 45.071051],
319
- [5.549426, 45.069232],
320
- [5.553331, 45.068171],
321
- [5.554812, 45.070869],
322
- [5.553396, 45.072384],
323
- [5.550542, 45.071717],
324
- ],
325
- ],
326
- },
327
- },
328
- ],
329
- },
330
- // This one is not shown at load
331
- datalayer64_GET: {
332
- crs: null,
333
- type: 'FeatureCollection',
334
- _umap_options: defaultDatalayerData({
335
- name: 'hidden',
336
- id: 64,
337
- displayOnLoad: false,
338
- }),
339
- features: [
340
- {
341
- geometry: {
342
- type: 'Polygon',
343
- coordinates: [
344
- [
345
- [5.545478, 45.068383],
346
- [5.545907, 45.067277],
347
- [5.548439, 45.067565],
348
- [5.552516, 45.06752],
349
- [5.553288, 45.068217],
350
- [5.549405, 45.069247],
351
- [5.548224, 45.071005],
352
- [5.545907, 45.071096],
353
- [5.545478, 45.068383],
354
- ],
355
- ],
356
- },
357
- type: 'Feature',
358
- id: 76,
359
- properties: { name: 'not shown at load 1' },
360
- },
361
- {
362
- type: 'Feature',
363
- properties: {
364
- _umap_options: {
365
- color: 'AliceBlue',
366
- },
367
- name: 'not shown at load 2',
368
- },
369
- geometry: {
370
- type: 'Polygon',
371
- coordinates: [
372
- [
373
- [5.550542, 45.071717],
374
- [5.548182, 45.071051],
375
- [5.549426, 45.069232],
376
- [5.553331, 45.068171],
377
- [5.554812, 45.070869],
378
- [5.553396, 45.072384],
379
- [5.550542, 45.071717],
380
- ],
381
- ],
382
- },
383
- },
384
- ],
385
- },
386
- }
387
-
388
- var kml_example =
389
- '<?xml version="1.0" encoding="UTF-8"?>' +
390
- '<kml xmlns="http://www.opengis.net/kml/2.2">' +
391
- '<Placemark>' +
392
- '<name>Simple point</name>' +
393
- '<description>Here is a simple description.</description>' +
394
- '<Point>' +
395
- '<coordinates>-122.0822035425683,37.42228990140251,0</coordinates>' +
396
- '</Point>' +
397
- '</Placemark>' +
398
- '<Placemark>' +
399
- '<name>Simple path</name>' +
400
- '<description>Simple description</description>' +
401
- '<LineString>' +
402
- '<coordinates>-112.2550785337791,36.07954952145647,2357 -112.2549277039738,36.08117083492122,2357 -112.2552505069063,36.08260761307279,2357</coordinates>' +
403
- '</LineString>' +
404
- '</Placemark>' +
405
- '<Placemark>' +
406
- '<name>Simple polygon</name>' +
407
- '<description>A description.</description>' +
408
- '<Polygon>' +
409
- '<outerBoundaryIs>' +
410
- '<LinearRing>' +
411
- '<coordinates>' +
412
- ' -77.05788457660967,38.87253259892824,100 ' +
413
- ' -77.05465973756702,38.87291016281703,100 ' +
414
- ' -77.05315536854791,38.87053267794386,100 ' +
415
- ' -77.05788457660967,38.87253259892824,100 ' +
416
- '</coordinates>' +
417
- '</LinearRing>' +
418
- '</outerBoundaryIs>' +
419
- '</Polygon>' +
420
- '</Placemark>' +
421
- '</kml>'
422
-
423
- var gpx_example =
424
- '<gpx' +
425
- ' version="1.1"' +
426
- ' creator="GPSBabel - http://www.gpsbabel.org"' +
427
- ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
428
- ' xmlns="http://www.topografix.com/GPX/1/1"' +
429
- ' xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">' +
430
- ' <wpt lat="45.44283" lon="-121.72904"><ele>1374</ele><name>Simple Point</name><desc>Simple description</desc></wpt>' +
431
- ' <trk>' +
432
- ' <name>Simple path</name>' +
433
- ' <desc>Simple description</desc>' +
434
- ' <trkseg>' +
435
- ' <trkpt lat="45.4431641" lon="-121.7295456"></trkpt>' +
436
- ' <trkpt lat="45.4428615" lon="-121.7290800"></trkpt>' +
437
- ' <trkpt lat="45.4425697" lon="-121.7279085"></trkpt>' +
438
- ' </trkseg>' +
439
- ' </trk>' +
440
- '</gpx>'
441
-
442
- var csv_example =
443
- 'Foo,Latitude,Longitude,title,description\n' +
444
- 'bar,41.34,122.86,a point somewhere,the description of this point'
445
-
446
- // Make Sinon log readable
447
- sinon.format = function (what) {
448
- if (typeof what === 'object') {
449
- return JSON.stringify(what, null, 4)
450
- } else if (typeof what === 'undefined') {
451
- return ''
452
- } else {
453
- return what.toString()
454
- }
455
- }
@@ -1,139 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Umap front Tests</title>
5
- <meta charset="utf-8" />
6
- <script type="module" src="../js/modules/leaflet-configure.js" defer></script>
7
- <script type="module" src="../js/modules/global.js" defer></script>
8
-
9
- <script src="../vendors/editable/Path.Drag.js" defer></script>
10
- <script src="../vendors/editable/Leaflet.Editable.js" defer></script>
11
- <script src="../vendors/hash/leaflet-hash.js" defer></script>
12
- <script src="../vendors/editinosm/Leaflet.EditInOSM.js" defer></script>
13
- <script src="../vendors/minimap/Control.MiniMap.min.js" defer></script>
14
- <script src="../vendors/csv2geojson/csv2geojson.js" defer></script>
15
- <script src="../vendors/togeojson/togeojson.umd.js" defer></script>
16
- <script src="../vendors/osmtogeojson/osmtogeojson.js" defer></script>
17
- <script src="../vendors/loading/Control.Loading.js" defer></script>
18
- <script src="../vendors/markercluster/leaflet.markercluster.js" defer></script>
19
- <script src="../vendors/contextmenu/leaflet.contextmenu.min.js" defer></script>
20
- <script src="../vendors/photon/leaflet.photon.js" defer></script>
21
- <script src="../vendors/georsstogeojson/GeoRSSToGeoJSON.js" defer></script>
22
- <script src="../vendors/heat/leaflet-heat.js" defer></script>
23
- <script src="../vendors/fullscreen/Leaflet.fullscreen.min.js" defer></script>
24
- <script src="../vendors/toolbar/leaflet.toolbar.js" defer></script>
25
- <script src="../vendors/formbuilder/Leaflet.FormBuilder.js" defer></script>
26
- <script src="../vendors/measurable/Leaflet.Measurable.js" defer></script>
27
- <script src="../vendors/togpx/togpx.js" defer></script>
28
- <script src="../vendors/iconlayers/iconLayers.js" defer></script>
29
- <script src="../vendors/tokml/tokml.js" defer></script>
30
- <script src="../vendors/locatecontrol/L.Control.Locate.min.js" defer></script>
31
- <script src="../vendors/colorbrewer/colorbrewer.js" defer></script>
32
- <script src="../vendors/simple-statistics/simple-statistics.min.js" defer></script>
33
-
34
- <script src="../js/umap.core.js" defer></script>
35
- <script src="../js/umap.autocomplete.js" defer></script>
36
- <script src="../js/umap.popup.js" defer></script>
37
- <script src="../js/umap.forms.js" defer></script>
38
- <script src="../js/umap.icon.js" defer></script>
39
- <script src="../js/umap.features.js" defer></script>
40
- <script src="../js/umap.permissions.js" defer></script>
41
- <script src="../js/umap.datalayer.permissions.js" defer></script>
42
- <script src="../js/umap.layer.js" defer></script>
43
- <script src="../js/umap.controls.js" defer></script>
44
- <script src="../js/umap.slideshow.js" defer></script>
45
- <script src="../js/umap.tableeditor.js" defer></script>
46
- <script src="../js/umap.importer.js" defer></script>
47
- <script src="../js/umap.share.js" defer></script>
48
- <script src="../js/umap.js" defer></script>
49
- <script src="../js/umap.ui.js" defer></script>
50
- <script src="../js/components/fragment.js" defer></script>
51
-
52
- <link rel="stylesheet" href="../vendors/leaflet/leaflet.css" />
53
- <link rel="stylesheet" href="../vendors/markercluster/MarkerCluster.css" />
54
- <link rel="stylesheet" href="../vendors/markercluster/MarkerCluster.Default.css" />
55
- <link rel="stylesheet" href="../vendors/editinosm/Leaflet.EditInOSM.css" />
56
- <link rel="stylesheet" href="../vendors/minimap/Control.MiniMap.min.css" />
57
- <link rel="stylesheet" href="../vendors/contextmenu/leaflet.contextmenu.min.css" />
58
- <link rel="stylesheet" href="../vendors/toolbar/leaflet.toolbar.css" />
59
- <link rel="stylesheet" href="../vendors/measurable/Leaflet.Measurable.css" />
60
- <link rel="stylesheet" href="../vendors/fullscreen/leaflet.fullscreen.css" />
61
- <link rel="stylesheet" href="../vendors/locatecontrol/L.Control.Locate.min.css" />
62
- <link rel="stylesheet" href="../vendors/iconlayers/iconLayers.css" />
63
-
64
- <link rel="stylesheet" href="../../umap/vars.css" />
65
- <link rel="stylesheet" href="../../umap/font.css" />
66
- <link rel="stylesheet" href="../../umap/base.css" />
67
- <link rel="stylesheet" href="../../umap/content.css" />
68
- <link rel="stylesheet" href="../../umap/nav.css" />
69
- <link rel="stylesheet" href="../../umap/map.css" />
70
- <link rel="stylesheet" href="../../umap/theme.css" />
71
-
72
- <script src="../../../../node_modules/sinon/pkg/sinon.js"></script>
73
- <script src="../../../../node_modules/mocha/mocha.js"></script>
74
- <script src="../../../../node_modules/chai/chai.js"></script>
75
- <script src="../../../../node_modules/happen/happen.js"></script>
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>
81
- <script type="text/javascript">
82
- mocha.setup({
83
- ui: 'bdd',
84
- bail: window.location.search.indexOf('failfast') !== -1,
85
- ignoreLeaks: true,
86
- })
87
- chai.config.includeStack = true
88
- </script>
89
- <script src="./_pre.js" defer></script>
90
- <script src="./Map.js" defer></script>
91
- <script src="./Feature.js" defer></script>
92
- <script src="./Marker.js" defer></script>
93
- <script src="./Polyline.js" defer></script>
94
- <script src="./Polygon.js" defer></script>
95
- <script src="./Util.js" defer></script>
96
- <script type="module" src="./URLs.js" defer></script>
97
- <style type="text/css">
98
- #mocha {
99
- position: absolute;
100
- top: 0;
101
- bottom: 0;
102
- left: 0;
103
- right: 0;
104
- z-index: 10000;
105
- background-color: white;
106
- box-shadow: 0px 0px 8px 0px black;
107
- overflow-y: auto;
108
- display: none;
109
- }
110
-
111
- #mocha-stats {
112
- position: absolute;
113
- }
114
- </style>
115
- </head>
116
- <body>
117
- <div id="mocha"></div>
118
- <div id="map"></div>
119
- <script>
120
- window.addEventListener('DOMContentLoaded', () => {
121
- var runner = (window.mochaPhantomJS || window.mocha).run(function (failures) {
122
- if (window.location.search.indexOf('debug') === -1)
123
- qs('#mocha').style.display = 'block'
124
- console.log(failures)
125
- })
126
- if (window.location.search.indexOf('debug') !== -1) {
127
- runner.on('fail', function (test, err) {
128
- console.log(test.title, test.err)
129
- console.log(test.err.expected, test.err.actual)
130
- console.log(test.err.stack)
131
- })
132
- sinon.log = function (message) {
133
- console.log(message)
134
- }
135
- }
136
- })
137
- </script>
138
- </body>
139
- </html>