umap-project 3.1.2__py3-none-any.whl → 3.2.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.
Potentially problematic release.
This version of umap-project might be problematic. Click here for more details.
- umap/__init__.py +1 -1
- umap/locale/en/LC_MESSAGES/django.po +21 -17
- umap/locale/fr/LC_MESSAGES/django.mo +0 -0
- umap/locale/fr/LC_MESSAGES/django.po +21 -17
- umap/management/commands/export_pictogram.py +29 -0
- umap/management/commands/migrate_to_S3.py +5 -1
- umap/management/commands/purge_old_versions.py +8 -6
- umap/settings/__init__.py +21 -0
- umap/settings/base.py +1 -0
- umap/static/umap/content.css +7 -2
- umap/static/umap/css/icon.css +77 -3
- umap/static/umap/css/panel.css +31 -1
- umap/static/umap/js/modules/browser.js +1 -1
- umap/static/umap/js/modules/data/features.js +14 -29
- umap/static/umap/js/modules/data/layer.js +248 -136
- umap/static/umap/js/modules/facets.js +2 -2
- umap/static/umap/js/modules/form/fields.js +56 -19
- umap/static/umap/js/modules/formatter.js +36 -8
- umap/static/umap/js/modules/importers/opendata.js +23 -6
- umap/static/umap/js/modules/managers.js +59 -0
- umap/static/umap/js/modules/rendering/icon.js +3 -5
- umap/static/umap/js/modules/rendering/layers/classified.js +8 -7
- umap/static/umap/js/modules/rendering/map.js +1 -1
- umap/static/umap/js/modules/rendering/ui.js +13 -0
- umap/static/umap/js/modules/rules.js +76 -23
- umap/static/umap/js/modules/schema.js +3 -0
- umap/static/umap/js/modules/slideshow.js +1 -1
- umap/static/umap/js/modules/sync/updaters.js +1 -6
- umap/static/umap/js/modules/tableeditor.js +13 -37
- umap/static/umap/js/modules/templates.js +7 -6
- umap/static/umap/js/modules/ui/panel.js +7 -0
- umap/static/umap/js/modules/umap.js +17 -6
- umap/static/umap/js/modules/utils.js +8 -7
- umap/static/umap/locale/am_ET.js +43 -6
- umap/static/umap/locale/am_ET.json +43 -6
- umap/static/umap/locale/ar.js +43 -6
- umap/static/umap/locale/ar.json +43 -6
- umap/static/umap/locale/ast.js +43 -6
- umap/static/umap/locale/ast.json +43 -6
- umap/static/umap/locale/bg.js +43 -6
- umap/static/umap/locale/bg.json +43 -6
- umap/static/umap/locale/br.js +30 -26
- umap/static/umap/locale/br.json +30 -26
- umap/static/umap/locale/ca.js +50 -13
- umap/static/umap/locale/ca.json +50 -13
- umap/static/umap/locale/cs_CZ.js +43 -6
- umap/static/umap/locale/cs_CZ.json +43 -6
- umap/static/umap/locale/da.js +10 -6
- umap/static/umap/locale/da.json +10 -6
- umap/static/umap/locale/de.js +10 -6
- umap/static/umap/locale/de.json +10 -6
- umap/static/umap/locale/el.js +20 -10
- umap/static/umap/locale/el.json +20 -10
- umap/static/umap/locale/en.js +10 -6
- umap/static/umap/locale/en.json +10 -6
- umap/static/umap/locale/en_US.json +43 -6
- umap/static/umap/locale/es.js +10 -6
- umap/static/umap/locale/es.json +10 -6
- umap/static/umap/locale/et.js +43 -6
- umap/static/umap/locale/et.json +43 -6
- umap/static/umap/locale/eu.js +43 -6
- umap/static/umap/locale/eu.json +43 -6
- umap/static/umap/locale/fa_IR.js +43 -6
- umap/static/umap/locale/fa_IR.json +43 -6
- umap/static/umap/locale/fi.js +43 -6
- umap/static/umap/locale/fi.json +43 -6
- umap/static/umap/locale/fr.js +10 -6
- umap/static/umap/locale/fr.json +10 -6
- umap/static/umap/locale/gl.js +43 -6
- umap/static/umap/locale/gl.json +43 -6
- umap/static/umap/locale/he.js +43 -6
- umap/static/umap/locale/he.json +43 -6
- umap/static/umap/locale/hr.js +43 -6
- umap/static/umap/locale/hr.json +43 -6
- umap/static/umap/locale/hu.js +34 -24
- umap/static/umap/locale/hu.json +34 -24
- umap/static/umap/locale/id.js +43 -6
- umap/static/umap/locale/id.json +43 -6
- umap/static/umap/locale/is.js +43 -6
- umap/static/umap/locale/is.json +43 -6
- umap/static/umap/locale/it.js +10 -6
- umap/static/umap/locale/it.json +10 -6
- umap/static/umap/locale/ja.js +43 -6
- umap/static/umap/locale/ja.json +43 -6
- umap/static/umap/locale/ko.js +43 -6
- umap/static/umap/locale/ko.json +43 -6
- umap/static/umap/locale/lt.js +43 -6
- umap/static/umap/locale/lt.json +43 -6
- umap/static/umap/locale/ms.js +43 -6
- umap/static/umap/locale/ms.json +43 -6
- umap/static/umap/locale/nl.js +10 -6
- umap/static/umap/locale/nl.json +10 -6
- umap/static/umap/locale/no.js +43 -6
- umap/static/umap/locale/no.json +43 -6
- umap/static/umap/locale/pl.js +43 -6
- umap/static/umap/locale/pl.json +43 -6
- umap/static/umap/locale/pl_PL.json +43 -6
- umap/static/umap/locale/pt.js +43 -6
- umap/static/umap/locale/pt.json +43 -6
- umap/static/umap/locale/pt_BR.js +53 -16
- umap/static/umap/locale/pt_BR.json +53 -16
- umap/static/umap/locale/pt_PT.js +43 -6
- umap/static/umap/locale/pt_PT.json +43 -6
- umap/static/umap/locale/ro.js +43 -6
- umap/static/umap/locale/ro.json +43 -6
- umap/static/umap/locale/ru.js +43 -6
- umap/static/umap/locale/ru.json +43 -6
- umap/static/umap/locale/sk_SK.js +43 -6
- umap/static/umap/locale/sk_SK.json +43 -6
- umap/static/umap/locale/sl.js +43 -6
- umap/static/umap/locale/sl.json +43 -6
- umap/static/umap/locale/sr.js +43 -6
- umap/static/umap/locale/sr.json +43 -6
- umap/static/umap/locale/sv.js +43 -6
- umap/static/umap/locale/sv.json +43 -6
- umap/static/umap/locale/th_TH.js +43 -6
- umap/static/umap/locale/th_TH.json +43 -6
- umap/static/umap/locale/tr.js +43 -6
- umap/static/umap/locale/tr.json +43 -6
- umap/static/umap/locale/uk_UA.js +43 -6
- umap/static/umap/locale/uk_UA.json +43 -6
- umap/static/umap/locale/vi.js +43 -6
- umap/static/umap/locale/vi.json +43 -6
- umap/static/umap/locale/vi_VN.json +43 -6
- umap/static/umap/locale/zh.js +43 -6
- umap/static/umap/locale/zh.json +43 -6
- umap/static/umap/locale/zh_CN.json +43 -6
- umap/static/umap/locale/zh_TW.Big5.json +43 -6
- umap/static/umap/locale/zh_TW.js +43 -6
- umap/static/umap/locale/zh_TW.json +43 -6
- umap/static/umap/map.css +239 -65
- umap/static/umap/vendors/betterknown/betterknown.mjs +287 -0
- umap/storage/fs.py +3 -2
- umap/templates/base.html +4 -1
- umap/tests/base.py +9 -1
- umap/tests/integration/test_basics.py +1 -1
- umap/tests/integration/test_conditional_rules.py +62 -20
- umap/tests/integration/test_edit_datalayer.py +1 -1
- umap/tests/integration/test_edit_marker.py +1 -1
- umap/tests/integration/test_export_map.py +10 -0
- umap/tests/integration/test_import.py +140 -0
- umap/tests/integration/test_optimistic_merge.py +72 -12
- umap/tests/integration/test_tableeditor.py +6 -3
- umap/utils.py +33 -0
- umap/views.py +16 -2
- umap_project-3.2.0.dist-info/METADATA +76 -0
- {umap_project-3.1.2.dist-info → umap_project-3.2.0.dist-info}/RECORD +150 -148
- umap_project-3.1.2.dist-info/METADATA +0 -68
- {umap_project-3.1.2.dist-info → umap_project-3.2.0.dist-info}/WHEEL +0 -0
- {umap_project-3.1.2.dist-info → umap_project-3.2.0.dist-info}/entry_points.txt +0 -0
- {umap_project-3.1.2.dist-info → umap_project-3.2.0.dist-info}/licenses/LICENSE +0 -0
umap/static/umap/css/panel.css
CHANGED
|
@@ -15,14 +15,17 @@
|
|
|
15
15
|
box-sizing: border-box;
|
|
16
16
|
counter-reset: step;
|
|
17
17
|
}
|
|
18
|
+
|
|
18
19
|
.panel.dark {
|
|
19
20
|
border: 1px solid #222;
|
|
20
21
|
}
|
|
22
|
+
|
|
21
23
|
.panel.full {
|
|
22
24
|
width: initial;
|
|
23
25
|
right: -100%;
|
|
24
26
|
z-index: calc(var(--zindex-panels) + 1);
|
|
25
27
|
}
|
|
28
|
+
|
|
26
29
|
.panel.full.on {
|
|
27
30
|
visibility: visible;
|
|
28
31
|
right: calc(var(--panel-gutter) * 2 + var(--control-size));
|
|
@@ -30,29 +33,45 @@
|
|
|
30
33
|
height: initial;
|
|
31
34
|
max-height: initial;
|
|
32
35
|
}
|
|
36
|
+
|
|
33
37
|
.panel .umap-popup-content img {
|
|
34
38
|
/* See https://github.com/Leaflet/Leaflet/commit/61d746818b99d362108545c151a27f09d60960ee#commitcomment-6061847 */
|
|
35
39
|
max-width: 99% !important;
|
|
36
40
|
}
|
|
41
|
+
|
|
37
42
|
.panel .umap-popup-content {
|
|
38
43
|
max-height: inherit;
|
|
39
44
|
}
|
|
45
|
+
|
|
40
46
|
.panel .body {
|
|
41
|
-
|
|
47
|
+
/* Minus size of toolbox */
|
|
48
|
+
height: calc(100% - var(--panel-header-height));
|
|
42
49
|
padding: var(--panel-gutter);
|
|
43
50
|
}
|
|
51
|
+
|
|
44
52
|
.panel h3 {
|
|
45
53
|
display: flex;
|
|
46
54
|
align-items: center;
|
|
47
55
|
}
|
|
56
|
+
|
|
48
57
|
.panel .counter::before {
|
|
49
58
|
counter-increment: step;
|
|
50
59
|
content: counter(step) ". ";
|
|
51
60
|
}
|
|
61
|
+
|
|
52
62
|
.panel .counter {
|
|
53
63
|
display: block;
|
|
54
64
|
margin-top: var(--panel-gutter);
|
|
55
65
|
}
|
|
66
|
+
|
|
67
|
+
.panel.dark details[open] {
|
|
68
|
+
border-left: 2px solid var(--color-accent);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.panel.dark details[open] summary {
|
|
72
|
+
background-color: var(--color-veryDarkGray);
|
|
73
|
+
}
|
|
74
|
+
|
|
56
75
|
@media all and (orientation:landscape) {
|
|
57
76
|
.panel {
|
|
58
77
|
top: var(--current-header-height);
|
|
@@ -60,28 +79,35 @@
|
|
|
60
79
|
width: var(--panel-width);
|
|
61
80
|
max-width: calc(100% - var(--panel-gutter) * 2 - var(--control-size))
|
|
62
81
|
}
|
|
82
|
+
|
|
63
83
|
.panel.condensed {
|
|
64
84
|
max-height: calc(min(500px, 100% - var(--current-header-height) - var(--current-footer-height) - var(--panel-gutter) * 2));
|
|
65
85
|
bottom: initial;
|
|
66
86
|
}
|
|
87
|
+
|
|
67
88
|
.panel.right {
|
|
68
89
|
right: calc(0px - var(--panel-width));
|
|
69
90
|
}
|
|
91
|
+
|
|
70
92
|
.panel.left {
|
|
71
93
|
left: calc(0px - var(--panel-width));
|
|
72
94
|
}
|
|
95
|
+
|
|
73
96
|
.panel.left.on {
|
|
74
97
|
left: calc(var(--panel-gutter) * 2 + var(--control-size));
|
|
75
98
|
visibility: visible;
|
|
76
99
|
}
|
|
100
|
+
|
|
77
101
|
.panel.right.on {
|
|
78
102
|
right: calc(var(--panel-gutter) * 2 + var(--control-size));
|
|
79
103
|
visibility: visible;
|
|
80
104
|
}
|
|
105
|
+
|
|
81
106
|
.panel-left-on .panel.full {
|
|
82
107
|
left: calc(var(--panel-gutter) * 3 + var(--control-size) + var(--panel-width));
|
|
83
108
|
}
|
|
84
109
|
}
|
|
110
|
+
|
|
85
111
|
@media all and (orientation:portrait) {
|
|
86
112
|
.panel {
|
|
87
113
|
height: 50%;
|
|
@@ -90,18 +116,22 @@
|
|
|
90
116
|
bottom: var(--current-footer-height);
|
|
91
117
|
right: -100%;
|
|
92
118
|
}
|
|
119
|
+
|
|
93
120
|
.panel.left {
|
|
94
121
|
left: -100%;
|
|
95
122
|
}
|
|
123
|
+
|
|
96
124
|
.panel.on {
|
|
97
125
|
right: 0;
|
|
98
126
|
left: 0;
|
|
99
127
|
visibility: visible;
|
|
100
128
|
}
|
|
129
|
+
|
|
101
130
|
.panel.expanded {
|
|
102
131
|
height: calc(100% - var(--current-footer-height));
|
|
103
132
|
max-height: calc(100% - var(--current-footer-height));
|
|
104
133
|
}
|
|
134
|
+
|
|
105
135
|
.umap-caption-bar-enabled .panel {
|
|
106
136
|
border-bottom-left-radius: 0;
|
|
107
137
|
border-bottom-right-radius: 0;
|
|
@@ -90,7 +90,7 @@ export default class Browser {
|
|
|
90
90
|
const label = parent.querySelector('.datalayer-name')
|
|
91
91
|
const container = parent.querySelector('ul')
|
|
92
92
|
container.innerHTML = ''
|
|
93
|
-
datalayer.
|
|
93
|
+
datalayer.features.forEach((feature) => this.addFeature(feature, container))
|
|
94
94
|
datalayer.propagate(['properties.name'])
|
|
95
95
|
const total = datalayer.count()
|
|
96
96
|
if (!total) return
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
DomUtil,
|
|
4
4
|
GeoJSON,
|
|
5
5
|
LineUtil,
|
|
6
|
-
stamp,
|
|
7
6
|
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
|
8
7
|
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
|
9
8
|
import { MutatingForm } from '../form/builder.js'
|
|
@@ -84,6 +83,11 @@ class Feature {
|
|
|
84
83
|
this.pushGeometry()
|
|
85
84
|
}
|
|
86
85
|
|
|
86
|
+
get fields() {
|
|
87
|
+
// Fields are user defined properties
|
|
88
|
+
return [...this.datalayer.fields, ...this._umap.fields]
|
|
89
|
+
}
|
|
90
|
+
|
|
87
91
|
isOnScreen(bounds) {
|
|
88
92
|
return this.ui?.isOnScreen(bounds)
|
|
89
93
|
}
|
|
@@ -198,14 +202,13 @@ class Feature {
|
|
|
198
202
|
if (this._umap.currentFeature === this) {
|
|
199
203
|
this.view()
|
|
200
204
|
}
|
|
201
|
-
this.datalayer.indexProperties(this)
|
|
202
205
|
}
|
|
203
206
|
this.redraw()
|
|
204
207
|
}
|
|
205
208
|
|
|
206
209
|
edit(event) {
|
|
207
210
|
if (!this._umap.editEnabled || this.isReadOnly()) return
|
|
208
|
-
if (this._umap.editedFeature === this && !event
|
|
211
|
+
if (this._umap.editedFeature === this && !event?.force) return
|
|
209
212
|
const container = DomUtil.create('div', 'umap-feature-container')
|
|
210
213
|
DomUtil.createTitle(
|
|
211
214
|
container,
|
|
@@ -221,30 +224,20 @@ class Feature {
|
|
|
221
224
|
container.appendChild(builder.build())
|
|
222
225
|
|
|
223
226
|
const properties = []
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
if (
|
|
227
|
-
|
|
228
|
-
continue
|
|
227
|
+
for (const field of this.fields) {
|
|
228
|
+
let handler = 'Input'
|
|
229
|
+
if (field.key === 'description' || field.type === 'Text') {
|
|
230
|
+
handler = 'Textarea'
|
|
229
231
|
}
|
|
230
|
-
|
|
231
|
-
continue
|
|
232
|
-
}
|
|
233
|
-
properties.push([`properties.${property}`, { label: property }])
|
|
234
|
-
}
|
|
235
|
-
// We always want name and description for now (properties management to come)
|
|
236
|
-
properties.unshift('properties.description')
|
|
237
|
-
if (!labelKeyFound) {
|
|
238
|
-
labelKeyFound = U.DEFAULT_LABEL_KEY
|
|
232
|
+
properties.push([`properties.${field.key}`, { label: field.key, handler }])
|
|
239
233
|
}
|
|
240
|
-
properties.unshift([`properties.${labelKeyFound}`, { label: labelKeyFound }])
|
|
241
234
|
builder = new MutatingForm(this, properties, {
|
|
242
235
|
id: 'umap-feature-properties',
|
|
243
236
|
})
|
|
244
237
|
const form = builder.build()
|
|
245
238
|
container.appendChild(form)
|
|
246
239
|
const button = Utils.loadTemplate(
|
|
247
|
-
`<button type="button"><i class="icon icon-16 icon-add"></i>${translate('Add a new
|
|
240
|
+
`<button type="button"><i class="icon icon-16 icon-add"></i>${translate('Add a new field')}</button>`
|
|
248
241
|
)
|
|
249
242
|
button.addEventListener('click', () => {
|
|
250
243
|
this.datalayer.addProperty().then(() => this.edit({ force: true }))
|
|
@@ -258,7 +251,7 @@ class Feature {
|
|
|
258
251
|
this.getAdvancedEditActions(advancedActions)
|
|
259
252
|
const onLoad = this._umap.editPanel.open({ content: container })
|
|
260
253
|
onLoad.then(() => {
|
|
261
|
-
builder.
|
|
254
|
+
builder.form.querySelector('input')?.focus()
|
|
262
255
|
})
|
|
263
256
|
this._umap.editedFeature = this
|
|
264
257
|
if (!this.ui.isOnScreen(this._umap._leafletMap.getBounds())) this.zoomTo(event)
|
|
@@ -378,8 +371,6 @@ class Feature {
|
|
|
378
371
|
|
|
379
372
|
connectToDataLayer(datalayer) {
|
|
380
373
|
this.datalayer = datalayer
|
|
381
|
-
// FIXME should be in layer/ui
|
|
382
|
-
this.ui.options.renderer = this.datalayer.renderer
|
|
383
374
|
}
|
|
384
375
|
|
|
385
376
|
disconnectFromDataLayer(datalayer) {
|
|
@@ -607,7 +598,7 @@ class Feature {
|
|
|
607
598
|
}
|
|
608
599
|
|
|
609
600
|
getRank() {
|
|
610
|
-
return this.datalayer.
|
|
601
|
+
return this.datalayer.features.getIndex(this)
|
|
611
602
|
}
|
|
612
603
|
|
|
613
604
|
redraw() {
|
|
@@ -785,12 +776,6 @@ class Path extends Feature {
|
|
|
785
776
|
this.ui.setLatLngs(latlngs)
|
|
786
777
|
}
|
|
787
778
|
|
|
788
|
-
connectToDataLayer(datalayer) {
|
|
789
|
-
super.connectToDataLayer(datalayer)
|
|
790
|
-
// We keep markers on their own layer on top of the paths.
|
|
791
|
-
this.ui.options.pane = this.datalayer.pane
|
|
792
|
-
}
|
|
793
|
-
|
|
794
779
|
edit(event) {
|
|
795
780
|
if (this._umap.editEnabled) {
|
|
796
781
|
super.edit(event)
|