umap-project 2.1.2__py3-none-any.whl → 2.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/context_processors.py +1 -0
- umap/locale/br/LC_MESSAGES/django.mo +0 -0
- umap/locale/en/LC_MESSAGES/django.po +32 -32
- umap/locale/hu/LC_MESSAGES/django.mo +0 -0
- umap/locale/it/LC_MESSAGES/django.mo +0 -0
- umap/locale/ms/LC_MESSAGES/django.mo +0 -0
- umap/migrations/0020_alter_tilelayer_url_template.py +19 -0
- umap/migrations/0021_remove_map_description.py +16 -0
- umap/models.py +10 -6
- umap/settings/base.py +1 -0
- umap/static/umap/base.css +43 -156
- umap/static/umap/content.css +7 -25
- umap/static/umap/css/icon.css +112 -0
- umap/static/umap/css/panel.css +140 -0
- umap/static/umap/img/16-white.svg +5 -1
- umap/static/umap/img/16.svg +7 -4
- umap/static/umap/img/24-white.svg +3 -1
- umap/static/umap/img/24.svg +3 -4
- umap/static/umap/img/source/16-white.svg +176 -940
- umap/static/umap/img/source/16.svg +8 -5
- umap/static/umap/img/source/24-white.svg +5 -3
- umap/static/umap/img/source/24.svg +6 -7
- umap/static/umap/js/modules/browser.js +97 -73
- umap/static/umap/js/modules/dompurify.js +12 -0
- umap/static/umap/js/modules/facets.js +149 -0
- umap/static/umap/js/modules/global.js +9 -1
- umap/static/umap/js/modules/i18n.js +7 -0
- umap/static/umap/js/modules/orderable.js +84 -0
- umap/static/umap/js/modules/panel.js +76 -0
- umap/static/umap/js/modules/request.js +0 -1
- umap/static/umap/js/modules/schema.js +324 -223
- umap/static/umap/js/modules/urls.js +1 -16
- umap/static/umap/js/modules/utils.js +340 -0
- umap/static/umap/js/umap.autocomplete.js +40 -25
- umap/static/umap/js/umap.controls.js +248 -361
- umap/static/umap/js/umap.core.js +77 -366
- umap/static/umap/js/umap.datalayer.permissions.js +1 -1
- umap/static/umap/js/umap.features.js +65 -43
- umap/static/umap/js/umap.forms.js +128 -36
- umap/static/umap/js/umap.icon.js +11 -4
- umap/static/umap/js/umap.importer.js +78 -58
- umap/static/umap/js/umap.js +206 -192
- umap/static/umap/js/umap.layer.js +86 -46
- umap/static/umap/js/umap.permissions.js +13 -9
- umap/static/umap/js/umap.popup.js +26 -30
- umap/static/umap/js/umap.share.js +12 -9
- umap/static/umap/js/umap.tableeditor.js +4 -6
- umap/static/umap/js/umap.ui.js +10 -60
- umap/static/umap/locale/am_ET.js +243 -227
- umap/static/umap/locale/am_ET.json +21 -9
- umap/static/umap/locale/ar.js +243 -227
- umap/static/umap/locale/ar.json +21 -9
- umap/static/umap/locale/ast.js +243 -227
- umap/static/umap/locale/ast.json +21 -9
- umap/static/umap/locale/bg.js +243 -227
- umap/static/umap/locale/bg.json +21 -9
- umap/static/umap/locale/br.js +253 -237
- umap/static/umap/locale/br.json +25 -13
- umap/static/umap/locale/ca.js +243 -227
- umap/static/umap/locale/ca.json +21 -9
- umap/static/umap/locale/cs_CZ.js +243 -227
- umap/static/umap/locale/cs_CZ.json +21 -9
- umap/static/umap/locale/da.js +243 -227
- umap/static/umap/locale/da.json +21 -9
- umap/static/umap/locale/de.js +243 -227
- umap/static/umap/locale/de.json +21 -9
- umap/static/umap/locale/el.js +243 -227
- umap/static/umap/locale/el.json +21 -9
- umap/static/umap/locale/en.js +243 -234
- umap/static/umap/locale/en.json +22 -10
- umap/static/umap/locale/en_US.json +21 -9
- umap/static/umap/locale/es.js +243 -227
- umap/static/umap/locale/es.json +21 -9
- umap/static/umap/locale/et.js +243 -227
- umap/static/umap/locale/et.json +21 -9
- umap/static/umap/locale/eu.js +227 -199
- umap/static/umap/locale/eu.json +1 -1
- umap/static/umap/locale/fa_IR.js +243 -227
- umap/static/umap/locale/fa_IR.json +21 -9
- umap/static/umap/locale/fi.js +243 -227
- umap/static/umap/locale/fi.json +21 -9
- umap/static/umap/locale/fr.js +243 -234
- umap/static/umap/locale/fr.json +21 -9
- umap/static/umap/locale/gl.js +243 -227
- umap/static/umap/locale/gl.json +21 -9
- umap/static/umap/locale/he.js +243 -227
- umap/static/umap/locale/he.json +21 -9
- umap/static/umap/locale/hr.js +243 -227
- umap/static/umap/locale/hr.json +21 -9
- umap/static/umap/locale/hu.js +243 -234
- umap/static/umap/locale/hu.json +21 -9
- umap/static/umap/locale/id.js +243 -227
- umap/static/umap/locale/id.json +21 -9
- umap/static/umap/locale/is.js +243 -227
- umap/static/umap/locale/is.json +21 -9
- umap/static/umap/locale/it.js +243 -234
- umap/static/umap/locale/it.json +21 -9
- umap/static/umap/locale/ja.js +243 -227
- umap/static/umap/locale/ja.json +21 -9
- umap/static/umap/locale/ko.js +243 -227
- umap/static/umap/locale/ko.json +21 -9
- umap/static/umap/locale/lt.js +243 -227
- umap/static/umap/locale/lt.json +21 -9
- umap/static/umap/locale/ms.js +243 -234
- umap/static/umap/locale/ms.json +22 -10
- umap/static/umap/locale/nl.js +246 -230
- umap/static/umap/locale/nl.json +21 -9
- umap/static/umap/locale/no.js +243 -227
- umap/static/umap/locale/no.json +21 -9
- umap/static/umap/locale/pl.js +243 -227
- umap/static/umap/locale/pl.json +21 -9
- umap/static/umap/locale/pl_PL.json +21 -9
- umap/static/umap/locale/pt.js +243 -227
- umap/static/umap/locale/pt.json +21 -9
- umap/static/umap/locale/pt_BR.js +243 -227
- umap/static/umap/locale/pt_BR.json +21 -9
- umap/static/umap/locale/pt_PT.js +243 -227
- umap/static/umap/locale/pt_PT.json +21 -9
- umap/static/umap/locale/ro.js +243 -227
- umap/static/umap/locale/ro.json +21 -9
- umap/static/umap/locale/ru.js +243 -227
- umap/static/umap/locale/ru.json +21 -9
- umap/static/umap/locale/si.js +1 -1
- umap/static/umap/locale/si.json +1 -1
- umap/static/umap/locale/sk_SK.js +243 -227
- umap/static/umap/locale/sk_SK.json +21 -9
- umap/static/umap/locale/sl.js +243 -227
- umap/static/umap/locale/sl.json +21 -9
- umap/static/umap/locale/sr.js +243 -227
- umap/static/umap/locale/sr.json +21 -9
- umap/static/umap/locale/sv.js +243 -227
- umap/static/umap/locale/sv.json +21 -9
- umap/static/umap/locale/th_TH.js +243 -227
- umap/static/umap/locale/th_TH.json +21 -9
- umap/static/umap/locale/tr.js +243 -227
- umap/static/umap/locale/tr.json +21 -9
- umap/static/umap/locale/uk_UA.js +243 -227
- umap/static/umap/locale/uk_UA.json +21 -9
- umap/static/umap/locale/vi.js +243 -227
- umap/static/umap/locale/vi.json +21 -9
- umap/static/umap/locale/vi_VN.json +21 -9
- umap/static/umap/locale/zh.js +243 -227
- umap/static/umap/locale/zh.json +21 -9
- umap/static/umap/locale/zh_CN.json +21 -9
- umap/static/umap/locale/zh_TW.Big5.json +21 -9
- umap/static/umap/locale/zh_TW.js +243 -234
- umap/static/umap/locale/zh_TW.json +21 -9
- umap/static/umap/map.css +124 -264
- umap/static/umap/test/DataLayer.js +1 -1
- umap/static/umap/test/Feature.js +0 -226
- umap/static/umap/test/Map.js +0 -304
- umap/static/umap/test/Polygon.js +0 -256
- umap/static/umap/test/Polyline.js +0 -116
- umap/static/umap/test/TableEditor.js +10 -10
- umap/static/umap/test/Util.js +0 -521
- umap/static/umap/test/index.html +1 -5
- umap/static/umap/unittests/URLs.js +1 -1
- umap/static/umap/unittests/utils.js +610 -0
- umap/static/umap/vars.css +9 -0
- umap/static/umap/vendors/dompurify/purify.es.mjs +1525 -0
- umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +1 -0
- umap/static/umap/vendors/iconlayers/iconLayers.js +1 -1
- umap/templates/umap/css.html +2 -0
- umap/templates/umap/js.html +0 -1
- umap/templates/umap/map_detail.html +4 -0
- umap/templates/umap/map_table.html +12 -10
- umap/templatetags/umap_tags.py +5 -0
- umap/tests/conftest.py +9 -0
- umap/tests/fixtures/test_upload_data.csv +2 -1
- umap/tests/fixtures/test_upload_data.umap +171 -0
- umap/tests/fixtures/test_upload_data_osm.json +33 -0
- umap/tests/integration/conftest.py +16 -0
- umap/tests/integration/test_anonymous_owned_map.py +30 -5
- umap/tests/integration/test_basics.py +21 -0
- umap/tests/integration/test_browser.py +16 -36
- umap/tests/integration/test_choropleth.py +89 -0
- umap/tests/integration/test_collaborative_editing.py +30 -1
- umap/tests/integration/test_dashboard.py +10 -0
- umap/tests/integration/test_datalayer.py +132 -0
- umap/tests/integration/test_draw_polygon.py +363 -0
- umap/tests/integration/test_draw_polyline.py +325 -0
- umap/tests/integration/test_edit_datalayer.py +145 -6
- umap/tests/integration/test_edit_map.py +202 -0
- umap/tests/integration/test_edit_marker.py +120 -0
- umap/tests/integration/test_edit_polygon.py +122 -0
- umap/tests/integration/test_facets_browser.py +132 -11
- umap/tests/integration/test_import.py +407 -10
- umap/tests/integration/test_map.py +36 -54
- umap/tests/integration/test_map_list.py +28 -0
- umap/tests/integration/test_owned_map.py +24 -6
- umap/tests/integration/test_picto.py +25 -38
- umap/tests/integration/test_querystring.py +9 -15
- umap/tests/integration/test_slideshow.py +0 -5
- umap/tests/integration/test_statics.py +3 -2
- umap/tests/integration/test_tableeditor.py +23 -0
- umap/tests/integration/test_tilelayer.py +10 -0
- umap/tests/integration/test_view_marker.py +64 -0
- umap/tests/integration/test_view_polygon.py +59 -0
- umap/tests/integration/test_view_polyline.py +51 -0
- umap/tests/test_map_views.py +13 -0
- {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/METADATA +12 -12
- {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/RECORD +206 -187
- {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/WHEEL +1 -1
- umap/static/umap/test/Choropleth.js +0 -245
- umap/static/umap/test/Permissions.js +0 -74
- umap/static/umap/vendors/dompurify/purify.min.js +0 -3
- umap/static/umap/vendors/dompurify/purify.min.js.map +0 -1
- umap/tests/integration/test_drawing.py +0 -243
- {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/entry_points.txt +0 -0
- {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,26 +7,32 @@ U.Importer = L.Class.extend({
|
|
|
7
7
|
|
|
8
8
|
build: function () {
|
|
9
9
|
this.container = L.DomUtil.create('div', 'umap-upload')
|
|
10
|
-
this.title = L.DomUtil.
|
|
10
|
+
this.title = L.DomUtil.createTitle(
|
|
11
|
+
this.container,
|
|
12
|
+
L._('Import data'),
|
|
13
|
+
'icon-upload'
|
|
14
|
+
)
|
|
11
15
|
this.presetBox = L.DomUtil.create('div', 'formbox', this.container)
|
|
12
16
|
this.presetSelect = L.DomUtil.create('select', '', this.presetBox)
|
|
13
17
|
this.fileBox = L.DomUtil.create('div', 'formbox', this.container)
|
|
14
|
-
this.fileInput = L.DomUtil.element(
|
|
15
|
-
'input',
|
|
16
|
-
|
|
17
|
-
this.fileBox
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
this.fileInput = L.DomUtil.element({
|
|
19
|
+
tagName: 'input',
|
|
20
|
+
type: 'file',
|
|
21
|
+
parent: this.fileBox,
|
|
22
|
+
multiple: 'multiple',
|
|
23
|
+
autofocus: true,
|
|
24
|
+
})
|
|
25
|
+
this.urlInput = L.DomUtil.element({
|
|
26
|
+
tagName: 'input',
|
|
27
|
+
type: 'text',
|
|
28
|
+
parent: this.container,
|
|
29
|
+
placeholder: L._('Provide an URL here'),
|
|
30
|
+
})
|
|
31
|
+
this.rawInput = L.DomUtil.element({
|
|
32
|
+
tagName: 'textarea',
|
|
33
|
+
parent: this.container,
|
|
34
|
+
placeholder: L._('Paste your data here'),
|
|
35
|
+
})
|
|
30
36
|
this.typeLabel = L.DomUtil.add(
|
|
31
37
|
'label',
|
|
32
38
|
'',
|
|
@@ -39,47 +45,43 @@ U.Importer = L.Class.extend({
|
|
|
39
45
|
this.container,
|
|
40
46
|
L._('Choose the layer to import in')
|
|
41
47
|
)
|
|
42
|
-
this.clearLabel = L.DomUtil.
|
|
43
|
-
'label',
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
)
|
|
48
|
-
this.submitInput = L.DomUtil.element(
|
|
49
|
-
'input',
|
|
50
|
-
|
|
51
|
-
this.container
|
|
52
|
-
|
|
48
|
+
this.clearLabel = L.DomUtil.element({
|
|
49
|
+
tagName: 'label',
|
|
50
|
+
parent: this.container,
|
|
51
|
+
textContent: L._('Replace layer content'),
|
|
52
|
+
for: 'datalayer-clear-check',
|
|
53
|
+
})
|
|
54
|
+
this.submitInput = L.DomUtil.element({
|
|
55
|
+
tagName: 'input',
|
|
56
|
+
type: 'button',
|
|
57
|
+
parent: this.container,
|
|
58
|
+
value: L._('Import'),
|
|
59
|
+
className: 'button',
|
|
60
|
+
})
|
|
53
61
|
this.map.help.button(this.typeLabel, 'importFormats')
|
|
54
|
-
this.typeInput = L.DomUtil.element(
|
|
55
|
-
|
|
56
|
-
'
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
'
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
this.typeInput = L.DomUtil.element({
|
|
63
|
+
tagName: 'select',
|
|
64
|
+
name: 'format',
|
|
65
|
+
parent: this.typeLabel,
|
|
66
|
+
})
|
|
67
|
+
this.layerInput = L.DomUtil.element({
|
|
68
|
+
tagName: 'select',
|
|
69
|
+
name: 'datalayer',
|
|
70
|
+
parent: this.layerLabel,
|
|
71
|
+
})
|
|
72
|
+
this.clearFlag = L.DomUtil.element({
|
|
73
|
+
tagName: 'input',
|
|
74
|
+
type: 'checkbox',
|
|
75
|
+
name: 'clear',
|
|
76
|
+
id: 'datalayer-clear-check',
|
|
77
|
+
parent: this.clearLabel,
|
|
78
|
+
})
|
|
79
|
+
L.DomUtil.element({
|
|
80
|
+
tagName: 'option',
|
|
81
|
+
value: '',
|
|
82
|
+
textContent: L._('Choose the data format'),
|
|
83
|
+
parent: this.typeInput,
|
|
72
84
|
})
|
|
73
|
-
L.DomUtil.element(
|
|
74
|
-
'option',
|
|
75
|
-
{ value: '', textContent: L._('Import in a new layer') },
|
|
76
|
-
this.layerInput
|
|
77
|
-
)
|
|
78
|
-
L.DomUtil.element(
|
|
79
|
-
'option',
|
|
80
|
-
{ value: '', textContent: L._('Choose the data format') },
|
|
81
|
-
this.typeInput
|
|
82
|
-
)
|
|
83
85
|
for (let i = 0; i < this.TYPES.length; i++) {
|
|
84
86
|
option = L.DomUtil.create('option', '', this.typeInput)
|
|
85
87
|
option.value = option.textContent = this.TYPES[i]
|
|
@@ -103,7 +105,7 @@ U.Importer = L.Class.extend({
|
|
|
103
105
|
let type = '',
|
|
104
106
|
newType
|
|
105
107
|
for (let i = 0; i < e.target.files.length; i++) {
|
|
106
|
-
newType =
|
|
108
|
+
newType = U.Utils.detectFileType(e.target.files[i])
|
|
107
109
|
if (!type && newType) type = newType
|
|
108
110
|
if (type && newType !== type) {
|
|
109
111
|
type = ''
|
|
@@ -118,7 +120,25 @@ U.Importer = L.Class.extend({
|
|
|
118
120
|
|
|
119
121
|
open: function () {
|
|
120
122
|
if (!this.container) this.build()
|
|
121
|
-
this.map.
|
|
123
|
+
const onLoad = this.map.editPanel.open({ content: this.container })
|
|
124
|
+
onLoad.then(() => {
|
|
125
|
+
this.fileInput.value = null
|
|
126
|
+
this.layerInput.innerHTML = ''
|
|
127
|
+
let option
|
|
128
|
+
this.map.eachDataLayerReverse((datalayer) => {
|
|
129
|
+
if (datalayer.isLoaded() && !datalayer.isRemoteLayer()) {
|
|
130
|
+
const id = L.stamp(datalayer)
|
|
131
|
+
option = L.DomUtil.add('option', '', this.layerInput, datalayer.options.name)
|
|
132
|
+
option.value = id
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
L.DomUtil.element({
|
|
136
|
+
tagName: 'option',
|
|
137
|
+
value: '',
|
|
138
|
+
textContent: L._('Import in a new layer'),
|
|
139
|
+
parent: this.layerInput,
|
|
140
|
+
})
|
|
141
|
+
})
|
|
122
142
|
},
|
|
123
143
|
|
|
124
144
|
openFiles: function () {
|