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.
- umap/__init__.py +1 -1
- umap/static/.gitignore +0 -0
- umap/static/umap/base.css +994 -0
- umap/static/umap/bitbucket.png +0 -0
- umap/static/umap/content.css +395 -0
- umap/static/umap/favicons/apple-touch-icon.png +0 -0
- umap/static/umap/favicons/favicon.ico +0 -0
- umap/static/umap/favicons/icon-192.png +0 -0
- umap/static/umap/favicons/icon-512.png +0 -0
- umap/static/umap/favicons/icon.svg +5 -0
- umap/static/umap/font/FiraSans-Light.woff +0 -0
- umap/static/umap/font/FiraSans-Light.woff2 +0 -0
- umap/static/umap/font/FiraSans-LightItalic.woff +0 -0
- umap/static/umap/font/FiraSans-LightItalic.woff2 +0 -0
- umap/static/umap/font/FiraSans-SemiBold.woff +0 -0
- umap/static/umap/font/FiraSans-SemiBold.woff2 +0 -0
- umap/static/umap/font.css +33 -0
- umap/static/umap/github.png +0 -0
- umap/static/umap/img/16-white.svg +190 -0
- umap/static/umap/img/16.svg +182 -0
- umap/static/umap/img/24-white.svg +62 -0
- umap/static/umap/img/24.svg +90 -0
- umap/static/umap/img/edit.svg +7 -0
- umap/static/umap/img/icon-bg.png +0 -0
- umap/static/umap/img/logo.svg +4 -0
- umap/static/umap/img/logo_filigree.png +0 -0
- umap/static/umap/img/logo_small.svg +14 -0
- umap/static/umap/img/marker.png +0 -0
- umap/static/umap/img/opensource.svg +7 -0
- umap/static/umap/img/osm.svg +7 -0
- umap/static/umap/img/search.gif +0 -0
- umap/static/umap/img/source/16-white.svg +980 -0
- umap/static/umap/img/source/16.svg +201 -0
- umap/static/umap/img/source/24-white.svg +83 -0
- umap/static/umap/img/source/24.svg +110 -0
- umap/static/umap/js/components/fragment.js +13 -0
- umap/static/umap/js/modules/global.js +8 -0
- umap/static/umap/js/modules/urls.js +29 -0
- umap/static/umap/js/umap.autocomplete.js +336 -0
- umap/static/umap/js/umap.browser.js +148 -0
- umap/static/umap/js/umap.controls.js +1542 -0
- umap/static/umap/js/umap.core.js +851 -0
- umap/static/umap/js/umap.datalayer.permissions.js +72 -0
- umap/static/umap/js/umap.features.js +1216 -0
- umap/static/umap/js/umap.forms.js +1267 -0
- umap/static/umap/js/umap.icon.js +234 -0
- umap/static/umap/js/umap.importer.js +166 -0
- umap/static/umap/js/umap.js +2010 -0
- umap/static/umap/js/umap.layer.js +1636 -0
- umap/static/umap/js/umap.permissions.js +212 -0
- umap/static/umap/js/umap.popup.js +340 -0
- umap/static/umap/js/umap.share.js +254 -0
- umap/static/umap/js/umap.slideshow.js +165 -0
- umap/static/umap/js/umap.tableeditor.js +120 -0
- umap/static/umap/js/umap.ui.js +240 -0
- umap/static/umap/js/umap.xhr.js +304 -0
- umap/static/umap/locale/am_ET.js +447 -0
- umap/static/umap/locale/am_ET.json +445 -0
- umap/static/umap/locale/ar.js +447 -0
- umap/static/umap/locale/ar.json +445 -0
- umap/static/umap/locale/ast.js +447 -0
- umap/static/umap/locale/ast.json +445 -0
- umap/static/umap/locale/bg.js +447 -0
- umap/static/umap/locale/bg.json +445 -0
- umap/static/umap/locale/br.js +447 -0
- umap/static/umap/locale/br.json +445 -0
- umap/static/umap/locale/ca.js +447 -0
- umap/static/umap/locale/ca.json +445 -0
- umap/static/umap/locale/cs_CZ.js +447 -0
- umap/static/umap/locale/cs_CZ.json +445 -0
- umap/static/umap/locale/da.js +447 -0
- umap/static/umap/locale/da.json +445 -0
- umap/static/umap/locale/de.js +447 -0
- umap/static/umap/locale/de.json +445 -0
- umap/static/umap/locale/el.js +447 -0
- umap/static/umap/locale/el.json +445 -0
- umap/static/umap/locale/en.js +447 -0
- umap/static/umap/locale/en.json +445 -0
- umap/static/umap/locale/en_US.json +445 -0
- umap/static/umap/locale/es.js +447 -0
- umap/static/umap/locale/es.json +445 -0
- umap/static/umap/locale/et.js +447 -0
- umap/static/umap/locale/et.json +445 -0
- umap/static/umap/locale/eu.js +413 -0
- umap/static/umap/locale/eu.json +411 -0
- umap/static/umap/locale/fa_IR.js +447 -0
- umap/static/umap/locale/fa_IR.json +445 -0
- umap/static/umap/locale/fi.js +447 -0
- umap/static/umap/locale/fi.json +445 -0
- umap/static/umap/locale/fr.js +447 -0
- umap/static/umap/locale/fr.json +445 -0
- umap/static/umap/locale/gl.js +447 -0
- umap/static/umap/locale/gl.json +445 -0
- umap/static/umap/locale/he.js +447 -0
- umap/static/umap/locale/he.json +445 -0
- umap/static/umap/locale/hr.js +447 -0
- umap/static/umap/locale/hr.json +445 -0
- umap/static/umap/locale/hu.js +447 -0
- umap/static/umap/locale/hu.json +445 -0
- umap/static/umap/locale/id.js +447 -0
- umap/static/umap/locale/id.json +445 -0
- umap/static/umap/locale/is.js +447 -0
- umap/static/umap/locale/is.json +445 -0
- umap/static/umap/locale/it.js +447 -0
- umap/static/umap/locale/it.json +445 -0
- umap/static/umap/locale/ja.js +447 -0
- umap/static/umap/locale/ja.json +445 -0
- umap/static/umap/locale/ko.js +447 -0
- umap/static/umap/locale/ko.json +445 -0
- umap/static/umap/locale/lt.js +447 -0
- umap/static/umap/locale/lt.json +445 -0
- umap/static/umap/locale/ms.js +447 -0
- umap/static/umap/locale/ms.json +445 -0
- umap/static/umap/locale/nl.js +447 -0
- umap/static/umap/locale/nl.json +445 -0
- umap/static/umap/locale/no.js +447 -0
- umap/static/umap/locale/no.json +445 -0
- umap/static/umap/locale/pl.js +447 -0
- umap/static/umap/locale/pl.json +445 -0
- umap/static/umap/locale/pl_PL.json +445 -0
- umap/static/umap/locale/pt.js +447 -0
- umap/static/umap/locale/pt.json +445 -0
- umap/static/umap/locale/pt_BR.js +447 -0
- umap/static/umap/locale/pt_BR.json +445 -0
- umap/static/umap/locale/pt_PT.js +447 -0
- umap/static/umap/locale/pt_PT.json +445 -0
- umap/static/umap/locale/ro.js +447 -0
- umap/static/umap/locale/ro.json +445 -0
- umap/static/umap/locale/ru.js +447 -0
- umap/static/umap/locale/ru.json +445 -0
- umap/static/umap/locale/si.js +439 -0
- umap/static/umap/locale/si.json +437 -0
- umap/static/umap/locale/sk_SK.js +447 -0
- umap/static/umap/locale/sk_SK.json +445 -0
- umap/static/umap/locale/sl.js +447 -0
- umap/static/umap/locale/sl.json +445 -0
- umap/static/umap/locale/sr.js +447 -0
- umap/static/umap/locale/sr.json +445 -0
- umap/static/umap/locale/sv.js +447 -0
- umap/static/umap/locale/sv.json +445 -0
- umap/static/umap/locale/th_TH.js +447 -0
- umap/static/umap/locale/th_TH.json +445 -0
- umap/static/umap/locale/tr.js +447 -0
- umap/static/umap/locale/tr.json +445 -0
- umap/static/umap/locale/uk_UA.js +447 -0
- umap/static/umap/locale/uk_UA.json +445 -0
- umap/static/umap/locale/vi.js +447 -0
- umap/static/umap/locale/vi.json +445 -0
- umap/static/umap/locale/vi_VN.json +445 -0
- umap/static/umap/locale/zh.js +447 -0
- umap/static/umap/locale/zh.json +445 -0
- umap/static/umap/locale/zh_CN.json +445 -0
- umap/static/umap/locale/zh_TW.Big5.json +445 -0
- umap/static/umap/locale/zh_TW.js +447 -0
- umap/static/umap/locale/zh_TW.json +445 -0
- umap/static/umap/map.css +1843 -0
- umap/static/umap/nav.css +81 -0
- umap/static/umap/openstreetmap.png +0 -0
- umap/static/umap/test/.eslintrc +22 -0
- umap/static/umap/test/Choropleth.js +243 -0
- umap/static/umap/test/Controls.js +100 -0
- umap/static/umap/test/DataLayer.js +495 -0
- umap/static/umap/test/Feature.js +382 -0
- umap/static/umap/test/Map.Export.js +106 -0
- umap/static/umap/test/Map.Init.js +46 -0
- umap/static/umap/test/Map.js +342 -0
- umap/static/umap/test/Marker.js +122 -0
- umap/static/umap/test/Permissions.js +74 -0
- umap/static/umap/test/Polygon.js +367 -0
- umap/static/umap/test/Polyline.js +402 -0
- umap/static/umap/test/TableEditor.js +100 -0
- umap/static/umap/test/URLs.js +54 -0
- umap/static/umap/test/Util.js +549 -0
- umap/static/umap/test/_pre.js +460 -0
- umap/static/umap/test/index.html +135 -0
- umap/static/umap/theme.css +1 -0
- umap/static/umap/twitter.png +0 -0
- {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/METADATA +1 -1
- {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/RECORD +182 -6
- {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/WHEEL +0 -0
- {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/entry_points.txt +0 -0
- {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
|
+
})
|