umap-project 1.14.0a1__py3-none-any.whl → 1.14.0a2__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 (182) hide show
  1. umap/__init__.py +1 -1
  2. umap/static/.gitignore +0 -0
  3. umap/static/umap/base.css +994 -0
  4. umap/static/umap/bitbucket.png +0 -0
  5. umap/static/umap/content.css +395 -0
  6. umap/static/umap/favicons/apple-touch-icon.png +0 -0
  7. umap/static/umap/favicons/favicon.ico +0 -0
  8. umap/static/umap/favicons/icon-192.png +0 -0
  9. umap/static/umap/favicons/icon-512.png +0 -0
  10. umap/static/umap/favicons/icon.svg +5 -0
  11. umap/static/umap/font/FiraSans-Light.woff +0 -0
  12. umap/static/umap/font/FiraSans-Light.woff2 +0 -0
  13. umap/static/umap/font/FiraSans-LightItalic.woff +0 -0
  14. umap/static/umap/font/FiraSans-LightItalic.woff2 +0 -0
  15. umap/static/umap/font/FiraSans-SemiBold.woff +0 -0
  16. umap/static/umap/font/FiraSans-SemiBold.woff2 +0 -0
  17. umap/static/umap/font.css +33 -0
  18. umap/static/umap/github.png +0 -0
  19. umap/static/umap/img/16-white.svg +190 -0
  20. umap/static/umap/img/16.svg +182 -0
  21. umap/static/umap/img/24-white.svg +62 -0
  22. umap/static/umap/img/24.svg +90 -0
  23. umap/static/umap/img/edit.svg +7 -0
  24. umap/static/umap/img/icon-bg.png +0 -0
  25. umap/static/umap/img/logo.svg +4 -0
  26. umap/static/umap/img/logo_filigree.png +0 -0
  27. umap/static/umap/img/logo_small.svg +14 -0
  28. umap/static/umap/img/marker.png +0 -0
  29. umap/static/umap/img/opensource.svg +7 -0
  30. umap/static/umap/img/osm.svg +7 -0
  31. umap/static/umap/img/search.gif +0 -0
  32. umap/static/umap/img/source/16-white.svg +980 -0
  33. umap/static/umap/img/source/16.svg +201 -0
  34. umap/static/umap/img/source/24-white.svg +83 -0
  35. umap/static/umap/img/source/24.svg +110 -0
  36. umap/static/umap/js/components/fragment.js +13 -0
  37. umap/static/umap/js/modules/global.js +8 -0
  38. umap/static/umap/js/modules/urls.js +29 -0
  39. umap/static/umap/js/umap.autocomplete.js +336 -0
  40. umap/static/umap/js/umap.browser.js +148 -0
  41. umap/static/umap/js/umap.controls.js +1542 -0
  42. umap/static/umap/js/umap.core.js +851 -0
  43. umap/static/umap/js/umap.datalayer.permissions.js +72 -0
  44. umap/static/umap/js/umap.features.js +1216 -0
  45. umap/static/umap/js/umap.forms.js +1267 -0
  46. umap/static/umap/js/umap.icon.js +234 -0
  47. umap/static/umap/js/umap.importer.js +166 -0
  48. umap/static/umap/js/umap.js +2010 -0
  49. umap/static/umap/js/umap.layer.js +1636 -0
  50. umap/static/umap/js/umap.permissions.js +212 -0
  51. umap/static/umap/js/umap.popup.js +340 -0
  52. umap/static/umap/js/umap.share.js +254 -0
  53. umap/static/umap/js/umap.slideshow.js +165 -0
  54. umap/static/umap/js/umap.tableeditor.js +120 -0
  55. umap/static/umap/js/umap.ui.js +240 -0
  56. umap/static/umap/js/umap.xhr.js +304 -0
  57. umap/static/umap/locale/am_ET.js +447 -0
  58. umap/static/umap/locale/am_ET.json +445 -0
  59. umap/static/umap/locale/ar.js +447 -0
  60. umap/static/umap/locale/ar.json +445 -0
  61. umap/static/umap/locale/ast.js +447 -0
  62. umap/static/umap/locale/ast.json +445 -0
  63. umap/static/umap/locale/bg.js +447 -0
  64. umap/static/umap/locale/bg.json +445 -0
  65. umap/static/umap/locale/br.js +447 -0
  66. umap/static/umap/locale/br.json +445 -0
  67. umap/static/umap/locale/ca.js +447 -0
  68. umap/static/umap/locale/ca.json +445 -0
  69. umap/static/umap/locale/cs_CZ.js +447 -0
  70. umap/static/umap/locale/cs_CZ.json +445 -0
  71. umap/static/umap/locale/da.js +447 -0
  72. umap/static/umap/locale/da.json +445 -0
  73. umap/static/umap/locale/de.js +447 -0
  74. umap/static/umap/locale/de.json +445 -0
  75. umap/static/umap/locale/el.js +447 -0
  76. umap/static/umap/locale/el.json +445 -0
  77. umap/static/umap/locale/en.js +447 -0
  78. umap/static/umap/locale/en.json +445 -0
  79. umap/static/umap/locale/en_US.json +445 -0
  80. umap/static/umap/locale/es.js +447 -0
  81. umap/static/umap/locale/es.json +445 -0
  82. umap/static/umap/locale/et.js +447 -0
  83. umap/static/umap/locale/et.json +445 -0
  84. umap/static/umap/locale/eu.js +413 -0
  85. umap/static/umap/locale/eu.json +411 -0
  86. umap/static/umap/locale/fa_IR.js +447 -0
  87. umap/static/umap/locale/fa_IR.json +445 -0
  88. umap/static/umap/locale/fi.js +447 -0
  89. umap/static/umap/locale/fi.json +445 -0
  90. umap/static/umap/locale/fr.js +447 -0
  91. umap/static/umap/locale/fr.json +445 -0
  92. umap/static/umap/locale/gl.js +447 -0
  93. umap/static/umap/locale/gl.json +445 -0
  94. umap/static/umap/locale/he.js +447 -0
  95. umap/static/umap/locale/he.json +445 -0
  96. umap/static/umap/locale/hr.js +447 -0
  97. umap/static/umap/locale/hr.json +445 -0
  98. umap/static/umap/locale/hu.js +447 -0
  99. umap/static/umap/locale/hu.json +445 -0
  100. umap/static/umap/locale/id.js +447 -0
  101. umap/static/umap/locale/id.json +445 -0
  102. umap/static/umap/locale/is.js +447 -0
  103. umap/static/umap/locale/is.json +445 -0
  104. umap/static/umap/locale/it.js +447 -0
  105. umap/static/umap/locale/it.json +445 -0
  106. umap/static/umap/locale/ja.js +447 -0
  107. umap/static/umap/locale/ja.json +445 -0
  108. umap/static/umap/locale/ko.js +447 -0
  109. umap/static/umap/locale/ko.json +445 -0
  110. umap/static/umap/locale/lt.js +447 -0
  111. umap/static/umap/locale/lt.json +445 -0
  112. umap/static/umap/locale/ms.js +447 -0
  113. umap/static/umap/locale/ms.json +445 -0
  114. umap/static/umap/locale/nl.js +447 -0
  115. umap/static/umap/locale/nl.json +445 -0
  116. umap/static/umap/locale/no.js +447 -0
  117. umap/static/umap/locale/no.json +445 -0
  118. umap/static/umap/locale/pl.js +447 -0
  119. umap/static/umap/locale/pl.json +445 -0
  120. umap/static/umap/locale/pl_PL.json +445 -0
  121. umap/static/umap/locale/pt.js +447 -0
  122. umap/static/umap/locale/pt.json +445 -0
  123. umap/static/umap/locale/pt_BR.js +447 -0
  124. umap/static/umap/locale/pt_BR.json +445 -0
  125. umap/static/umap/locale/pt_PT.js +447 -0
  126. umap/static/umap/locale/pt_PT.json +445 -0
  127. umap/static/umap/locale/ro.js +447 -0
  128. umap/static/umap/locale/ro.json +445 -0
  129. umap/static/umap/locale/ru.js +447 -0
  130. umap/static/umap/locale/ru.json +445 -0
  131. umap/static/umap/locale/si.js +439 -0
  132. umap/static/umap/locale/si.json +437 -0
  133. umap/static/umap/locale/sk_SK.js +447 -0
  134. umap/static/umap/locale/sk_SK.json +445 -0
  135. umap/static/umap/locale/sl.js +447 -0
  136. umap/static/umap/locale/sl.json +445 -0
  137. umap/static/umap/locale/sr.js +447 -0
  138. umap/static/umap/locale/sr.json +445 -0
  139. umap/static/umap/locale/sv.js +447 -0
  140. umap/static/umap/locale/sv.json +445 -0
  141. umap/static/umap/locale/th_TH.js +447 -0
  142. umap/static/umap/locale/th_TH.json +445 -0
  143. umap/static/umap/locale/tr.js +447 -0
  144. umap/static/umap/locale/tr.json +445 -0
  145. umap/static/umap/locale/uk_UA.js +447 -0
  146. umap/static/umap/locale/uk_UA.json +445 -0
  147. umap/static/umap/locale/vi.js +447 -0
  148. umap/static/umap/locale/vi.json +445 -0
  149. umap/static/umap/locale/vi_VN.json +445 -0
  150. umap/static/umap/locale/zh.js +447 -0
  151. umap/static/umap/locale/zh.json +445 -0
  152. umap/static/umap/locale/zh_CN.json +445 -0
  153. umap/static/umap/locale/zh_TW.Big5.json +445 -0
  154. umap/static/umap/locale/zh_TW.js +447 -0
  155. umap/static/umap/locale/zh_TW.json +445 -0
  156. umap/static/umap/map.css +1843 -0
  157. umap/static/umap/nav.css +81 -0
  158. umap/static/umap/openstreetmap.png +0 -0
  159. umap/static/umap/test/.eslintrc +22 -0
  160. umap/static/umap/test/Choropleth.js +243 -0
  161. umap/static/umap/test/Controls.js +100 -0
  162. umap/static/umap/test/DataLayer.js +495 -0
  163. umap/static/umap/test/Feature.js +382 -0
  164. umap/static/umap/test/Map.Export.js +106 -0
  165. umap/static/umap/test/Map.Init.js +46 -0
  166. umap/static/umap/test/Map.js +342 -0
  167. umap/static/umap/test/Marker.js +122 -0
  168. umap/static/umap/test/Permissions.js +74 -0
  169. umap/static/umap/test/Polygon.js +367 -0
  170. umap/static/umap/test/Polyline.js +402 -0
  171. umap/static/umap/test/TableEditor.js +100 -0
  172. umap/static/umap/test/URLs.js +54 -0
  173. umap/static/umap/test/Util.js +549 -0
  174. umap/static/umap/test/_pre.js +460 -0
  175. umap/static/umap/test/index.html +135 -0
  176. umap/static/umap/theme.css +1 -0
  177. umap/static/umap/twitter.png +0 -0
  178. {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/METADATA +1 -1
  179. {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/RECORD +182 -6
  180. {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/WHEEL +0 -0
  181. {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/entry_points.txt +0 -0
  182. {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,148 @@
1
+ L.U.Browser = L.Class.extend({
2
+ options: {
3
+ filter: '',
4
+ inBbox: false,
5
+ },
6
+
7
+ initialize: function (map) {
8
+ this.map = map
9
+ },
10
+
11
+ addFeature: function (feature) {
12
+ const feature_li = L.DomUtil.create('li', `${feature.getClassName()} feature`),
13
+ zoom_to = L.DomUtil.create('i', 'feature-zoom_to', feature_li),
14
+ edit = L.DomUtil.create('i', 'show-on-edit feature-edit', feature_li),
15
+ del = L.DomUtil.create('i', 'show-on-edit feature-delete', feature_li),
16
+ colorBox = L.DomUtil.create('i', 'feature-color', feature_li),
17
+ title = L.DomUtil.create('span', 'feature-title', feature_li),
18
+ symbol = feature._getIconUrl
19
+ ? L.U.Icon.prototype.formatUrl(feature._getIconUrl(), feature)
20
+ : null
21
+ zoom_to.title = L._('Bring feature to center')
22
+ edit.title = L._('Edit this feature')
23
+ del.title = L._('Delete this feature')
24
+ title.textContent = feature.getDisplayName() || '—'
25
+ const bgcolor = feature.getOption('color')
26
+ colorBox.style.backgroundColor = bgcolor
27
+ if (symbol && symbol !== this.map.options.default_iconUrl) {
28
+ const icon = L.U.Icon.makeIconElement(symbol, colorBox)
29
+ L.U.Icon.setIconContrast(icon, colorBox, symbol, bgcolor)
30
+ }
31
+ L.DomEvent.on(
32
+ zoom_to,
33
+ 'click',
34
+ function (e) {
35
+ e.callback = L.bind(this.view, this)
36
+ this.zoomTo(e)
37
+ },
38
+ feature
39
+ )
40
+ L.DomEvent.on(
41
+ title,
42
+ 'click',
43
+ function (e) {
44
+ e.callback = L.bind(this.view, this)
45
+ this.zoomTo(e)
46
+ },
47
+ feature
48
+ )
49
+ L.DomEvent.on(edit, 'click', feature.edit, feature)
50
+ L.DomEvent.on(del, 'click', feature.confirmDelete, feature)
51
+ return feature_li
52
+ },
53
+
54
+ addDatalayer: function (datalayer, dataContainer) {
55
+ const filterKeys = this.map.getFilterKeys()
56
+ const container = L.DomUtil.create(
57
+ 'div',
58
+ datalayer.getHidableClass(),
59
+ dataContainer
60
+ ),
61
+ headline = L.DomUtil.create('h5', '', container)
62
+ container.id = `browse_data_datalayer_${datalayer.umap_id}`
63
+ datalayer.renderToolbox(headline)
64
+ L.DomUtil.add('span', '', headline, datalayer.options.name)
65
+ const counter = L.DomUtil.add('span', 'datalayer-counter', headline, datalayer.count())
66
+ counter.title = L._('{count} features in this layer', {count: datalayer.count()})
67
+ const ul = L.DomUtil.create('ul', '', container)
68
+ L.DomUtil.classIf(container, 'off', !datalayer.isVisible())
69
+
70
+ const build = () => {
71
+ ul.innerHTML = ''
72
+ const bounds = this.map.getBounds()
73
+ datalayer.eachFeature((feature) => {
74
+ if (
75
+ this.options.filter &&
76
+ !feature.matchFilter(this.options.filter, filterKeys)
77
+ )
78
+ return
79
+ if (this.options.inBbox && !feature.isOnScreen(bounds)) return
80
+ ul.appendChild(this.addFeature(feature))
81
+ })
82
+ }
83
+
84
+ build()
85
+ datalayer.on('datachanged', build)
86
+ datalayer.map.ui.once('panel:closed', () => {
87
+ datalayer.off('datachanged', build)
88
+ this.map.off('moveend', build)
89
+ })
90
+ datalayer.map.ui.once('panel:ready', () => {
91
+ datalayer.map.ui.once('panel:ready', () => {
92
+ datalayer.off('datachanged', build)
93
+ })
94
+ })
95
+ },
96
+
97
+ open: function () {
98
+ const container = L.DomUtil.create('div', 'umap-browse-data')
99
+ // HOTFIX. Remove when this is merged and released:
100
+ // https://github.com/Leaflet/Leaflet/pull/9052
101
+ L.DomEvent.disableClickPropagation(container)
102
+
103
+ const title = L.DomUtil.add(
104
+ 'h3',
105
+ 'umap-browse-title',
106
+ container,
107
+ this.map.options.name
108
+ )
109
+
110
+ const formContainer = L.DomUtil.create('div', '', container)
111
+ const dataContainer = L.DomUtil.create('div', 'umap-browse-features', container)
112
+
113
+ const appendAll = () => {
114
+ dataContainer.innerHTML = ''
115
+ this.map.eachBrowsableDataLayer((datalayer) => {
116
+ this.addDatalayer(datalayer, dataContainer)
117
+ })
118
+ }
119
+ const resetLayers = () => {
120
+ this.map.eachBrowsableDataLayer((datalayer) => {
121
+ datalayer.resetLayer(true)
122
+ })
123
+ }
124
+ const fields = [
125
+ ['options.filter', { handler: 'Input', placeholder: L._('Filter') }],
126
+ ['options.inBbox', { handler: 'Switch', label: L._('Current map view') }],
127
+ ]
128
+ const builder = new L.U.FormBuilder(this, fields, {
129
+ makeDirty: false,
130
+ callback: (e) => {
131
+ if (e.helper.field === 'options.inBbox') {
132
+ if (this.options.inBbox) this.map.on('moveend', appendAll)
133
+ else this.map.off('moveend', appendAll)
134
+ }
135
+ appendAll()
136
+ resetLayers()
137
+ },
138
+ })
139
+ formContainer.appendChild(builder.build())
140
+
141
+ appendAll()
142
+
143
+ this.map.ui.openPanel({
144
+ data: { html: container },
145
+ actions: [this.map._aboutLink()],
146
+ })
147
+ },
148
+ })