umap-project 2.9.3__py3-none-any.whl → 3.0.1__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/forms.py +1 -2
- umap/locale/de/LC_MESSAGES/django.mo +0 -0
- umap/locale/de/LC_MESSAGES/django.po +218 -96
- umap/locale/en/LC_MESSAGES/django.po +128 -52
- umap/locale/fr/LC_MESSAGES/django.mo +0 -0
- umap/locale/fr/LC_MESSAGES/django.po +128 -52
- umap/locale/hu/LC_MESSAGES/django.mo +0 -0
- umap/locale/hu/LC_MESSAGES/django.po +209 -88
- umap/locale/is/LC_MESSAGES/django.mo +0 -0
- umap/locale/is/LC_MESSAGES/django.po +296 -175
- umap/migrations/0027_map_tags.py +23 -0
- umap/models.py +13 -2
- umap/settings/base.py +23 -5
- umap/static/umap/base.css +41 -8
- umap/static/umap/content.css +72 -37
- umap/static/umap/css/bar.css +43 -21
- umap/static/umap/css/dialog.css +4 -1
- umap/static/umap/css/form.css +40 -27
- umap/static/umap/css/icon.css +11 -1
- umap/static/umap/css/importers.css +7 -0
- umap/static/umap/img/16-white.svg +23 -2
- umap/static/umap/img/16.svg +1 -1
- umap/static/umap/img/24.svg +4 -4
- umap/static/umap/img/home.svg +7 -0
- umap/static/umap/img/importers/banfr.svg +1 -0
- umap/static/umap/img/marker.svg +2 -5
- umap/static/umap/img/source/16-white.svg +24 -3
- umap/static/umap/img/source/16.svg +1 -1
- umap/static/umap/img/source/24.svg +5 -5
- umap/static/umap/img/target.svg +1 -0
- umap/static/umap/js/components/alerts/alert.js +0 -1
- umap/static/umap/js/modules/browser.js +4 -4
- umap/static/umap/js/modules/caption.js +1 -1
- umap/static/umap/js/modules/data/features.js +25 -25
- umap/static/umap/js/modules/data/layer.js +91 -97
- umap/static/umap/js/modules/facets.js +9 -5
- umap/static/umap/js/modules/form/builder.js +19 -27
- umap/static/umap/js/modules/form/fields.js +40 -14
- umap/static/umap/js/modules/formatter.js +1 -1
- umap/static/umap/js/modules/global.js +9 -5
- umap/static/umap/js/modules/help.js +18 -5
- umap/static/umap/js/modules/importer.js +5 -2
- umap/static/umap/js/modules/importers/banfr.js +93 -0
- umap/static/umap/js/modules/importers/cadastrefr.js +2 -2
- umap/static/umap/js/modules/importers/communesfr.js +1 -1
- umap/static/umap/js/modules/permissions.js +20 -10
- umap/static/umap/js/modules/rendering/icon.js +15 -2
- umap/static/umap/js/modules/rendering/layers/classified.js +7 -7
- umap/static/umap/js/modules/rendering/layers/cluster.js +2 -2
- umap/static/umap/js/modules/rendering/layers/heat.js +4 -4
- umap/static/umap/js/modules/rendering/map.js +14 -6
- umap/static/umap/js/modules/rendering/popup.js +2 -2
- umap/static/umap/js/modules/rendering/template.js +3 -3
- umap/static/umap/js/modules/rendering/ui.js +17 -11
- umap/static/umap/js/modules/rules.js +13 -16
- umap/static/umap/js/modules/schema.js +23 -1
- umap/static/umap/js/modules/share.js +1 -1
- umap/static/umap/js/modules/slideshow.js +1 -0
- umap/static/umap/js/modules/sync/engine.js +141 -19
- umap/static/umap/js/modules/sync/undo.js +101 -0
- umap/static/umap/js/modules/sync/updaters.js +51 -28
- umap/static/umap/js/modules/tableeditor.js +1 -1
- umap/static/umap/js/modules/ui/bar.js +61 -21
- umap/static/umap/js/modules/ui/tooltip.js +1 -1
- umap/static/umap/js/modules/umap.js +190 -176
- umap/static/umap/js/modules/utils.js +30 -4
- umap/static/umap/js/umap.controls.js +82 -38
- umap/static/umap/locale/am_ET.js +11 -6
- umap/static/umap/locale/am_ET.json +11 -6
- umap/static/umap/locale/ar.js +11 -6
- umap/static/umap/locale/ar.json +11 -6
- umap/static/umap/locale/ast.js +11 -6
- umap/static/umap/locale/ast.json +11 -6
- umap/static/umap/locale/bg.js +11 -6
- umap/static/umap/locale/bg.json +11 -6
- umap/static/umap/locale/br.js +12 -7
- umap/static/umap/locale/br.json +12 -7
- umap/static/umap/locale/ca.js +11 -6
- umap/static/umap/locale/ca.json +11 -6
- umap/static/umap/locale/cs_CZ.js +11 -6
- umap/static/umap/locale/cs_CZ.json +11 -6
- umap/static/umap/locale/da.js +11 -6
- umap/static/umap/locale/da.json +11 -6
- umap/static/umap/locale/de.js +47 -42
- umap/static/umap/locale/de.json +47 -42
- umap/static/umap/locale/el.js +11 -6
- umap/static/umap/locale/el.json +11 -6
- umap/static/umap/locale/en.js +11 -6
- umap/static/umap/locale/en.json +11 -6
- umap/static/umap/locale/en_US.json +11 -6
- umap/static/umap/locale/es.js +11 -6
- umap/static/umap/locale/es.json +11 -6
- umap/static/umap/locale/et.js +11 -6
- umap/static/umap/locale/et.json +11 -6
- umap/static/umap/locale/eu.js +11 -6
- umap/static/umap/locale/eu.json +11 -6
- umap/static/umap/locale/fa_IR.js +11 -6
- umap/static/umap/locale/fa_IR.json +11 -6
- umap/static/umap/locale/fi.js +11 -6
- umap/static/umap/locale/fi.json +11 -6
- umap/static/umap/locale/fr.js +11 -6
- umap/static/umap/locale/fr.json +11 -6
- umap/static/umap/locale/gl.js +12 -7
- umap/static/umap/locale/gl.json +12 -7
- umap/static/umap/locale/he.js +11 -6
- umap/static/umap/locale/he.json +11 -6
- umap/static/umap/locale/hr.js +11 -6
- umap/static/umap/locale/hr.json +11 -6
- umap/static/umap/locale/hu.js +25 -20
- umap/static/umap/locale/hu.json +25 -20
- umap/static/umap/locale/id.js +11 -6
- umap/static/umap/locale/id.json +11 -6
- umap/static/umap/locale/is.js +151 -146
- umap/static/umap/locale/is.json +151 -146
- umap/static/umap/locale/it.js +11 -6
- umap/static/umap/locale/it.json +11 -6
- umap/static/umap/locale/ja.js +11 -6
- umap/static/umap/locale/ja.json +11 -6
- umap/static/umap/locale/ko.js +11 -6
- umap/static/umap/locale/ko.json +11 -6
- umap/static/umap/locale/lt.js +11 -6
- umap/static/umap/locale/lt.json +11 -6
- umap/static/umap/locale/ms.js +11 -6
- umap/static/umap/locale/ms.json +11 -6
- umap/static/umap/locale/nl.js +12 -7
- umap/static/umap/locale/nl.json +12 -7
- umap/static/umap/locale/no.js +11 -6
- umap/static/umap/locale/no.json +11 -6
- umap/static/umap/locale/pl.js +11 -6
- umap/static/umap/locale/pl.json +11 -6
- umap/static/umap/locale/pl_PL.json +11 -6
- umap/static/umap/locale/pt.js +11 -6
- umap/static/umap/locale/pt.json +11 -6
- umap/static/umap/locale/pt_BR.js +11 -6
- umap/static/umap/locale/pt_BR.json +11 -6
- umap/static/umap/locale/pt_PT.js +11 -6
- umap/static/umap/locale/pt_PT.json +11 -6
- umap/static/umap/locale/ro.js +11 -6
- umap/static/umap/locale/ro.json +11 -6
- umap/static/umap/locale/ru.js +11 -6
- umap/static/umap/locale/ru.json +11 -6
- umap/static/umap/locale/sk_SK.js +11 -6
- umap/static/umap/locale/sk_SK.json +11 -6
- umap/static/umap/locale/sl.js +11 -6
- umap/static/umap/locale/sl.json +11 -6
- umap/static/umap/locale/sr.js +11 -6
- umap/static/umap/locale/sr.json +11 -6
- umap/static/umap/locale/sv.js +11 -6
- umap/static/umap/locale/sv.json +11 -6
- umap/static/umap/locale/th_TH.js +11 -6
- umap/static/umap/locale/th_TH.json +11 -6
- umap/static/umap/locale/tr.js +11 -6
- umap/static/umap/locale/tr.json +11 -6
- umap/static/umap/locale/uk_UA.js +11 -6
- umap/static/umap/locale/uk_UA.json +11 -6
- umap/static/umap/locale/vi.js +11 -6
- umap/static/umap/locale/vi.json +11 -6
- umap/static/umap/locale/vi_VN.json +11 -6
- umap/static/umap/locale/zh.js +11 -6
- umap/static/umap/locale/zh.json +11 -6
- umap/static/umap/locale/zh_CN.json +11 -6
- umap/static/umap/locale/zh_TW.Big5.json +11 -6
- umap/static/umap/locale/zh_TW.js +19 -14
- umap/static/umap/locale/zh_TW.json +19 -14
- umap/static/umap/map.css +58 -28
- umap/static/umap/unittests/sync.js +0 -57
- umap/static/umap/unittests/utils.js +47 -0
- umap/static/umap/vars.css +5 -2
- umap/static/umap/vendors/photon/leaflet.photon.js +3 -0
- umap/sync/payloads.py +3 -2
- umap/templates/auth/user_detail.html +1 -1
- umap/templates/auth/user_stars.html +1 -1
- umap/templates/umap/content.html +17 -12
- umap/templates/umap/home.html +7 -5
- umap/templates/umap/map_fragment.html +1 -1
- umap/templates/umap/map_list.html +20 -13
- umap/templates/umap/search.html +7 -3
- umap/templates/umap/search_bar.html +13 -11
- umap/templates/umap/team_detail.html +1 -1
- umap/tests/base.py +2 -1
- umap/tests/fixtures/remote_data.umap +55 -0
- umap/tests/fixtures/test_upload_data_with_iconurl.umap +122 -0
- umap/tests/integration/test_browser.py +1 -3
- umap/tests/integration/test_conditional_rules.py +3 -0
- umap/tests/integration/test_edit_datalayer.py +2 -7
- umap/tests/integration/test_edit_map.py +15 -0
- umap/tests/integration/test_edit_polygon.py +1 -2
- umap/tests/integration/test_import.py +59 -2
- umap/tests/integration/test_optimistic_merge.py +4 -3
- umap/tests/integration/test_owned_map.py +0 -1
- umap/tests/integration/test_save.py +2 -4
- umap/tests/integration/test_undo_redo.py +267 -0
- umap/tests/integration/test_websocket_sync.py +78 -11
- umap/tests/settings.py +1 -3
- umap/tests/test_datalayer_s3.py +1 -0
- umap/tests/test_map_views.py +1 -0
- umap/tests/test_views.py +34 -0
- umap/utils.py +1 -1
- umap/views.py +23 -2
- {umap_project-2.9.3.dist-info → umap_project-3.0.1.dist-info}/METADATA +13 -12
- {umap_project-2.9.3.dist-info → umap_project-3.0.1.dist-info}/RECORD +206 -208
- umap/static/umap/js/modules/saving.js +0 -52
- umap/static/umap/test/.eslintrc +0 -21
- umap/static/umap/test/DataLayer.js +0 -463
- umap/static/umap/test/Feature.js +0 -131
- umap/static/umap/test/Map.js +0 -37
- umap/static/umap/test/Marker.js +0 -126
- umap/static/umap/test/Polygon.js +0 -111
- umap/static/umap/test/Polyline.js +0 -286
- umap/static/umap/test/Util.js +0 -28
- umap/static/umap/test/_pre.js +0 -455
- umap/static/umap/test/index.html +0 -139
- {umap_project-2.9.3.dist-info → umap_project-3.0.1.dist-info}/WHEEL +0 -0
- {umap_project-2.9.3.dist-info → umap_project-3.0.1.dist-info}/entry_points.txt +0 -0
- {umap_project-2.9.3.dist-info → umap_project-3.0.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
|
2
|
+
import { LineString, Point, Polygon } from '../data/features.js'
|
|
2
3
|
import { translate } from '../i18n.js'
|
|
3
4
|
import { WithTemplate } from '../utils.js'
|
|
4
|
-
import ContextMenu from './contextmenu.js'
|
|
5
5
|
import * as Utils from '../utils.js'
|
|
6
|
-
import
|
|
6
|
+
import ContextMenu from './contextmenu.js'
|
|
7
7
|
|
|
8
8
|
const TOP_BAR_TEMPLATE = `
|
|
9
9
|
<div class="umap-main-edit-toolbox with-transition dark">
|
|
10
10
|
<div class="umap-left-edit-toolbox" data-ref="left">
|
|
11
11
|
<div class="logo"><a class="" href="/" title="${translate('Go to the homepage')}">uMap</a></div>
|
|
12
|
-
<button class="map-name flat" type="button" data-ref="name"></button>
|
|
13
|
-
<button class="share-status flat" type="button" data-ref="share"></button>
|
|
12
|
+
<button class="map-name flat truncate" type="button" data-ref="name"></button>
|
|
13
|
+
<button class="share-status flat truncate" type="button" data-ref="share"></button>
|
|
14
|
+
<button class="edit-undo round flat" type="button" data-ref="undo" disabled>
|
|
15
|
+
<i class="icon icon-16 icon-undo"></i>
|
|
16
|
+
</button>
|
|
17
|
+
<button class="edit-redo round flat" type="button" data-ref="redo" disabled>
|
|
18
|
+
<i class="icon icon-16 icon-redo"></i>
|
|
19
|
+
</button>
|
|
14
20
|
</div>
|
|
15
21
|
<div class="umap-right-edit-toolbox" data-ref="right">
|
|
16
22
|
<button class="connected-peers round" type="button" data-ref="peers">
|
|
@@ -19,18 +25,14 @@ const TOP_BAR_TEMPLATE = `
|
|
|
19
25
|
</button>
|
|
20
26
|
<button class="umap-user flat" type="button" data-ref="user">
|
|
21
27
|
<i class="icon icon-16 icon-profile"></i>
|
|
22
|
-
<span class="username" data-ref="username"></span>
|
|
28
|
+
<span class="username truncate" data-ref="username"></span>
|
|
23
29
|
</button>
|
|
24
30
|
<button class="umap-help-link flat" type="button" title="${translate('Help')}" data-ref="help">${translate('Help')}</button>
|
|
25
|
-
<button class="edit-
|
|
26
|
-
<i class="icon icon-16 icon-restore"></i>
|
|
27
|
-
<span class="">${translate('Cancel edits')}</span>
|
|
28
|
-
</button>
|
|
29
|
-
<button class="edit-disable round" type="button" data-ref="view">
|
|
31
|
+
<button class="edit-disable round disabled-on-dirty" type="button" data-ref="view">
|
|
30
32
|
<i class="icon icon-16 icon-eye"></i>
|
|
31
|
-
<span
|
|
33
|
+
<span>${translate('View')}</span>
|
|
32
34
|
</button>
|
|
33
|
-
<button class="edit-save button round" type="button" data-ref="save">
|
|
35
|
+
<button class="edit-save button round enabled-on-dirty" type="button" data-ref="save">
|
|
34
36
|
<i class="icon icon-16 icon-save"></i>
|
|
35
37
|
<i class="icon icon-16 icon-save-disabled"></i>
|
|
36
38
|
<span hidden data-ref="saveLabel">${translate('Save')}</span>
|
|
@@ -118,11 +120,21 @@ export class TopBar extends WithTemplate {
|
|
|
118
120
|
})
|
|
119
121
|
|
|
120
122
|
this.elements.help.addEventListener('click', () => this._umap.help.showGetStarted())
|
|
121
|
-
this.elements.
|
|
122
|
-
this.elements.
|
|
123
|
+
this.elements.redo.addEventListener('click', () => this._umap.redo())
|
|
124
|
+
this.elements.undo.addEventListener('click', () => this._umap.undo())
|
|
125
|
+
this.elements.undo.addEventListener('mouseover', () => {
|
|
126
|
+
this._umap.tooltip.open({
|
|
127
|
+
content: this._umap.help.displayLabel('UNDO'),
|
|
128
|
+
anchor: this.elements.undo,
|
|
129
|
+
position: 'bottom',
|
|
130
|
+
delay: 500,
|
|
131
|
+
duration: 5000,
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
this.elements.redo.addEventListener('mouseover', () => {
|
|
123
135
|
this._umap.tooltip.open({
|
|
124
|
-
content: this._umap.help.displayLabel('
|
|
125
|
-
anchor: this.elements.
|
|
136
|
+
content: this._umap.help.displayLabel('REDO'),
|
|
137
|
+
anchor: this.elements.redo,
|
|
126
138
|
position: 'bottom',
|
|
127
139
|
delay: 500,
|
|
128
140
|
duration: 5000,
|
|
@@ -154,9 +166,10 @@ export class TopBar extends WithTemplate {
|
|
|
154
166
|
redraw() {
|
|
155
167
|
const syncEnabled = this._umap.getProperty('syncEnabled')
|
|
156
168
|
this.elements.peers.hidden = !syncEnabled
|
|
157
|
-
this.elements.
|
|
169
|
+
this.elements.view.disabled = this._umap.sync._undoManager.isDirty()
|
|
158
170
|
this.elements.saveLabel.hidden = this._umap.permissions.isDraft()
|
|
159
171
|
this.elements.saveDraftLabel.hidden = !this._umap.permissions.isDraft()
|
|
172
|
+
this._umap.sync._undoManager.toggleState()
|
|
160
173
|
}
|
|
161
174
|
}
|
|
162
175
|
|
|
@@ -167,6 +180,7 @@ const BOTTOM_BAR_TEMPLATE = `
|
|
|
167
180
|
<button class="umap-about-link flat" type="button" title="${translate('Open caption')}" data-ref="caption">${translate('Open caption')}</button>
|
|
168
181
|
<button class="umap-open-browser-link flat" type="button" title="${translate('Browse data')}" data-ref="browse">${translate('Browse data')}</button>
|
|
169
182
|
<button class="umap-open-browser-link flat" type="button" title="${translate('Filter data')}" data-ref="filter">${translate('Filter data')}</button>
|
|
183
|
+
<select data-ref=layers></select>
|
|
170
184
|
</div>
|
|
171
185
|
`
|
|
172
186
|
|
|
@@ -189,6 +203,14 @@ export class BottomBar extends WithTemplate {
|
|
|
189
203
|
this._umap.openBrowser('filters')
|
|
190
204
|
)
|
|
191
205
|
this._slideshow.renderToolbox(this.element)
|
|
206
|
+
this.elements.layers.addEventListener('change', () => {
|
|
207
|
+
const select = this.elements.layers
|
|
208
|
+
const selected = select.options[select.selectedIndex].value
|
|
209
|
+
if (!selected) return
|
|
210
|
+
this._umap.eachDataLayer((datalayer) => {
|
|
211
|
+
datalayer.toggle(datalayer.id === selected)
|
|
212
|
+
})
|
|
213
|
+
})
|
|
192
214
|
this.redraw()
|
|
193
215
|
}
|
|
194
216
|
|
|
@@ -201,6 +223,27 @@ export class BottomBar extends WithTemplate {
|
|
|
201
223
|
this.elements.caption.hidden = !showMenus
|
|
202
224
|
this.elements.browse.hidden = !showMenus
|
|
203
225
|
this.elements.filter.hidden = !showMenus || !this._umap.properties.facetKey
|
|
226
|
+
this.buildDataLayerSwitcher()
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
buildDataLayerSwitcher() {
|
|
230
|
+
this.elements.layers.innerHTML = ''
|
|
231
|
+
const datalayers = this._umap.datalayersIndex.filter((d) => d.options.inCaption)
|
|
232
|
+
if (datalayers.length < 2) {
|
|
233
|
+
this.elements.layers.hidden = true
|
|
234
|
+
} else {
|
|
235
|
+
this.elements.layers.appendChild(Utils.loadTemplate(`<option value=""></option>`))
|
|
236
|
+
this.elements.layers.hidden = false
|
|
237
|
+
const visible = datalayers.filter((datalayer) => datalayer.isVisible())
|
|
238
|
+
for (const datalayer of datalayers) {
|
|
239
|
+
const selected = visible.length === 1 && datalayer.isVisible() ? 'selected' : ''
|
|
240
|
+
this.elements.layers.appendChild(
|
|
241
|
+
Utils.loadTemplate(
|
|
242
|
+
`<option value="${datalayer.id}" ${selected}>${datalayer.getName()}</option>`
|
|
243
|
+
)
|
|
244
|
+
)
|
|
245
|
+
}
|
|
246
|
+
}
|
|
204
247
|
}
|
|
205
248
|
}
|
|
206
249
|
|
|
@@ -240,10 +283,7 @@ export class EditBar extends WithTemplate {
|
|
|
240
283
|
DomEvent.disableClickPropagation(this.element)
|
|
241
284
|
this._onClick('marker', () => this._leafletMap.editTools.startMarker())
|
|
242
285
|
this._onClick('polyline', () => this._leafletMap.editTools.startPolyline())
|
|
243
|
-
this._onClick('multiline', () =>
|
|
244
|
-
console.log('click click')
|
|
245
|
-
this._umap.editedFeature.ui.editor.newShape()
|
|
246
|
-
})
|
|
286
|
+
this._onClick('multiline', () => this._umap.editedFeature.ui.editor.newShape())
|
|
247
287
|
this._onClick('polygon', () => this._leafletMap.editTools.startPolygon())
|
|
248
288
|
this._onClick('multipolygon', () => this._umap.editedFeature.ui.editor.newShape())
|
|
249
289
|
this._onClick('caption', () => this._umap.editCaption())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
|
2
2
|
import { translate } from '../i18n.js'
|
|
3
|
-
import { Positioned } from './base.js'
|
|
4
3
|
import * as Utils from '../utils.js'
|
|
4
|
+
import { Positioned } from './base.js'
|
|
5
5
|
|
|
6
6
|
export default class Tooltip extends Positioned {
|
|
7
7
|
constructor(parent) {
|