umap-project 1.14.0a5__py3-none-any.whl → 2.0.0a0__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/decorators.py +0 -14
- umap/locale/br/LC_MESSAGES/django.mo +0 -0
- umap/locale/br/LC_MESSAGES/django.po +137 -85
- umap/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
- umap/locale/cs_CZ/LC_MESSAGES/django.po +136 -84
- umap/locale/el/LC_MESSAGES/django.mo +0 -0
- umap/locale/el/LC_MESSAGES/django.po +136 -84
- umap/locale/en/LC_MESSAGES/django.po +128 -88
- umap/locale/es/LC_MESSAGES/django.mo +0 -0
- umap/locale/es/LC_MESSAGES/django.po +136 -84
- umap/locale/fr/LC_MESSAGES/django.mo +0 -0
- umap/locale/fr/LC_MESSAGES/django.po +131 -91
- umap/locale/hu/LC_MESSAGES/django.mo +0 -0
- umap/locale/hu/LC_MESSAGES/django.po +137 -85
- umap/locale/it/LC_MESSAGES/django.mo +0 -0
- umap/locale/it/LC_MESSAGES/django.po +136 -84
- umap/locale/ms/LC_MESSAGES/django.mo +0 -0
- umap/locale/ms/LC_MESSAGES/django.po +136 -84
- umap/locale/pl/LC_MESSAGES/django.mo +0 -0
- umap/locale/pl/LC_MESSAGES/django.po +136 -84
- umap/locale/sv/LC_MESSAGES/django.mo +0 -0
- umap/locale/sv/LC_MESSAGES/django.po +135 -83
- umap/locale/zh_TW/LC_MESSAGES/django.mo +0 -0
- umap/locale/zh_TW/LC_MESSAGES/django.po +143 -91
- umap/models.py +23 -1
- umap/settings/__init__.py +1 -4
- umap/settings/base.py +1 -0
- umap/static/umap/base.css +5 -0
- umap/static/umap/content.css +185 -13
- umap/static/umap/favicons/icon.svg +2 -2
- umap/static/umap/img/edit.svg +3 -3
- umap/static/umap/img/icon-delete.svg +4 -0
- umap/static/umap/img/icon-download.svg +13 -0
- umap/static/umap/img/icon-duplicate.svg +5 -0
- umap/static/umap/img/icon-edit.svg +12 -0
- umap/static/umap/img/icon-share.svg +11 -0
- umap/static/umap/img/icon-view.svg +12 -0
- umap/static/umap/img/logo.svg +2 -2
- umap/static/umap/img/logo_small.svg +2 -2
- umap/static/umap/img/marker.svg +4 -0
- umap/static/umap/img/opensource.svg +2 -2
- umap/static/umap/img/osm.svg +2 -2
- umap/static/umap/js/components/fragment.js +1 -1
- umap/static/umap/js/modules/browser.js +159 -0
- umap/static/umap/js/modules/global.js +3 -1
- umap/static/umap/js/modules/request.js +155 -0
- umap/static/umap/js/umap.autocomplete.js +28 -38
- umap/static/umap/js/umap.controls.js +73 -58
- umap/static/umap/js/umap.core.js +4 -9
- umap/static/umap/js/umap.datalayer.permissions.js +13 -12
- umap/static/umap/js/umap.features.js +51 -49
- umap/static/umap/js/umap.forms.js +19 -19
- umap/static/umap/js/umap.icon.js +17 -17
- umap/static/umap/js/umap.importer.js +2 -1
- umap/static/umap/js/umap.js +242 -291
- umap/static/umap/js/umap.layer.js +173 -141
- umap/static/umap/js/umap.permissions.js +24 -25
- umap/static/umap/js/umap.popup.js +14 -14
- umap/static/umap/js/umap.share.js +4 -4
- umap/static/umap/js/umap.slideshow.js +4 -4
- umap/static/umap/js/umap.tableeditor.js +2 -2
- umap/static/umap/js/umap.ui.js +1 -1
- umap/static/umap/locale/am_ET.js +1 -11
- umap/static/umap/locale/am_ET.json +1 -11
- umap/static/umap/locale/ar.js +1 -11
- umap/static/umap/locale/ar.json +1 -11
- umap/static/umap/locale/ast.js +1 -11
- umap/static/umap/locale/ast.json +1 -11
- umap/static/umap/locale/bg.js +1 -11
- umap/static/umap/locale/bg.json +1 -11
- umap/static/umap/locale/br.js +1 -11
- umap/static/umap/locale/br.json +1 -11
- umap/static/umap/locale/ca.js +1 -11
- umap/static/umap/locale/ca.json +1 -11
- umap/static/umap/locale/cs_CZ.js +1 -11
- umap/static/umap/locale/cs_CZ.json +1 -11
- umap/static/umap/locale/da.js +1 -11
- umap/static/umap/locale/da.json +1 -11
- umap/static/umap/locale/de.js +1 -11
- umap/static/umap/locale/de.json +1 -11
- umap/static/umap/locale/el.js +1 -11
- umap/static/umap/locale/el.json +1 -11
- umap/static/umap/locale/en.js +1 -11
- umap/static/umap/locale/en.json +1 -11
- umap/static/umap/locale/en_US.json +1 -11
- umap/static/umap/locale/es.js +1 -11
- umap/static/umap/locale/es.json +1 -11
- umap/static/umap/locale/et.js +1 -11
- umap/static/umap/locale/et.json +1 -11
- umap/static/umap/locale/fa_IR.js +6 -16
- umap/static/umap/locale/fa_IR.json +6 -16
- umap/static/umap/locale/fi.js +1 -11
- umap/static/umap/locale/fi.json +1 -11
- umap/static/umap/locale/fr.js +1 -11
- umap/static/umap/locale/fr.json +1 -11
- umap/static/umap/locale/gl.js +1 -11
- umap/static/umap/locale/gl.json +1 -11
- umap/static/umap/locale/he.js +1 -11
- umap/static/umap/locale/he.json +1 -11
- umap/static/umap/locale/hr.js +1 -11
- umap/static/umap/locale/hr.json +1 -11
- umap/static/umap/locale/hu.js +1 -11
- umap/static/umap/locale/hu.json +1 -11
- umap/static/umap/locale/id.js +1 -11
- umap/static/umap/locale/id.json +1 -11
- umap/static/umap/locale/is.js +1 -11
- umap/static/umap/locale/is.json +1 -11
- umap/static/umap/locale/it.js +1 -11
- umap/static/umap/locale/it.json +1 -11
- umap/static/umap/locale/ja.js +1 -11
- umap/static/umap/locale/ja.json +1 -11
- umap/static/umap/locale/ko.js +1 -11
- umap/static/umap/locale/ko.json +1 -11
- umap/static/umap/locale/lt.js +1 -11
- umap/static/umap/locale/lt.json +1 -11
- umap/static/umap/locale/ms.js +1 -11
- umap/static/umap/locale/ms.json +1 -11
- umap/static/umap/locale/nl.js +1 -11
- umap/static/umap/locale/nl.json +1 -11
- umap/static/umap/locale/no.js +1 -11
- umap/static/umap/locale/no.json +1 -11
- umap/static/umap/locale/pl.js +1 -11
- umap/static/umap/locale/pl.json +1 -11
- umap/static/umap/locale/pl_PL.json +1 -11
- umap/static/umap/locale/pt.js +1 -11
- umap/static/umap/locale/pt.json +1 -11
- umap/static/umap/locale/pt_BR.js +1 -11
- umap/static/umap/locale/pt_BR.json +1 -11
- umap/static/umap/locale/pt_PT.js +1 -11
- umap/static/umap/locale/pt_PT.json +1 -11
- umap/static/umap/locale/ro.js +1 -11
- umap/static/umap/locale/ro.json +1 -11
- umap/static/umap/locale/ru.js +1 -11
- umap/static/umap/locale/ru.json +1 -11
- umap/static/umap/locale/sk_SK.js +1 -11
- umap/static/umap/locale/sk_SK.json +1 -11
- umap/static/umap/locale/sl.js +1 -11
- umap/static/umap/locale/sl.json +1 -11
- umap/static/umap/locale/sr.js +1 -11
- umap/static/umap/locale/sr.json +1 -11
- umap/static/umap/locale/sv.js +1 -11
- umap/static/umap/locale/sv.json +1 -11
- umap/static/umap/locale/th_TH.js +1 -11
- umap/static/umap/locale/th_TH.json +1 -11
- umap/static/umap/locale/tr.js +1 -11
- umap/static/umap/locale/tr.json +1 -11
- umap/static/umap/locale/uk_UA.js +1 -11
- umap/static/umap/locale/uk_UA.json +1 -11
- umap/static/umap/locale/vi.js +1 -11
- umap/static/umap/locale/vi.json +1 -11
- umap/static/umap/locale/vi_VN.json +1 -11
- umap/static/umap/locale/zh.js +1 -11
- umap/static/umap/locale/zh.json +1 -11
- umap/static/umap/locale/zh_CN.json +1 -11
- umap/static/umap/locale/zh_TW.Big5.json +1 -11
- umap/static/umap/locale/zh_TW.js +17 -27
- umap/static/umap/locale/zh_TW.json +17 -27
- umap/static/umap/map.css +2 -2
- umap/static/umap/nav.css +2 -1
- umap/static/umap/test/.eslintrc +0 -1
- umap/static/umap/test/Choropleth.js +29 -27
- umap/static/umap/test/DataLayer.js +207 -239
- umap/static/umap/test/Feature.js +33 -58
- umap/static/umap/test/Map.Export.js +11 -11
- umap/static/umap/test/Map.js +66 -67
- umap/static/umap/test/Marker.js +36 -32
- umap/static/umap/test/Polygon.js +95 -95
- umap/static/umap/test/Polyline.js +31 -31
- umap/static/umap/test/TableEditor.js +29 -25
- umap/static/umap/test/_pre.js +2 -7
- umap/static/umap/test/index.html +4 -4
- umap/static/umap/vendors/contextmenu/leaflet.contextmenu.css +54 -0
- umap/static/umap/vendors/contextmenu/leaflet.contextmenu.js +586 -0
- umap/static/umap/vendors/csv2geojson/index.js +259 -0
- umap/static/umap/vendors/dompurify/purify.js +1633 -0
- umap/static/umap/vendors/locatecontrol/L.Control.Locate.css +63 -0
- umap/static/umap/vendors/locatecontrol/L.Control.Locate.js +950 -0
- umap/static/umap/vendors/minimap/Control.MiniMap.css +88 -0
- umap/static/umap/vendors/minimap/Control.MiniMap.js +352 -0
- umap/static/umap/vendors/togeojson/togeojson.js +2 -0
- umap/templates/auth/user_form.html +3 -2
- umap/templates/base.html +1 -0
- umap/templates/registration/login.html +51 -36
- umap/templates/umap/about_summary.html +1 -1
- umap/templates/umap/branding.html +3 -0
- umap/templates/umap/content.html +15 -39
- umap/templates/umap/header.html +0 -0
- umap/templates/umap/home.html +4 -2
- umap/templates/umap/js.html +0 -1
- umap/templates/umap/map_detail.html +9 -0
- umap/templates/umap/map_init.html +1 -1
- umap/templates/umap/map_messages.html +4 -2
- umap/templates/umap/map_table.html +130 -69
- umap/templates/umap/navigation.html +2 -4
- umap/templates/umap/user_dashboard.html +29 -6
- umap/tests/base.py +1 -1
- umap/tests/integration/conftest.py +18 -0
- umap/tests/integration/test_anonymous_owned_map.py +6 -3
- umap/tests/integration/test_browser.py +166 -6
- umap/tests/integration/test_collaborative_editing.py +23 -5
- umap/tests/integration/test_dashboard.py +17 -0
- umap/tests/integration/test_edit_datalayer.py +4 -3
- umap/tests/integration/test_export_map.py +1 -1
- umap/tests/integration/test_import.py +9 -4
- umap/tests/integration/test_map.py +64 -0
- umap/tests/integration/test_map_preview.py +75 -0
- umap/tests/integration/test_owned_map.py +11 -25
- umap/tests/integration/test_picto.py +3 -3
- umap/tests/integration/test_querystring.py +52 -0
- umap/tests/integration/test_share.py +22 -0
- umap/tests/test_map_views.py +157 -14
- umap/tests/test_views.py +50 -11
- umap/urls.py +6 -12
- umap/views.py +170 -47
- {umap_project-1.14.0a5.dist-info → umap_project-2.0.0a0.dist-info}/METADATA +13 -15
- {umap_project-1.14.0a5.dist-info → umap_project-2.0.0a0.dist-info}/RECORD +220 -199
- umap/static/umap/js/umap.browser.js +0 -148
- umap/static/umap/js/umap.xhr.js +0 -304
- umap/static/umap/test/Controls.js +0 -100
- umap/static/umap/test/Map.Init.js +0 -46
- {umap_project-1.14.0a5.dist-info → umap_project-2.0.0a0.dist-info}/WHEEL +0 -0
- {umap_project-1.14.0a5.dist-info → umap_project-2.0.0a0.dist-info}/entry_points.txt +0 -0
- {umap_project-1.14.0a5.dist-info → umap_project-2.0.0a0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
U.FeatureMixin = {
|
|
2
2
|
staticOptions: { mainColor: 'color' },
|
|
3
3
|
|
|
4
4
|
initialize: function (map, latlng, options) {
|
|
@@ -94,7 +94,7 @@ L.U.FeatureMixin = {
|
|
|
94
94
|
L._('Feature properties')
|
|
95
95
|
)
|
|
96
96
|
|
|
97
|
-
let builder = new
|
|
97
|
+
let builder = new U.FormBuilder(this, ['datalayer'], {
|
|
98
98
|
callback: function () {
|
|
99
99
|
this.edit(e)
|
|
100
100
|
}, // removeLayer step will close the edit panel, let's reopen it
|
|
@@ -113,7 +113,7 @@ L.U.FeatureMixin = {
|
|
|
113
113
|
// We always want name and description for now (properties management to come)
|
|
114
114
|
properties.unshift('properties.description')
|
|
115
115
|
properties.unshift('properties.name')
|
|
116
|
-
builder = new
|
|
116
|
+
builder = new U.FormBuilder(this, properties, {
|
|
117
117
|
id: 'umap-feature-properties',
|
|
118
118
|
callback: this._redraw, // In case we have dynamic options…
|
|
119
119
|
})
|
|
@@ -144,7 +144,7 @@ L.U.FeatureMixin = {
|
|
|
144
144
|
|
|
145
145
|
appendEditFieldsets: function (container) {
|
|
146
146
|
const optionsFields = this.getShapeOptions()
|
|
147
|
-
let builder = new
|
|
147
|
+
let builder = new U.FormBuilder(this, optionsFields, {
|
|
148
148
|
id: 'umap-feature-shape-properties',
|
|
149
149
|
callback: this._redraw,
|
|
150
150
|
})
|
|
@@ -152,7 +152,7 @@ L.U.FeatureMixin = {
|
|
|
152
152
|
shapeProperties.appendChild(builder.build())
|
|
153
153
|
|
|
154
154
|
const advancedOptions = this.getAdvancedOptions()
|
|
155
|
-
builder = new
|
|
155
|
+
builder = new U.FormBuilder(this, advancedOptions, {
|
|
156
156
|
id: 'umap-feature-advanced-properties',
|
|
157
157
|
callback: this._redraw,
|
|
158
158
|
})
|
|
@@ -163,7 +163,7 @@ L.U.FeatureMixin = {
|
|
|
163
163
|
advancedProperties.appendChild(builder.build())
|
|
164
164
|
|
|
165
165
|
const interactionOptions = this.getInteractionOptions()
|
|
166
|
-
builder = new
|
|
166
|
+
builder = new U.FormBuilder(this, interactionOptions, {
|
|
167
167
|
callback: this._redraw,
|
|
168
168
|
})
|
|
169
169
|
const popupFieldset = L.DomUtil.createFieldset(
|
|
@@ -205,7 +205,7 @@ L.U.FeatureMixin = {
|
|
|
205
205
|
|
|
206
206
|
getPopupClass: function () {
|
|
207
207
|
const old = this.getOption('popupTemplate') // Retrocompat.
|
|
208
|
-
return
|
|
208
|
+
return U.Popup[this.getOption('popupShape') || old] || U.Popup
|
|
209
209
|
},
|
|
210
210
|
|
|
211
211
|
attachPopup: function () {
|
|
@@ -382,7 +382,7 @@ L.U.FeatureMixin = {
|
|
|
382
382
|
},
|
|
383
383
|
|
|
384
384
|
getInplaceToolbarActions: function (e) {
|
|
385
|
-
return [
|
|
385
|
+
return [U.ToggleEditAction, U.DeleteFeatureAction]
|
|
386
386
|
},
|
|
387
387
|
|
|
388
388
|
_showContextMenu: function (e) {
|
|
@@ -502,7 +502,7 @@ L.U.FeatureMixin = {
|
|
|
502
502
|
},
|
|
503
503
|
|
|
504
504
|
getVertexActions: function () {
|
|
505
|
-
return [
|
|
505
|
+
return [U.DeleteVertexAction]
|
|
506
506
|
},
|
|
507
507
|
|
|
508
508
|
isMulti: function () {
|
|
@@ -539,9 +539,9 @@ L.U.FeatureMixin = {
|
|
|
539
539
|
},
|
|
540
540
|
}
|
|
541
541
|
|
|
542
|
-
|
|
542
|
+
U.Marker = L.Marker.extend({
|
|
543
543
|
parentClass: L.Marker,
|
|
544
|
-
includes: [
|
|
544
|
+
includes: [U.FeatureMixin],
|
|
545
545
|
|
|
546
546
|
preInit: function () {
|
|
547
547
|
this.setIcon(this.getIcon())
|
|
@@ -556,7 +556,7 @@ L.U.Marker = L.Marker.extend({
|
|
|
556
556
|
},
|
|
557
557
|
|
|
558
558
|
addInteractions: function () {
|
|
559
|
-
|
|
559
|
+
U.FeatureMixin.addInteractions.call(this)
|
|
560
560
|
this.on(
|
|
561
561
|
'dragend',
|
|
562
562
|
function (e) {
|
|
@@ -639,7 +639,7 @@ L.U.Marker = L.Marker.extend({
|
|
|
639
639
|
|
|
640
640
|
disconnectFromDataLayer: function (datalayer) {
|
|
641
641
|
this.options.icon.datalayer = null
|
|
642
|
-
|
|
642
|
+
U.FeatureMixin.disconnectFromDataLayer.call(this, datalayer)
|
|
643
643
|
},
|
|
644
644
|
|
|
645
645
|
_getIconUrl: function (name) {
|
|
@@ -652,7 +652,7 @@ L.U.Marker = L.Marker.extend({
|
|
|
652
652
|
},
|
|
653
653
|
|
|
654
654
|
getIcon: function () {
|
|
655
|
-
const Class =
|
|
655
|
+
const Class = U.Icon[this.getIconClass()] || U.Icon.Default
|
|
656
656
|
return new Class(this.map, { feature: this })
|
|
657
657
|
},
|
|
658
658
|
|
|
@@ -678,12 +678,12 @@ L.U.Marker = L.Marker.extend({
|
|
|
678
678
|
},
|
|
679
679
|
|
|
680
680
|
appendEditFieldsets: function (container) {
|
|
681
|
-
|
|
681
|
+
U.FeatureMixin.appendEditFieldsets.call(this, container)
|
|
682
682
|
const coordinatesOptions = [
|
|
683
683
|
['_latlng.lat', { handler: 'FloatInput', label: L._('Latitude') }],
|
|
684
684
|
['_latlng.lng', { handler: 'FloatInput', label: L._('Longitude') }],
|
|
685
685
|
]
|
|
686
|
-
const builder = new
|
|
686
|
+
const builder = new U.FormBuilder(this, coordinatesOptions, {
|
|
687
687
|
callback: function () {
|
|
688
688
|
if (!this._latlng.isValid()) {
|
|
689
689
|
this.map.ui.alert({
|
|
@@ -707,7 +707,7 @@ L.U.Marker = L.Marker.extend({
|
|
|
707
707
|
// callback is mandatory for zoomToShowLayer
|
|
708
708
|
this.datalayer.layer.zoomToShowLayer(this, e.callback || (() => {}))
|
|
709
709
|
} else {
|
|
710
|
-
|
|
710
|
+
U.FeatureMixin.zoomTo.call(this, e)
|
|
711
711
|
}
|
|
712
712
|
},
|
|
713
713
|
|
|
@@ -721,13 +721,13 @@ L.U.Marker = L.Marker.extend({
|
|
|
721
721
|
},
|
|
722
722
|
})
|
|
723
723
|
|
|
724
|
-
|
|
724
|
+
U.PathMixin = {
|
|
725
725
|
hasGeom: function () {
|
|
726
726
|
return !this.isEmpty()
|
|
727
727
|
},
|
|
728
728
|
|
|
729
729
|
connectToDataLayer: function (datalayer) {
|
|
730
|
-
|
|
730
|
+
U.FeatureMixin.connectToDataLayer.call(this, datalayer)
|
|
731
731
|
// We keep markers on their own layer on top of the paths.
|
|
732
732
|
this.options.pane = this.datalayer.pane
|
|
733
733
|
},
|
|
@@ -735,7 +735,7 @@ L.U.PathMixin = {
|
|
|
735
735
|
edit: function (e) {
|
|
736
736
|
if (this.map.editEnabled) {
|
|
737
737
|
if (!this.editEnabled()) this.enableEdit()
|
|
738
|
-
|
|
738
|
+
U.FeatureMixin.edit.call(this, e)
|
|
739
739
|
}
|
|
740
740
|
},
|
|
741
741
|
|
|
@@ -794,8 +794,10 @@ L.U.PathMixin = {
|
|
|
794
794
|
},
|
|
795
795
|
|
|
796
796
|
_redraw: function () {
|
|
797
|
-
this.
|
|
798
|
-
|
|
797
|
+
if (this.datalayer && this.datalayer.isVisible()) {
|
|
798
|
+
this.setStyle()
|
|
799
|
+
this.resetTooltip()
|
|
800
|
+
}
|
|
799
801
|
},
|
|
800
802
|
|
|
801
803
|
onAdd: function (map) {
|
|
@@ -814,7 +816,7 @@ L.U.PathMixin = {
|
|
|
814
816
|
// this.map.off('showmeasure', this.showMeasureTooltip, this);
|
|
815
817
|
// this.map.off('hidemeasure', this.removeTooltip, this);
|
|
816
818
|
if (this.editing && this.editing.enabled()) this.editing.removeHooks()
|
|
817
|
-
|
|
819
|
+
U.FeatureMixin.onRemove.call(this, map)
|
|
818
820
|
},
|
|
819
821
|
|
|
820
822
|
getBestZoom: function () {
|
|
@@ -823,7 +825,7 @@ L.U.PathMixin = {
|
|
|
823
825
|
|
|
824
826
|
endEdit: function () {
|
|
825
827
|
this.disableEdit()
|
|
826
|
-
|
|
828
|
+
U.FeatureMixin.endEdit.call(this)
|
|
827
829
|
},
|
|
828
830
|
|
|
829
831
|
highlightPath: function () {
|
|
@@ -843,7 +845,7 @@ L.U.PathMixin = {
|
|
|
843
845
|
},
|
|
844
846
|
|
|
845
847
|
addInteractions: function () {
|
|
846
|
-
|
|
848
|
+
U.FeatureMixin.addInteractions.call(this)
|
|
847
849
|
this.on('mouseover', this._onMouseOver)
|
|
848
850
|
this.on('edit', this.makeDirty)
|
|
849
851
|
this.on('drag editable:drag', this._onDrag)
|
|
@@ -869,7 +871,7 @@ L.U.PathMixin = {
|
|
|
869
871
|
this.disableEdit()
|
|
870
872
|
if (!shape) return
|
|
871
873
|
const properties = this.cloneProperties()
|
|
872
|
-
const other = new (this instanceof
|
|
874
|
+
const other = new (this instanceof U.Polyline ? U.Polyline : U.Polygon)(
|
|
873
875
|
this.map,
|
|
874
876
|
shape,
|
|
875
877
|
{ geojson: { properties: properties } }
|
|
@@ -880,7 +882,7 @@ L.U.PathMixin = {
|
|
|
880
882
|
},
|
|
881
883
|
|
|
882
884
|
getContextMenuItems: function (e) {
|
|
883
|
-
let items =
|
|
885
|
+
let items = U.FeatureMixin.getContextMenuItems.call(this, e)
|
|
884
886
|
items.push({
|
|
885
887
|
text: L._('Display measure'),
|
|
886
888
|
callback: function () {
|
|
@@ -920,7 +922,7 @@ L.U.PathMixin = {
|
|
|
920
922
|
},
|
|
921
923
|
|
|
922
924
|
getContextMenuEditItems: function (e) {
|
|
923
|
-
const items =
|
|
925
|
+
const items = U.FeatureMixin.getContextMenuEditItems.call(this, e)
|
|
924
926
|
if (
|
|
925
927
|
this.map.editedFeature &&
|
|
926
928
|
this.isSameClass(this.map.editedFeature) &&
|
|
@@ -947,10 +949,10 @@ L.U.PathMixin = {
|
|
|
947
949
|
},
|
|
948
950
|
|
|
949
951
|
getInplaceToolbarActions: function (e) {
|
|
950
|
-
const items =
|
|
952
|
+
const items = U.FeatureMixin.getInplaceToolbarActions.call(this, e)
|
|
951
953
|
if (this.isMulti()) {
|
|
952
|
-
items.push(
|
|
953
|
-
items.push(
|
|
954
|
+
items.push(U.DeleteShapeAction)
|
|
955
|
+
items.push(U.ExtractShapeFromMultiAction)
|
|
954
956
|
}
|
|
955
957
|
return items
|
|
956
958
|
},
|
|
@@ -973,9 +975,9 @@ L.U.PathMixin = {
|
|
|
973
975
|
},
|
|
974
976
|
}
|
|
975
977
|
|
|
976
|
-
|
|
978
|
+
U.Polyline = L.Polyline.extend({
|
|
977
979
|
parentClass: L.Polyline,
|
|
978
|
-
includes: [
|
|
980
|
+
includes: [U.FeatureMixin, U.PathMixin],
|
|
979
981
|
|
|
980
982
|
staticOptions: {
|
|
981
983
|
stroke: true,
|
|
@@ -984,7 +986,7 @@ L.U.Polyline = L.Polyline.extend({
|
|
|
984
986
|
},
|
|
985
987
|
|
|
986
988
|
isSameClass: function (other) {
|
|
987
|
-
return other instanceof
|
|
989
|
+
return other instanceof U.Polyline
|
|
988
990
|
},
|
|
989
991
|
|
|
990
992
|
getClassName: function () {
|
|
@@ -997,7 +999,7 @@ L.U.Polyline = L.Polyline.extend({
|
|
|
997
999
|
},
|
|
998
1000
|
|
|
999
1001
|
getContextMenuEditItems: function (e) {
|
|
1000
|
-
const items =
|
|
1002
|
+
const items = U.PathMixin.getContextMenuEditItems.call(this, e)
|
|
1001
1003
|
const vertexClicked = e.vertex
|
|
1002
1004
|
let index
|
|
1003
1005
|
if (!this.isMulti()) {
|
|
@@ -1027,7 +1029,7 @@ L.U.Polyline = L.Polyline.extend({
|
|
|
1027
1029
|
},
|
|
1028
1030
|
|
|
1029
1031
|
getContextMenuMultiItems: function (e) {
|
|
1030
|
-
const items =
|
|
1032
|
+
const items = U.PathMixin.getContextMenuMultiItems.call(this, e)
|
|
1031
1033
|
items.push({
|
|
1032
1034
|
text: L._('Merge lines'),
|
|
1033
1035
|
callback: this.mergeShapes,
|
|
@@ -1048,7 +1050,7 @@ L.U.Polyline = L.Polyline.extend({
|
|
|
1048
1050
|
},
|
|
1049
1051
|
|
|
1050
1052
|
getAdvancedEditActions: function (container) {
|
|
1051
|
-
|
|
1053
|
+
U.FeatureMixin.getAdvancedEditActions.call(this, container)
|
|
1052
1054
|
const toPolygon = L.DomUtil.createButton(
|
|
1053
1055
|
'button umap-to-polygon',
|
|
1054
1056
|
container,
|
|
@@ -1108,24 +1110,24 @@ L.U.Polyline = L.Polyline.extend({
|
|
|
1108
1110
|
},
|
|
1109
1111
|
|
|
1110
1112
|
getVertexActions: function (e) {
|
|
1111
|
-
const actions =
|
|
1113
|
+
const actions = U.FeatureMixin.getVertexActions.call(this, e),
|
|
1112
1114
|
index = e.vertex.getIndex()
|
|
1113
1115
|
if (index === 0 || index === e.vertex.getLastIndex())
|
|
1114
|
-
actions.push(
|
|
1115
|
-
else actions.push(
|
|
1116
|
+
actions.push(U.ContinueLineAction)
|
|
1117
|
+
else actions.push(U.SplitLineAction)
|
|
1116
1118
|
return actions
|
|
1117
1119
|
},
|
|
1118
1120
|
})
|
|
1119
1121
|
|
|
1120
|
-
|
|
1122
|
+
U.Polygon = L.Polygon.extend({
|
|
1121
1123
|
parentClass: L.Polygon,
|
|
1122
|
-
includes: [
|
|
1124
|
+
includes: [U.FeatureMixin, U.PathMixin],
|
|
1123
1125
|
staticOptions: {
|
|
1124
1126
|
mainColor: 'fillColor',
|
|
1125
1127
|
},
|
|
1126
1128
|
|
|
1127
1129
|
isSameClass: function (other) {
|
|
1128
|
-
return other instanceof
|
|
1130
|
+
return other instanceof U.Polygon
|
|
1129
1131
|
},
|
|
1130
1132
|
|
|
1131
1133
|
getClassName: function () {
|
|
@@ -1133,7 +1135,7 @@ L.U.Polygon = L.Polygon.extend({
|
|
|
1133
1135
|
},
|
|
1134
1136
|
|
|
1135
1137
|
getShapeOptions: function () {
|
|
1136
|
-
const options =
|
|
1138
|
+
const options = U.PathMixin.getShapeOptions()
|
|
1137
1139
|
options.push(
|
|
1138
1140
|
'properties._umap_options.stroke',
|
|
1139
1141
|
'properties._umap_options.fill',
|
|
@@ -1144,7 +1146,7 @@ L.U.Polygon = L.Polygon.extend({
|
|
|
1144
1146
|
},
|
|
1145
1147
|
|
|
1146
1148
|
getInteractionOptions: function () {
|
|
1147
|
-
const options =
|
|
1149
|
+
const options = U.FeatureMixin.getInteractionOptions()
|
|
1148
1150
|
options.push('properties._umap_options.interactive')
|
|
1149
1151
|
return options
|
|
1150
1152
|
},
|
|
@@ -1155,7 +1157,7 @@ L.U.Polygon = L.Polygon.extend({
|
|
|
1155
1157
|
},
|
|
1156
1158
|
|
|
1157
1159
|
getContextMenuEditItems: function (e) {
|
|
1158
|
-
const items =
|
|
1160
|
+
const items = U.PathMixin.getContextMenuEditItems.call(this, e),
|
|
1159
1161
|
shape = this.shapeAt(e.latlng)
|
|
1160
1162
|
// No multi and no holes.
|
|
1161
1163
|
if (shape && !this.isMulti() && (L.LineUtil.isFlat(shape) || shape.length === 1)) {
|
|
@@ -1189,7 +1191,7 @@ L.U.Polygon = L.Polygon.extend({
|
|
|
1189
1191
|
},
|
|
1190
1192
|
|
|
1191
1193
|
getAdvancedEditActions: function (container) {
|
|
1192
|
-
|
|
1194
|
+
U.FeatureMixin.getAdvancedEditActions.call(this, container)
|
|
1193
1195
|
const toPolyline = L.DomUtil.createButton(
|
|
1194
1196
|
'button umap-to-polyline',
|
|
1195
1197
|
container,
|
|
@@ -1209,8 +1211,8 @@ L.U.Polygon = L.Polygon.extend({
|
|
|
1209
1211
|
},
|
|
1210
1212
|
|
|
1211
1213
|
getInplaceToolbarActions: function (e) {
|
|
1212
|
-
const items =
|
|
1213
|
-
items.push(
|
|
1214
|
+
const items = U.PathMixin.getInplaceToolbarActions.call(this, e)
|
|
1215
|
+
items.push(U.CreateHoleAction)
|
|
1214
1216
|
return items
|
|
1215
1217
|
},
|
|
1216
1218
|
})
|
|
@@ -379,10 +379,10 @@ L.FormBuilder.PopupContent = L.FormBuilder.Select.extend({
|
|
|
379
379
|
L.FormBuilder.LayerTypeChooser = L.FormBuilder.Select.extend({
|
|
380
380
|
getOptions: function () {
|
|
381
381
|
const layer_classes = [
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
382
|
+
U.Layer.Default,
|
|
383
|
+
U.Layer.Cluster,
|
|
384
|
+
U.Layer.Heat,
|
|
385
|
+
U.Layer.Choropleth,
|
|
386
386
|
]
|
|
387
387
|
return layer_classes.map((class_) => [class_.TYPE, class_.NAME])
|
|
388
388
|
},
|
|
@@ -405,7 +405,7 @@ L.FormBuilder.DataLayerSwitcher = L.FormBuilder.Select.extend({
|
|
|
405
405
|
if (
|
|
406
406
|
datalayer.isLoaded() &&
|
|
407
407
|
!datalayer.isDataReadOnly() &&
|
|
408
|
-
datalayer.
|
|
408
|
+
datalayer.isBrowsable()
|
|
409
409
|
) {
|
|
410
410
|
options.push([L.stamp(datalayer), datalayer.getName()])
|
|
411
411
|
}
|
|
@@ -607,7 +607,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
|
607
607
|
// Do not try to render URL with variables
|
|
608
608
|
const box = L.DomUtil.create('div', 'umap-pictogram-choice', this.buttons)
|
|
609
609
|
L.DomEvent.on(box, 'click', this.onDefine, this)
|
|
610
|
-
const icon =
|
|
610
|
+
const icon = U.Icon.makeIconElement(this.value(), box)
|
|
611
611
|
}
|
|
612
612
|
this.button = L.DomUtil.createButton(
|
|
613
613
|
'button action-button',
|
|
@@ -685,7 +685,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
|
685
685
|
return !this.value() || this.value() === this.obj.getMap().options.default_iconUrl
|
|
686
686
|
},
|
|
687
687
|
|
|
688
|
-
showSymbolsTab: function () {
|
|
688
|
+
showSymbolsTab: async function () {
|
|
689
689
|
this.openTab('symbols')
|
|
690
690
|
this.searchInput = L.DomUtil.create('input', '', this.body)
|
|
691
691
|
this.searchInput.type = 'search'
|
|
@@ -695,19 +695,19 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
|
695
695
|
if (this.pictogram_list) {
|
|
696
696
|
this.buildSymbolsList()
|
|
697
697
|
} else {
|
|
698
|
-
this.builder.map.get(
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
}
|
|
698
|
+
const [{ pictogram_list }, response, error] = await this.builder.map.server.get(
|
|
699
|
+
this.builder.map.options.urls.pictogram_list_json
|
|
700
|
+
)
|
|
701
|
+
if (!error) {
|
|
702
|
+
this.pictogram_list = pictogram_list
|
|
703
|
+
this.buildSymbolsList()
|
|
704
|
+
}
|
|
705
705
|
}
|
|
706
706
|
},
|
|
707
707
|
|
|
708
708
|
showCharsTab: function () {
|
|
709
709
|
this.openTab('chars')
|
|
710
|
-
const value = !
|
|
710
|
+
const value = !U.Icon.isImg(this.value()) ? this.value() : null
|
|
711
711
|
const input = this.buildInput(this.body, value)
|
|
712
712
|
input.placeholder = L._('Type char or paste emoji')
|
|
713
713
|
input.type = 'text'
|
|
@@ -960,7 +960,7 @@ L.FormBuilder.ManageOwner = L.FormBuilder.Element.extend({
|
|
|
960
960
|
className: 'edit-owner',
|
|
961
961
|
on_select: L.bind(this.onSelect, this),
|
|
962
962
|
}
|
|
963
|
-
this.autocomplete = new
|
|
963
|
+
this.autocomplete = new U.AutoComplete.Ajax.Select(this.parentNode, options)
|
|
964
964
|
const owner = this.toHTML()
|
|
965
965
|
if (owner)
|
|
966
966
|
this.autocomplete.displaySelected({
|
|
@@ -989,7 +989,7 @@ L.FormBuilder.ManageEditors = L.FormBuilder.Element.extend({
|
|
|
989
989
|
on_select: L.bind(this.onSelect, this),
|
|
990
990
|
on_unselect: L.bind(this.onUnselect, this),
|
|
991
991
|
}
|
|
992
|
-
this.autocomplete = new
|
|
992
|
+
this.autocomplete = new U.AutoComplete.Ajax.SelectMultiple(
|
|
993
993
|
this.parentNode,
|
|
994
994
|
options
|
|
995
995
|
)
|
|
@@ -1023,7 +1023,7 @@ L.FormBuilder.ManageEditors = L.FormBuilder.Element.extend({
|
|
|
1023
1023
|
},
|
|
1024
1024
|
})
|
|
1025
1025
|
|
|
1026
|
-
|
|
1026
|
+
U.FormBuilder = L.FormBuilder.extend({
|
|
1027
1027
|
options: {
|
|
1028
1028
|
className: 'umap-form',
|
|
1029
1029
|
},
|
|
@@ -1114,7 +1114,7 @@ L.U.FormBuilder = L.FormBuilder.extend({
|
|
|
1114
1114
|
handler: 'IconUrl',
|
|
1115
1115
|
label: L._('Icon symbol'),
|
|
1116
1116
|
inheritable: true,
|
|
1117
|
-
helpText:
|
|
1117
|
+
helpText: U.Help.formatIconSymbol,
|
|
1118
1118
|
},
|
|
1119
1119
|
popupShape: { handler: 'PopupShape', label: L._('Popup shape'), inheritable: true },
|
|
1120
1120
|
popupTemplate: {
|
umap/static/umap/js/umap.icon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
U.Icon = L.DivIcon.extend({
|
|
2
2
|
initialize: function (map, options) {
|
|
3
3
|
this.map = map
|
|
4
4
|
const default_options = {
|
|
@@ -42,7 +42,7 @@ L.U.Icon = L.DivIcon.extend({
|
|
|
42
42
|
onAdd: function () {},
|
|
43
43
|
})
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
U.Icon.Default = U.Icon.extend({
|
|
46
46
|
default_options: {
|
|
47
47
|
iconAnchor: new L.Point(16, 40),
|
|
48
48
|
popupAnchor: new L.Point(0, -40),
|
|
@@ -52,11 +52,11 @@ L.U.Icon.Default = L.U.Icon.extend({
|
|
|
52
52
|
|
|
53
53
|
initialize: function (map, options) {
|
|
54
54
|
options = L.Util.extend({}, this.default_options, options)
|
|
55
|
-
|
|
55
|
+
U.Icon.prototype.initialize.call(this, map, options)
|
|
56
56
|
},
|
|
57
57
|
|
|
58
58
|
_setIconStyles: function (img, name) {
|
|
59
|
-
|
|
59
|
+
U.Icon.prototype._setIconStyles.call(this, img, name)
|
|
60
60
|
const color = this._getColor(),
|
|
61
61
|
opacity = this._getOpacity()
|
|
62
62
|
this.elements.container.style.backgroundColor = color
|
|
@@ -68,7 +68,7 @@ L.U.Icon.Default = L.U.Icon.extend({
|
|
|
68
68
|
onAdd: function () {
|
|
69
69
|
const src = this._getIconUrl('icon')
|
|
70
70
|
const bgcolor = this._getColor()
|
|
71
|
-
|
|
71
|
+
U.Icon.setIconContrast(this.elements.icon, this.elements.container, src, bgcolor)
|
|
72
72
|
},
|
|
73
73
|
|
|
74
74
|
createIcon: function () {
|
|
@@ -82,14 +82,14 @@ L.U.Icon.Default = L.U.Icon.extend({
|
|
|
82
82
|
this.elements.arrow = L.DomUtil.create('div', 'icon_arrow', this.elements.main)
|
|
83
83
|
const src = this._getIconUrl('icon')
|
|
84
84
|
if (src) {
|
|
85
|
-
this.elements.icon =
|
|
85
|
+
this.elements.icon = U.Icon.makeIconElement(src, this.elements.container)
|
|
86
86
|
}
|
|
87
87
|
this._setIconStyles(this.elements.main, 'icon')
|
|
88
88
|
return this.elements.main
|
|
89
89
|
},
|
|
90
90
|
})
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
U.Icon.Circle = U.Icon.extend({
|
|
93
93
|
initialize: function (map, options) {
|
|
94
94
|
const default_options = {
|
|
95
95
|
popupAnchor: new L.Point(0, -6),
|
|
@@ -97,11 +97,11 @@ L.U.Icon.Circle = L.U.Icon.extend({
|
|
|
97
97
|
className: 'umap-circle-icon',
|
|
98
98
|
}
|
|
99
99
|
options = L.Util.extend({}, default_options, options)
|
|
100
|
-
|
|
100
|
+
U.Icon.prototype.initialize.call(this, map, options)
|
|
101
101
|
},
|
|
102
102
|
|
|
103
103
|
_setIconStyles: function (img, name) {
|
|
104
|
-
|
|
104
|
+
U.Icon.prototype._setIconStyles.call(this, img, name)
|
|
105
105
|
this.elements.main.style.backgroundColor = this._getColor()
|
|
106
106
|
this.elements.main.style.opacity = this._getOpacity()
|
|
107
107
|
},
|
|
@@ -115,7 +115,7 @@ L.U.Icon.Circle = L.U.Icon.extend({
|
|
|
115
115
|
},
|
|
116
116
|
})
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
U.Icon.Drop = U.Icon.Default.extend({
|
|
119
119
|
default_options: {
|
|
120
120
|
iconAnchor: new L.Point(16, 42),
|
|
121
121
|
popupAnchor: new L.Point(0, -42),
|
|
@@ -124,7 +124,7 @@ L.U.Icon.Drop = L.U.Icon.Default.extend({
|
|
|
124
124
|
},
|
|
125
125
|
})
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
U.Icon.Ball = U.Icon.Default.extend({
|
|
128
128
|
default_options: {
|
|
129
129
|
iconAnchor: new L.Point(8, 30),
|
|
130
130
|
popupAnchor: new L.Point(0, -28),
|
|
@@ -146,7 +146,7 @@ L.U.Icon.Ball = L.U.Icon.Default.extend({
|
|
|
146
146
|
},
|
|
147
147
|
|
|
148
148
|
_setIconStyles: function (img, name) {
|
|
149
|
-
|
|
149
|
+
U.Icon.prototype._setIconStyles.call(this, img, name)
|
|
150
150
|
const color = this._getColor('color')
|
|
151
151
|
let background
|
|
152
152
|
if (L.Browser.ielt9) {
|
|
@@ -161,7 +161,7 @@ L.U.Icon.Ball = L.U.Icon.Default.extend({
|
|
|
161
161
|
},
|
|
162
162
|
})
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
U.Icon.Cluster = L.DivIcon.extend({
|
|
165
165
|
options: {
|
|
166
166
|
iconSize: [40, 40],
|
|
167
167
|
},
|
|
@@ -191,13 +191,13 @@ L.U.Icon.Cluster = L.DivIcon.extend({
|
|
|
191
191
|
},
|
|
192
192
|
})
|
|
193
193
|
|
|
194
|
-
|
|
194
|
+
U.Icon.isImg = function (src) {
|
|
195
195
|
return L.Util.isPath(src) || L.Util.isRemoteUrl(src) || L.Util.isDataImage(src)
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
|
|
198
|
+
U.Icon.makeIconElement = function (src, parent) {
|
|
199
199
|
let icon
|
|
200
|
-
if (
|
|
200
|
+
if (U.Icon.isImg(src)) {
|
|
201
201
|
icon = L.DomUtil.create('img')
|
|
202
202
|
icon.src = src
|
|
203
203
|
} else {
|
|
@@ -208,7 +208,7 @@ L.U.Icon.makeIconElement = function (src, parent) {
|
|
|
208
208
|
return icon
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
U.Icon.setIconContrast = function (icon, parent, src, bgcolor) {
|
|
212
212
|
/*
|
|
213
213
|
* icon: the element we'll adapt the style, it can be an image or text
|
|
214
214
|
* parent: the element we'll consider to decide whether to adapt the style,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
U.Importer = L.Class.extend({
|
|
2
2
|
TYPES: ['geojson', 'csv', 'gpx', 'kml', 'osm', 'georss', 'umap'],
|
|
3
3
|
initialize: function (map) {
|
|
4
4
|
this.map = map
|
|
@@ -16,6 +16,7 @@ L.U.Importer = L.Class.extend({
|
|
|
16
16
|
{ type: 'file', multiple: 'multiple', autofocus: true },
|
|
17
17
|
this.fileBox
|
|
18
18
|
)
|
|
19
|
+
this.map.ui.once('panel:closed', () => (this.fileInput.value = null))
|
|
19
20
|
this.urlInput = L.DomUtil.element(
|
|
20
21
|
'input',
|
|
21
22
|
{ type: 'text', placeholder: L._('Provide an URL here') },
|