umap-project 3.4.0b3__py3-none-any.whl → 3.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. umap/__init__.py +1 -1
  2. umap/locale/br/LC_MESSAGES/django.mo +0 -0
  3. umap/locale/br/LC_MESSAGES/django.po +71 -57
  4. umap/locale/da/LC_MESSAGES/django.mo +0 -0
  5. umap/locale/da/LC_MESSAGES/django.po +18 -14
  6. umap/locale/de/LC_MESSAGES/django.mo +0 -0
  7. umap/locale/de/LC_MESSAGES/django.po +20 -16
  8. umap/locale/en/LC_MESSAGES/django.po +18 -14
  9. umap/locale/es/LC_MESSAGES/django.mo +0 -0
  10. umap/locale/es/LC_MESSAGES/django.po +20 -16
  11. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  12. umap/locale/fr/LC_MESSAGES/django.po +18 -14
  13. umap/locale/hu/LC_MESSAGES/django.mo +0 -0
  14. umap/locale/hu/LC_MESSAGES/django.po +20 -16
  15. umap/locale/pl/LC_MESSAGES/django.mo +0 -0
  16. umap/locale/pl/LC_MESSAGES/django.po +101 -95
  17. umap/locale/zh_TW/LC_MESSAGES/django.mo +0 -0
  18. umap/locale/zh_TW/LC_MESSAGES/django.po +20 -16
  19. umap/management/commands/clean_tilelayer.py +0 -1
  20. umap/management/commands/search_maps.py +95 -0
  21. umap/settings/__init__.py +9 -1
  22. umap/settings/base.py +7 -6
  23. umap/static/umap/content.css +0 -3
  24. umap/static/umap/css/bar.css +9 -6
  25. umap/static/umap/css/form.css +25 -9
  26. umap/static/umap/css/icon.css +8 -0
  27. umap/static/umap/css/popup.css +1 -0
  28. umap/static/umap/img/16-white.svg +5 -2
  29. umap/static/umap/img/16.svg +1 -1
  30. umap/static/umap/img/source/16-white.svg +7 -4
  31. umap/static/umap/img/source/16.svg +1 -1
  32. umap/static/umap/js/components/copiable.js +47 -0
  33. umap/static/umap/js/modules/autocomplete.js +32 -67
  34. umap/static/umap/js/modules/browser.js +31 -14
  35. umap/static/umap/js/modules/data/features.js +34 -36
  36. umap/static/umap/js/modules/data/fields.js +199 -23
  37. umap/static/umap/js/modules/data/layer.js +85 -96
  38. umap/static/umap/js/modules/domutils.js +25 -1
  39. umap/static/umap/js/modules/filters.js +24 -50
  40. umap/static/umap/js/modules/form/builder.js +17 -16
  41. umap/static/umap/js/modules/form/fields.js +20 -20
  42. umap/static/umap/js/modules/formatter.js +9 -1
  43. umap/static/umap/js/modules/help.js +12 -13
  44. umap/static/umap/js/modules/importer.js +17 -26
  45. umap/static/umap/js/modules/importers/banfr.js +0 -1
  46. umap/static/umap/js/modules/importers/cadastrefr.js +19 -19
  47. umap/static/umap/js/modules/importers/communesfr.js +7 -8
  48. umap/static/umap/js/modules/importers/datasets.js +14 -14
  49. umap/static/umap/js/modules/importers/geodatamine.js +20 -22
  50. umap/static/umap/js/modules/importers/opendata.js +10 -0
  51. umap/static/umap/js/modules/importers/overpass.js +19 -18
  52. umap/static/umap/js/modules/managers.js +1 -1
  53. umap/static/umap/js/modules/permissions.js +15 -5
  54. umap/static/umap/js/modules/rendering/controls.js +203 -10
  55. umap/static/umap/js/modules/rendering/icon.js +5 -9
  56. umap/static/umap/js/modules/rendering/layers/base.js +1 -1
  57. umap/static/umap/js/modules/rendering/layers/classified.js +16 -11
  58. umap/static/umap/js/modules/rendering/layers/heat.js +1 -0
  59. umap/static/umap/js/modules/rendering/map.js +67 -57
  60. umap/static/umap/js/modules/rendering/popup.js +6 -3
  61. umap/static/umap/js/modules/rendering/template.js +40 -40
  62. umap/static/umap/js/modules/rendering/ui.js +1 -2
  63. umap/static/umap/js/modules/rules.js +34 -41
  64. umap/static/umap/js/modules/schema.js +0 -7
  65. umap/static/umap/js/modules/share.js +36 -69
  66. umap/static/umap/js/modules/slideshow.js +3 -3
  67. umap/static/umap/js/modules/tableeditor.js +0 -1
  68. umap/static/umap/js/modules/ui/bar.js +53 -33
  69. umap/static/umap/js/modules/ui/hash.js +36 -0
  70. umap/static/umap/js/modules/ui/loader.js +26 -0
  71. umap/static/umap/js/modules/ui/panel.js +33 -21
  72. umap/static/umap/js/modules/ui/tooltip.js +1 -1
  73. umap/static/umap/js/modules/umap.js +81 -80
  74. umap/static/umap/js/modules/utils.js +13 -3
  75. umap/static/umap/js/umap.controls.js +16 -179
  76. umap/static/umap/locale/am_ET.js +7 -8
  77. umap/static/umap/locale/am_ET.json +7 -8
  78. umap/static/umap/locale/ar.js +7 -8
  79. umap/static/umap/locale/ar.json +7 -8
  80. umap/static/umap/locale/ast.js +7 -8
  81. umap/static/umap/locale/ast.json +7 -8
  82. umap/static/umap/locale/bg.js +7 -8
  83. umap/static/umap/locale/bg.json +7 -8
  84. umap/static/umap/locale/br.js +44 -36
  85. umap/static/umap/locale/br.json +44 -36
  86. umap/static/umap/locale/ca.js +7 -8
  87. umap/static/umap/locale/ca.json +7 -8
  88. umap/static/umap/locale/cs_CZ.js +7 -8
  89. umap/static/umap/locale/cs_CZ.json +7 -8
  90. umap/static/umap/locale/da.js +8 -9
  91. umap/static/umap/locale/da.json +8 -9
  92. umap/static/umap/locale/de.js +62 -63
  93. umap/static/umap/locale/de.json +62 -63
  94. umap/static/umap/locale/el.js +7 -8
  95. umap/static/umap/locale/el.json +7 -8
  96. umap/static/umap/locale/en.js +7 -8
  97. umap/static/umap/locale/en.json +7 -8
  98. umap/static/umap/locale/en_US.json +7 -8
  99. umap/static/umap/locale/es.js +19 -20
  100. umap/static/umap/locale/es.json +19 -20
  101. umap/static/umap/locale/et.js +7 -8
  102. umap/static/umap/locale/et.json +7 -8
  103. umap/static/umap/locale/eu.js +23 -24
  104. umap/static/umap/locale/eu.json +23 -24
  105. umap/static/umap/locale/fa_IR.js +7 -8
  106. umap/static/umap/locale/fa_IR.json +7 -8
  107. umap/static/umap/locale/fi.js +7 -8
  108. umap/static/umap/locale/fi.json +7 -8
  109. umap/static/umap/locale/fr.js +11 -12
  110. umap/static/umap/locale/fr.json +11 -12
  111. umap/static/umap/locale/gl.js +147 -148
  112. umap/static/umap/locale/gl.json +147 -148
  113. umap/static/umap/locale/he.js +7 -8
  114. umap/static/umap/locale/he.json +7 -8
  115. umap/static/umap/locale/hr.js +7 -8
  116. umap/static/umap/locale/hr.json +7 -8
  117. umap/static/umap/locale/hu.js +8 -9
  118. umap/static/umap/locale/hu.json +8 -9
  119. umap/static/umap/locale/id.js +7 -8
  120. umap/static/umap/locale/id.json +7 -8
  121. umap/static/umap/locale/is.js +7 -8
  122. umap/static/umap/locale/is.json +7 -8
  123. umap/static/umap/locale/it.js +7 -8
  124. umap/static/umap/locale/it.json +7 -8
  125. umap/static/umap/locale/ja.js +7 -8
  126. umap/static/umap/locale/ja.json +7 -8
  127. umap/static/umap/locale/ko.js +7 -8
  128. umap/static/umap/locale/ko.json +7 -8
  129. umap/static/umap/locale/lt.js +7 -8
  130. umap/static/umap/locale/lt.json +7 -8
  131. umap/static/umap/locale/ms.js +7 -8
  132. umap/static/umap/locale/ms.json +7 -8
  133. umap/static/umap/locale/nl.js +7 -8
  134. umap/static/umap/locale/nl.json +7 -8
  135. umap/static/umap/locale/no.js +7 -8
  136. umap/static/umap/locale/no.json +7 -8
  137. umap/static/umap/locale/pl.js +53 -54
  138. umap/static/umap/locale/pl.json +53 -54
  139. umap/static/umap/locale/pl_PL.json +7 -8
  140. umap/static/umap/locale/pt.js +7 -8
  141. umap/static/umap/locale/pt.json +7 -8
  142. umap/static/umap/locale/pt_BR.js +7 -8
  143. umap/static/umap/locale/pt_BR.json +7 -8
  144. umap/static/umap/locale/pt_PT.js +7 -8
  145. umap/static/umap/locale/pt_PT.json +7 -8
  146. umap/static/umap/locale/ro.js +7 -8
  147. umap/static/umap/locale/ro.json +7 -8
  148. umap/static/umap/locale/ru.js +7 -8
  149. umap/static/umap/locale/ru.json +7 -8
  150. umap/static/umap/locale/sk_SK.js +7 -8
  151. umap/static/umap/locale/sk_SK.json +7 -8
  152. umap/static/umap/locale/sl.js +7 -8
  153. umap/static/umap/locale/sl.json +7 -8
  154. umap/static/umap/locale/sr.js +7 -8
  155. umap/static/umap/locale/sr.json +7 -8
  156. umap/static/umap/locale/sv.js +7 -8
  157. umap/static/umap/locale/sv.json +7 -8
  158. umap/static/umap/locale/th_TH.js +7 -8
  159. umap/static/umap/locale/th_TH.json +7 -8
  160. umap/static/umap/locale/tr.js +7 -8
  161. umap/static/umap/locale/tr.json +7 -8
  162. umap/static/umap/locale/uk_UA.js +7 -8
  163. umap/static/umap/locale/uk_UA.json +7 -8
  164. umap/static/umap/locale/vi.js +7 -8
  165. umap/static/umap/locale/vi.json +7 -8
  166. umap/static/umap/locale/vi_VN.json +7 -8
  167. umap/static/umap/locale/zh.js +7 -8
  168. umap/static/umap/locale/zh.json +7 -8
  169. umap/static/umap/locale/zh_CN.json +7 -8
  170. umap/static/umap/locale/zh_TW.Big5.json +7 -8
  171. umap/static/umap/locale/zh_TW.js +20 -21
  172. umap/static/umap/locale/zh_TW.json +20 -21
  173. umap/static/umap/map.css +6 -21
  174. umap/static/umap/unittests/utils.js +7 -7
  175. umap/static/umap/vendors/locatecontrol/L.Control.Locate.esm.js +942 -0
  176. umap/static/umap/vendors/photon/leaflet.photon.esm.js +472 -0
  177. umap/sync/app.py +4 -1
  178. umap/templates/umap/content_footer.html +1 -0
  179. umap/templates/umap/css.html +0 -4
  180. umap/templates/umap/js.html +1 -8
  181. umap/templates/umap/team_form.html +2 -1
  182. umap/tests/integration/conftest.py +3 -2
  183. umap/tests/integration/test_anonymous_owned_map.py +1 -1
  184. umap/tests/integration/test_conditional_rules.py +106 -51
  185. umap/tests/integration/test_draw_polygon.py +4 -0
  186. umap/tests/integration/test_draw_polyline.py +11 -0
  187. umap/tests/integration/test_edit_datalayer.py +1 -1
  188. umap/tests/integration/test_edit_map.py +2 -0
  189. umap/tests/integration/test_fields.py +19 -0
  190. umap/tests/integration/test_filters.py +24 -0
  191. umap/tests/integration/test_iframe.py +1 -1
  192. umap/tests/integration/test_import.py +26 -0
  193. umap/tests/integration/test_map.py +3 -3
  194. umap/tests/integration/test_optimistic_merge.py +7 -1
  195. umap/tests/integration/test_owned_map.py +2 -2
  196. umap/tests/integration/test_popup.py +31 -0
  197. umap/tests/integration/test_remote_data.py +5 -5
  198. umap/tests/integration/test_search.py +41 -0
  199. umap/tests/integration/test_share.py +2 -2
  200. umap/tests/integration/test_team.py +1 -1
  201. umap/tests/integration/test_websocket_sync.py +6 -1
  202. umap/tests/test_search_maps_command.py +44 -0
  203. umap/tests/test_utils.py +4 -1
  204. umap/utils.py +10 -3
  205. umap/views.py +17 -4
  206. {umap_project-3.4.0b3.dist-info → umap_project-3.6.0.dist-info}/METADATA +29 -23
  207. {umap_project-3.4.0b3.dist-info → umap_project-3.6.0.dist-info}/RECORD +210 -214
  208. {umap_project-3.4.0b3.dist-info → umap_project-3.6.0.dist-info}/WHEEL +1 -1
  209. umap/static/umap/js/umap.core.js +0 -93
  210. umap/static/umap/vendors/editinosm/Leaflet.EditInOSM.css +0 -46
  211. umap/static/umap/vendors/editinosm/Leaflet.EditInOSM.js +0 -240
  212. umap/static/umap/vendors/editinosm/edit-in-osm.png +0 -0
  213. umap/static/umap/vendors/hash/leaflet-hash.js +0 -162
  214. umap/static/umap/vendors/loading/Control.Loading.css +0 -26
  215. umap/static/umap/vendors/loading/Control.Loading.js +0 -351
  216. umap/static/umap/vendors/locatecontrol/L.Control.Locate.min.css +0 -1
  217. umap/static/umap/vendors/locatecontrol/L.Control.Locate.min.css.map +0 -1
  218. umap/static/umap/vendors/locatecontrol/L.Control.Locate.min.js +0 -4
  219. umap/static/umap/vendors/locatecontrol/L.Control.Locate.min.js.map +0 -1
  220. umap/static/umap/vendors/photon/leaflet.photon.js +0 -487
  221. {umap_project-3.4.0b3.dist-info → umap_project-3.6.0.dist-info}/entry_points.txt +0 -0
  222. {umap_project-3.4.0b3.dist-info → umap_project-3.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,93 +0,0 @@
1
- L.DomUtil.add = (tagName, className, container, content) => {
2
- const el = L.DomUtil.create(tagName, className, container)
3
- if (content) {
4
- if (content.nodeType && content.nodeType === 1) {
5
- el.appendChild(content)
6
- } else {
7
- el.textContent = content
8
- }
9
- }
10
- return el
11
- }
12
-
13
- L.DomUtil.createFieldset = (container, legend, options) => {
14
- options = options || {}
15
- const details = L.DomUtil.create('details', options.className || '', container)
16
- const summary = L.DomUtil.add('summary', '', details)
17
- if (options.icon) L.DomUtil.createIcon(summary, options.icon)
18
- L.DomUtil.add('h4', '', summary, legend)
19
- const fieldset = L.DomUtil.add('fieldset', '', details)
20
- details.open = options.on === true
21
- if (options.callback) {
22
- L.DomEvent.on(details, 'toggle', () => {
23
- if (details.open) options.callback.call(options.context || this)
24
- })
25
- }
26
- return fieldset
27
- }
28
-
29
- L.DomUtil.createButton = (className, container, content, callback, context) => {
30
- const el = L.DomUtil.add('button', className, container, content)
31
- el.type = 'button'
32
- if (!content.nodeType) {
33
- el.title = content
34
- }
35
- if (callback) {
36
- L.DomEvent.on(el, 'click', L.DomEvent.stop).on(el, 'click', callback, context)
37
- }
38
- return el
39
- }
40
-
41
- L.DomUtil.createIcon = (parent, className, title, size = 16) => {
42
- return L.DomUtil.element({
43
- tagName: 'i',
44
- parent: parent,
45
- className: `icon icon-${size} ${className}`,
46
- title: title || '',
47
- })
48
- }
49
-
50
- L.DomUtil.createButtonIcon = (parent, className, title, callback, size = 16) => {
51
- const el = L.DomUtil.element({
52
- tagName: 'button',
53
- parent: parent,
54
- className: `icon icon-${size} ${className}`,
55
- title: title || '',
56
- })
57
- if (callback) {
58
- L.DomEvent.on(el, 'click', L.DomEvent.stop).on(el, 'click', callback)
59
- }
60
- return el
61
- }
62
-
63
- L.DomUtil.createTitle = (parent, text, iconClassName, className = '', tag = 'h3') => {
64
- const title = L.DomUtil.create(tag, '', parent)
65
- if (iconClassName) L.DomUtil.createIcon(title, iconClassName)
66
- L.DomUtil.add('span', className, title, text)
67
- return title
68
- }
69
-
70
- L.DomUtil.element = ({ tagName, parent, ...attrs }) => {
71
- const el = document.createElement(tagName)
72
- if (attrs.innerHTML) {
73
- attrs.innerHTML = U.Utils.escapeHTML(attrs.innerHTML)
74
- } else if (attrs.safeHTML) {
75
- attrs.innerHTML = attrs.safeHTML
76
- }
77
- for (const attr in attrs) {
78
- el[attr] = attrs[attr]
79
- }
80
- if (typeof parent !== 'undefined') {
81
- parent.appendChild(el)
82
- }
83
- return el
84
- }
85
-
86
- L.LatLng.prototype.isValid = function () {
87
- return (
88
- Number.isFinite(this.lat) &&
89
- Math.abs(this.lat) <= 90 &&
90
- Number.isFinite(this.lng) &&
91
- Math.abs(this.lng) <= 180
92
- )
93
- }
@@ -1,46 +0,0 @@
1
- .leaflet-control-edit-in-osm-simple,
2
- .leaflet-control-edit-in-osm {
3
- background: none repeat scroll 0 0 #F8F8F9;
4
- border: 1px solid #888888;
5
- border-radius: 5px 5px 5px 5px;
6
- box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
7
- }
8
- .leaflet-control-edit-in-osm .leaflet-control-edit-in-osm-toggle {
9
- background-position: 50% 50%;
10
- background-repeat: no-repeat;
11
- height: 36px;
12
- width: 36px;
13
- display: block;
14
- }
15
- .leaflet-control-edit-in-osm .leaflet-control-edit-in-osm-toggle {
16
- background-image: url("./edit-in-osm.png");
17
- }
18
- .leaflet-control-edit-in-osm .osm-editor + .osm-editor {
19
- border-left: 1px solid black;
20
- }
21
- .leaflet-control-edit-in-osm-simple a.osm-editor,
22
- .leaflet-control-edit-in-osm a.osm-editor {
23
- display: none;
24
- height: 36px;
25
- min-width: 36px;
26
- text-align: center;
27
- line-height: 36px;
28
- color: #333;
29
- padding: 0 5px;
30
- text-decoration: none;
31
- font-family: sans-serif;
32
- }
33
- .leaflet-control-edit-in-osm-simple a.osm-editor,
34
- .leaflet-control-edit-in-osm:hover a.osm-editor {
35
- display: inline-block;
36
- }
37
- a.osm-editor:hover {
38
- box-shadow: 0 0 2px 0 black inset;
39
- }
40
- .leaflet-control-edit-in-osm:hover .leaflet-control-edit-in-osm-toggle {
41
- display: none;
42
- }
43
-
44
- .leaflet-control-edit-hidden {
45
- display: none;
46
- }
@@ -1,240 +0,0 @@
1
- (function (factory) {
2
- var L;
3
- if (typeof define === 'function' && define.amd) {
4
- // AMD
5
- define(['leaflet'], function(L) {
6
- factory(L, setTimeout);
7
- });
8
- } else if (typeof module !== 'undefined') {
9
- // Node/CommonJS
10
- L = require('leaflet');
11
- module.exports = factory(L, setTimeout);
12
- } else {
13
- // Browser globals
14
- if (typeof window.L === 'undefined')
15
- throw 'Leaflet must be loaded first';
16
- factory(window.L, setTimeout);
17
- }
18
- }(function (L, setTimeout) {
19
- var _controlContainer,
20
- _map,
21
- _zoomThreshold,
22
- _hideClass = 'leaflet-control-edit-hidden',
23
- _anchorClass = 'leaflet-control-edit-in-osm-toggle',
24
-
25
- _Widgets = {
26
- SimpleButton: function (config) {
27
- var className = (config && config.className) || 'leaflet-control-edit-in-osm-simple',
28
- helpText = config && config.helpText,
29
- addEditors = (config && config.addEditors) || function (container, editors) {
30
- addEditorToWidget(container, editors[0], helpText);
31
- };
32
-
33
- return {
34
- className: className,
35
- helpText: helpText,
36
- addEditors: addEditors
37
- };
38
- },
39
- MultiButton: function (config) {
40
- var className = 'leaflet-control-edit-in-osm',
41
- helpText = "Open this map extent in a map editor to provide more accurate data to OpenStreetMap",
42
- addEditors = function (container, editors) {
43
- for (var i in editors) {
44
- addEditorToWidget(container, editors[i]);
45
- }
46
- };
47
-
48
- return {
49
- className: (config && config.className) || className,
50
- helpText: (config && config.helpText) || helpText,
51
- addEditors: (config && config.addEditors) || addEditors
52
- };
53
- },
54
- AttributionBox: function (config) {
55
- var className = 'leaflet-control-attribution',
56
- helpText = "Edit in OSM",
57
- addEditors = function (container, editors) {
58
- addEditorToWidget(container, editors[0], helpText);
59
- };
60
-
61
- return {
62
- className: (config && config.className) || className,
63
- helpText: (config && config.helpText) || helpText,
64
- addEditors: (config && config.addEditors) || addEditors
65
- };
66
- }
67
- },
68
-
69
- _Editors = {
70
- Id: function (config) {
71
- var url = 'https://www.openstreetmap.org/edit?editor=id#map=',
72
- displayName = "iD",
73
- buildUrl = function (map) {
74
- return this.url + [
75
- map.getZoom(),
76
- map.getCenter().wrap().lat,
77
- map.getCenter().wrap().lng
78
- ].join('/');
79
- };
80
- return {
81
- url: (config && config.url) || url,
82
- displayName: (config && config.displayName) || displayName,
83
- buildUrl: (config && config.buildUrl) || buildUrl
84
- };
85
- },
86
- Josm: function (config) {
87
- var url = 'http://127.0.0.1:8111/load_and_zoom',
88
- timeout = 1000,
89
- displayName = "JOSM",
90
- buildUrl = function (map) {
91
- var bounds = map.getBounds();
92
- return this.url + L.Util.getParamString({
93
- left: bounds.getNorthWest().lng,
94
- right: bounds.getSouthEast().lng,
95
- top: bounds.getNorthWest().lat,
96
- bottom: bounds.getSouthEast().lat
97
- });
98
- };
99
-
100
- return {
101
- url: (config && config.url) || url,
102
- timeout: (config && config.timeout) || timeout,
103
- displayName: (config && config.displayName) || displayName,
104
- buildUrl: (config && config.buildUrl) || buildUrl
105
- };
106
- },
107
- Potlatch: function (config) {
108
- var url = 'http://open.mapquestapi.com/dataedit/index_flash.html',
109
- displayName = "P2",
110
- buildUrl = function (map) {
111
- return this.url + L.Util.getParamString({
112
- lon: map.getCenter().wrap().lng,
113
- lat: map.getCenter().wrap().lat,
114
- zoom: map.getZoom()
115
- });
116
- };
117
- return {
118
- url: (config && config.url) || url,
119
- displayName: (config && config.displayName) || displayName,
120
- buildUrl: (config && config.buildUrl) || buildUrl
121
- };
122
- }
123
- };
124
-
125
-
126
- // Takes an editor, calls their buildUrl method
127
- // and opens the url in the browser
128
- function openRemote (editor) {
129
- var url = editor.buildUrl(_map),
130
- w = window.open(url);
131
- if (editor.timeout) {
132
- setTimeout(function() {w.close();}, editor.timeout);
133
- }
134
- }
135
-
136
- function addEditorToWidget(widgetContainer, editor, text) {
137
- var editorWidget = L.DomUtil.create('a', "osm-editor", widgetContainer);
138
- editorWidget.href = "#";
139
- editorWidget.innerHTML = text || editor.displayName;
140
- L.DomEvent.on(editorWidget, "click", function (e) {
141
- openRemote(editor);
142
- L.DomEvent.stop(e);
143
- });
144
- }
145
-
146
- // Make the EditInOSM widget visible or invisible after each
147
- // zoom event.
148
- //
149
- // configurable by setting the *zoomThreshold* option.
150
- function showOrHideUI() {
151
- var zoom = _map.getZoom();
152
- if (zoom < _zoomThreshold) {
153
- L.DomUtil.addClass(_controlContainer, _hideClass);
154
- } else {
155
- L.DomUtil.removeClass(_controlContainer, _hideClass);
156
- }
157
- }
158
-
159
- L.Control.EditInOSM = L.Control.extend({
160
-
161
- options: {
162
- position: "topright",
163
- zoomThreshold: 0,
164
- widget: "multiButton",
165
- editors: ["id", "josm"]
166
- },
167
-
168
- initialize: function (options) {
169
- var newEditors = [],
170
- widget,
171
- widgetSmallName,
172
- editor,
173
- editorSmallName;
174
-
175
- L.setOptions(this, options);
176
-
177
- _zoomThreshold = this.options.zoomThreshold;
178
-
179
- widget = this.options.widget;
180
- widgetSmallName = typeof(widget) === 'string' ? widget.toLowerCase() : '';
181
-
182
- // setup widget from string or object
183
- if (widgetSmallName === "simplebutton") {
184
- this.options.widget = new _Widgets.SimpleButton(this.options.widgetOptions);
185
- } else if (widgetSmallName === "multibutton") {
186
- this.options.widget = new _Widgets.MultiButton(this.options.widgetOptions);
187
- } else if (widgetSmallName === "attributionbox") {
188
- this.options.widget = new _Widgets.AttributionBox(this.options.widgetOptions);
189
- }
190
-
191
- // setup editors from strings or objects
192
- for (var i in this.options.editors) {
193
- editor = this.options.editors[i],
194
- editorSmallName = typeof(editor) === "string" ? editor.toLowerCase() : null;
195
-
196
- if (editorSmallName === "id") {
197
- newEditors.push(new _Editors.Id());
198
- } else if (editorSmallName === "josm") {
199
- newEditors.push(new _Editors.Josm());
200
- } else if (editorSmallName === "potlatch") {
201
- newEditors.push(new _Editors.Potlatch());
202
- } else {
203
- newEditors.push(editor);
204
- }
205
- }
206
- this.options.editors = newEditors;
207
-
208
- },
209
-
210
- onAdd: function (map) {
211
- _map = map;
212
- map.on('zoomend', showOrHideUI);
213
-
214
- _controlContainer = L.DomUtil.create('div', this.options.widget.className);
215
-
216
- _controlContainer.title = this.options.widget.helpText || '';
217
-
218
- L.DomUtil.create('a', _anchorClass, _controlContainer);
219
-
220
- this.options.widget.addEditors(_controlContainer, this.options.editors);
221
- return _controlContainer;
222
- },
223
-
224
- onRemove: function (map) {
225
- map.off('zoomend', showOrHideUI);
226
- }
227
-
228
- });
229
-
230
- L.Control.EditInOSM.Widgets = _Widgets;
231
- L.Control.EditInOSM.Editors = _Editors;
232
-
233
- L.Map.addInitHook(function () {
234
- if (this.options.editInOSMControlOptions) {
235
- var options = this.options.editInOSMControlOptions || {};
236
- this.editInOSMControl = (new L.Control.EditInOSM(options)).addTo(this);
237
- }
238
- });
239
-
240
- }));
@@ -1,162 +0,0 @@
1
- (function(window) {
2
- var HAS_HASHCHANGE = (function() {
3
- var doc_mode = window.documentMode;
4
- return ('onhashchange' in window) &&
5
- (doc_mode === undefined || doc_mode > 7);
6
- })();
7
-
8
- L.Hash = function(map) {
9
- this.onHashChange = L.Util.bind(this.onHashChange, this);
10
-
11
- if (map) {
12
- this.init(map);
13
- }
14
- };
15
-
16
- L.Hash.parseHash = function(hash) {
17
- if(hash.indexOf('#') === 0) {
18
- hash = hash.substr(1);
19
- }
20
- var args = hash.split("/");
21
- if (args.length == 3) {
22
- var zoom = parseInt(args[0], 10),
23
- lat = parseFloat(args[1]),
24
- lon = parseFloat(args[2]);
25
- if (isNaN(zoom) || isNaN(lat) || isNaN(lon)) {
26
- return false;
27
- } else {
28
- return {
29
- center: new L.LatLng(lat, lon),
30
- zoom: zoom
31
- };
32
- }
33
- } else {
34
- return false;
35
- }
36
- };
37
-
38
- L.Hash.formatHash = function(map) {
39
- var center = map.getCenter(),
40
- zoom = map.getZoom(),
41
- precision = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
42
-
43
- return "#" + [zoom,
44
- center.lat.toFixed(precision),
45
- center.lng.toFixed(precision)
46
- ].join("/");
47
- },
48
-
49
- L.Hash.prototype = {
50
- map: null,
51
- lastHash: null,
52
-
53
- parseHash: L.Hash.parseHash,
54
- formatHash: L.Hash.formatHash,
55
-
56
- init: function(map) {
57
- this.map = map;
58
-
59
- // reset the hash
60
- this.lastHash = null;
61
- this.onHashChange();
62
-
63
- if (!this.isListening) {
64
- this.startListening();
65
- }
66
- },
67
-
68
- removeFrom: function(map) {
69
- if (this.changeTimeout) {
70
- clearTimeout(this.changeTimeout);
71
- }
72
-
73
- if (this.isListening) {
74
- this.stopListening();
75
- }
76
-
77
- this.map = null;
78
- },
79
-
80
- onMapMove: function() {
81
- // bail if we're moving the map (updating from a hash),
82
- // or if the map is not yet loaded
83
-
84
- if (this.movingMap || !this.map._loaded) {
85
- return false;
86
- }
87
-
88
- var hash = this.formatHash(this.map);
89
- if (this.lastHash != hash) {
90
- location.replace(hash);
91
- this.lastHash = hash;
92
- }
93
- },
94
-
95
- movingMap: false,
96
- update: function() {
97
- var hash = location.hash;
98
- if (hash === this.lastHash) {
99
- return;
100
- }
101
- var parsed = this.parseHash(hash);
102
- if (parsed) {
103
- this.movingMap = true;
104
-
105
- this.map.setView(parsed.center, parsed.zoom);
106
-
107
- this.movingMap = false;
108
- } else {
109
- this.onMapMove(this.map);
110
- }
111
- },
112
-
113
- // defer hash change updates every 100ms
114
- changeDefer: 100,
115
- changeTimeout: null,
116
- onHashChange: function() {
117
- // throttle calls to update() so that they only happen every
118
- // `changeDefer` ms
119
- if (!this.changeTimeout) {
120
- var that = this;
121
- this.changeTimeout = setTimeout(function() {
122
- that.update();
123
- that.changeTimeout = null;
124
- }, this.changeDefer);
125
- }
126
- },
127
-
128
- isListening: false,
129
- hashChangeInterval: null,
130
- startListening: function() {
131
- this.map.on("moveend", this.onMapMove, this);
132
-
133
- if (HAS_HASHCHANGE) {
134
- L.DomEvent.addListener(window, "hashchange", this.onHashChange);
135
- } else {
136
- clearInterval(this.hashChangeInterval);
137
- this.hashChangeInterval = setInterval(this.onHashChange, 50);
138
- }
139
- this.isListening = true;
140
- },
141
-
142
- stopListening: function() {
143
- this.map.off("moveend", this.onMapMove, this);
144
-
145
- if (HAS_HASHCHANGE) {
146
- L.DomEvent.removeListener(window, "hashchange", this.onHashChange);
147
- } else {
148
- clearInterval(this.hashChangeInterval);
149
- }
150
- this.isListening = false;
151
- }
152
- };
153
- L.hash = function(map) {
154
- return new L.Hash(map);
155
- };
156
- L.Map.prototype.addHash = function() {
157
- this._hash = L.hash(this);
158
- };
159
- L.Map.prototype.removeHash = function() {
160
- this._hash.removeFrom();
161
- };
162
- })(window);
@@ -1,26 +0,0 @@
1
- .leaflet-control-loading:empty {
2
- /* Spinner via ajaxload.info, base64-encoded */
3
- background-image: url(data:image/gif;base64,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);
4
- background-repeat: no-repeat;
5
- }
6
-
7
- .leaflet-control-loading,
8
- .leaflet-control-zoom a.leaflet-control-loading,
9
- .leaflet-control-zoomslider a.leaflet-control-loading,
10
- .leaflet-control-layer-container {
11
- display: none;
12
- }
13
-
14
- .leaflet-control-loading.is-loading,
15
- .leaflet-control-zoom a.leaflet-control-loading.is-loading,
16
- .leaflet-control-zoomslider a.leaflet-control-loading.is-loading,
17
- .leaflet-control-layer-container.is-loading {
18
- display: block;
19
- }
20
-
21
- /* Necessary for display consistency in Leaflet >= 0.6 */
22
- .leaflet-bar-part-bottom {
23
- border-bottom: medium none;
24
- border-bottom-left-radius: 4px;
25
- border-bottom-right-radius: 4px;
26
- }