umap-project 2.2.2__py3-none-any.whl → 2.3.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/locale/pl/LC_MESSAGES/django.mo +0 -0
- umap/locale/pl/LC_MESSAGES/django.po +83 -78
- umap/locale/pt/LC_MESSAGES/django.mo +0 -0
- umap/locale/pt/LC_MESSAGES/django.po +129 -123
- umap/static/umap/base.css +85 -44
- umap/static/umap/css/icon.css +6 -0
- umap/static/umap/css/panel.css +9 -4
- umap/static/umap/img/16.svg +2 -2
- umap/static/umap/img/source/16.svg +3 -3
- umap/static/umap/js/modules/browser.js +58 -24
- umap/static/umap/js/modules/caption.js +118 -0
- umap/static/umap/js/modules/facets.js +14 -39
- umap/static/umap/js/modules/global.js +2 -0
- umap/static/umap/js/modules/orderable.js +1 -1
- umap/static/umap/js/modules/panel.js +13 -7
- umap/static/umap/js/modules/schema.js +4 -4
- umap/static/umap/js/modules/urls.js +1 -1
- umap/static/umap/js/modules/utils.js +9 -1
- umap/static/umap/js/umap.controls.js +40 -110
- umap/static/umap/js/umap.core.js +19 -20
- umap/static/umap/js/umap.features.js +8 -2
- umap/static/umap/js/umap.forms.js +95 -34
- umap/static/umap/js/umap.js +47 -54
- umap/static/umap/js/umap.layer.js +5 -8
- umap/static/umap/js/umap.popup.js +1 -0
- umap/static/umap/locale/am_ET.js +11 -12
- umap/static/umap/locale/am_ET.json +11 -12
- umap/static/umap/locale/ar.js +11 -12
- umap/static/umap/locale/ar.json +11 -12
- umap/static/umap/locale/ast.js +11 -12
- umap/static/umap/locale/ast.json +11 -12
- umap/static/umap/locale/bg.js +11 -12
- umap/static/umap/locale/bg.json +11 -12
- umap/static/umap/locale/br.js +11 -12
- umap/static/umap/locale/br.json +11 -12
- umap/static/umap/locale/ca.js +11 -12
- umap/static/umap/locale/ca.json +11 -12
- umap/static/umap/locale/cs_CZ.js +11 -12
- umap/static/umap/locale/cs_CZ.json +11 -12
- umap/static/umap/locale/da.js +11 -12
- umap/static/umap/locale/da.json +11 -12
- umap/static/umap/locale/de.js +11 -12
- umap/static/umap/locale/de.json +11 -12
- umap/static/umap/locale/el.js +11 -12
- umap/static/umap/locale/el.json +11 -12
- umap/static/umap/locale/en.js +11 -12
- umap/static/umap/locale/en.json +11 -12
- umap/static/umap/locale/en_US.json +11 -12
- umap/static/umap/locale/es.js +11 -12
- umap/static/umap/locale/es.json +11 -12
- umap/static/umap/locale/et.js +11 -12
- umap/static/umap/locale/et.json +11 -12
- umap/static/umap/locale/eu.js +27 -16
- umap/static/umap/locale/eu.json +27 -16
- umap/static/umap/locale/fa_IR.js +11 -12
- umap/static/umap/locale/fa_IR.json +11 -12
- umap/static/umap/locale/fi.js +11 -12
- umap/static/umap/locale/fi.json +11 -12
- umap/static/umap/locale/fr.js +11 -12
- umap/static/umap/locale/fr.json +11 -12
- umap/static/umap/locale/gl.js +11 -12
- umap/static/umap/locale/gl.json +11 -12
- umap/static/umap/locale/he.js +11 -12
- umap/static/umap/locale/he.json +11 -12
- umap/static/umap/locale/hr.js +11 -12
- umap/static/umap/locale/hr.json +11 -12
- umap/static/umap/locale/hu.js +29 -30
- umap/static/umap/locale/hu.json +29 -30
- umap/static/umap/locale/id.js +11 -12
- umap/static/umap/locale/id.json +11 -12
- umap/static/umap/locale/is.js +11 -12
- umap/static/umap/locale/is.json +11 -12
- umap/static/umap/locale/it.js +11 -12
- umap/static/umap/locale/it.json +11 -12
- umap/static/umap/locale/ja.js +11 -12
- umap/static/umap/locale/ja.json +11 -12
- umap/static/umap/locale/ko.js +11 -12
- umap/static/umap/locale/ko.json +11 -12
- umap/static/umap/locale/lt.js +11 -12
- umap/static/umap/locale/lt.json +11 -12
- umap/static/umap/locale/ms.js +20 -21
- umap/static/umap/locale/ms.json +20 -21
- umap/static/umap/locale/nl.js +11 -12
- umap/static/umap/locale/nl.json +11 -12
- umap/static/umap/locale/no.js +11 -12
- umap/static/umap/locale/no.json +11 -12
- umap/static/umap/locale/pl.js +11 -12
- umap/static/umap/locale/pl.json +11 -12
- umap/static/umap/locale/pl_PL.json +11 -12
- umap/static/umap/locale/pt.js +11 -12
- umap/static/umap/locale/pt.json +11 -12
- umap/static/umap/locale/pt_BR.js +11 -12
- umap/static/umap/locale/pt_BR.json +11 -12
- umap/static/umap/locale/pt_PT.js +11 -12
- umap/static/umap/locale/pt_PT.json +11 -12
- umap/static/umap/locale/ro.js +11 -12
- umap/static/umap/locale/ro.json +11 -12
- umap/static/umap/locale/ru.js +11 -12
- umap/static/umap/locale/ru.json +11 -12
- umap/static/umap/locale/si.js +240 -227
- umap/static/umap/locale/si.json +240 -227
- umap/static/umap/locale/sk_SK.js +11 -12
- umap/static/umap/locale/sk_SK.json +11 -12
- umap/static/umap/locale/sl.js +11 -12
- umap/static/umap/locale/sl.json +11 -12
- umap/static/umap/locale/sr.js +11 -12
- umap/static/umap/locale/sr.json +11 -12
- umap/static/umap/locale/sv.js +11 -12
- umap/static/umap/locale/sv.json +11 -12
- umap/static/umap/locale/th_TH.js +11 -12
- umap/static/umap/locale/th_TH.json +11 -12
- umap/static/umap/locale/tr.js +11 -12
- umap/static/umap/locale/tr.json +11 -12
- umap/static/umap/locale/uk_UA.js +11 -12
- umap/static/umap/locale/uk_UA.json +11 -12
- umap/static/umap/locale/vi.js +11 -12
- umap/static/umap/locale/vi.json +11 -12
- umap/static/umap/locale/vi_VN.json +11 -12
- umap/static/umap/locale/zh.js +11 -12
- umap/static/umap/locale/zh.json +11 -12
- umap/static/umap/locale/zh_CN.json +11 -12
- umap/static/umap/locale/zh_TW.Big5.json +11 -12
- umap/static/umap/locale/zh_TW.js +11 -12
- umap/static/umap/locale/zh_TW.json +11 -12
- umap/static/umap/map.css +17 -2
- umap/static/umap/unittests/utils.js +7 -0
- umap/static/umap/vars.css +10 -0
- umap/static/umap/vendors/dompurify/purify.es.js +96 -12
- umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -1
- umap/tests/base.py +1 -0
- umap/tests/integration/conftest.py +5 -4
- umap/tests/integration/test_browser.py +11 -2
- umap/tests/integration/test_caption.py +27 -0
- umap/tests/integration/test_choropleth.py +1 -1
- umap/tests/integration/test_draw_polygon.py +6 -0
- umap/tests/integration/test_draw_polyline.py +6 -0
- umap/tests/integration/test_edit_datalayer.py +34 -5
- umap/tests/integration/test_edit_map.py +4 -4
- umap/tests/integration/test_edit_marker.py +6 -6
- umap/tests/integration/test_edit_polygon.py +6 -6
- umap/tests/integration/test_facets_browser.py +85 -13
- umap/tests/integration/test_map.py +0 -15
- umap/tests/integration/test_view_marker.py +17 -0
- {umap_project-2.2.2.dist-info → umap_project-2.3.1.dist-info}/METADATA +9 -8
- {umap_project-2.2.2.dist-info → umap_project-2.3.1.dist-info}/RECORD +149 -154
- {umap_project-2.2.2.dist-info → umap_project-2.3.1.dist-info}/WHEEL +1 -1
- umap/.DS_Store +0 -0
- umap/static/.DS_Store +0 -0
- umap/static/umap/.DS_Store +0 -0
- umap/static/umap/favicons/.DS_Store +0 -0
- umap/static/umap/fonts/.DS_Store +0 -0
- umap/tests/.DS_Store +0 -0
- umap/tests/integration/.DS_Store +0 -0
- {umap_project-2.2.2.dist-info → umap_project-2.3.1.dist-info}/entry_points.txt +0 -0
- {umap_project-2.2.2.dist-info → umap_project-2.3.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -744,7 +744,15 @@ L.FormBuilder.Switch = L.FormBuilder.CheckBox.extend({
|
|
|
744
744
|
},
|
|
745
745
|
})
|
|
746
746
|
|
|
747
|
-
L.FormBuilder.
|
|
747
|
+
L.FormBuilder.FacetSearchBase = L.FormBuilder.Element.extend({
|
|
748
|
+
buildLabel: function () {
|
|
749
|
+
this.label = L.DomUtil.element({
|
|
750
|
+
tagName: 'legend',
|
|
751
|
+
textContent: this.options.label,
|
|
752
|
+
})
|
|
753
|
+
},
|
|
754
|
+
})
|
|
755
|
+
L.FormBuilder.FacetSearchChoices = L.FormBuilder.FacetSearchBase.extend({
|
|
748
756
|
build: function () {
|
|
749
757
|
this.container = L.DomUtil.create('fieldset', 'umap-facet', this.parentNode)
|
|
750
758
|
this.container.appendChild(this.label)
|
|
@@ -756,13 +764,6 @@ L.FormBuilder.FacetSearchChoices = L.FormBuilder.Element.extend({
|
|
|
756
764
|
choices.forEach((value) => this.buildLi(value))
|
|
757
765
|
},
|
|
758
766
|
|
|
759
|
-
buildLabel: function () {
|
|
760
|
-
this.label = L.DomUtil.element({
|
|
761
|
-
tagName: 'legend',
|
|
762
|
-
textContent: this.options.label,
|
|
763
|
-
})
|
|
764
|
-
},
|
|
765
|
-
|
|
766
767
|
buildLi: function (value) {
|
|
767
768
|
const property_li = L.DomUtil.create('li', '', this.ul)
|
|
768
769
|
const label = L.DomUtil.create('label', '', property_li)
|
|
@@ -787,7 +788,7 @@ L.FormBuilder.FacetSearchChoices = L.FormBuilder.Element.extend({
|
|
|
787
788
|
},
|
|
788
789
|
})
|
|
789
790
|
|
|
790
|
-
L.FormBuilder.MinMaxBase = L.FormBuilder.
|
|
791
|
+
L.FormBuilder.MinMaxBase = L.FormBuilder.FacetSearchBase.extend({
|
|
791
792
|
getInputType: function (type) {
|
|
792
793
|
return type
|
|
793
794
|
},
|
|
@@ -796,7 +797,7 @@ L.FormBuilder.MinMaxBase = L.FormBuilder.Element.extend({
|
|
|
796
797
|
return [L._('Min'), L._('Max')]
|
|
797
798
|
},
|
|
798
799
|
|
|
799
|
-
|
|
800
|
+
prepareForHTML: function (value) {
|
|
800
801
|
return value.valueOf()
|
|
801
802
|
},
|
|
802
803
|
|
|
@@ -804,6 +805,10 @@ L.FormBuilder.MinMaxBase = L.FormBuilder.Element.extend({
|
|
|
804
805
|
this.container = L.DomUtil.create('fieldset', 'umap-facet', this.parentNode)
|
|
805
806
|
this.container.appendChild(this.label)
|
|
806
807
|
const { min, max, type } = this.options.criteria
|
|
808
|
+
const { min: modifiedMin, max: modifiedMax } = this.get()
|
|
809
|
+
|
|
810
|
+
const currentMin = modifiedMin !== undefined ? modifiedMin : min
|
|
811
|
+
const currentMax = modifiedMax !== undefined ? modifiedMax : max
|
|
807
812
|
this.type = type
|
|
808
813
|
this.inputType = this.getInputType(this.type)
|
|
809
814
|
|
|
@@ -815,9 +820,17 @@ L.FormBuilder.MinMaxBase = L.FormBuilder.Element.extend({
|
|
|
815
820
|
this.minInput = L.DomUtil.create('input', '', this.minLabel)
|
|
816
821
|
this.minInput.type = this.inputType
|
|
817
822
|
this.minInput.step = 'any'
|
|
823
|
+
this.minInput.min = this.prepareForHTML(min)
|
|
824
|
+
this.minInput.max = this.prepareForHTML(max)
|
|
818
825
|
if (min != null) {
|
|
819
|
-
|
|
820
|
-
|
|
826
|
+
// The value stored using setAttribute is not modified by
|
|
827
|
+
// user input, and will be used as initial value when calling
|
|
828
|
+
// form.reset(), and can also be retrieve later on by using
|
|
829
|
+
// getAttributing, to compare with current value and know
|
|
830
|
+
// if this value has been modified by the user
|
|
831
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/reset
|
|
832
|
+
this.minInput.setAttribute('value', this.prepareForHTML(min))
|
|
833
|
+
this.minInput.value = this.prepareForHTML(currentMin)
|
|
821
834
|
}
|
|
822
835
|
|
|
823
836
|
this.maxLabel = L.DomUtil.create('label', '', this.container)
|
|
@@ -826,37 +839,76 @@ L.FormBuilder.MinMaxBase = L.FormBuilder.Element.extend({
|
|
|
826
839
|
this.maxInput = L.DomUtil.create('input', '', this.maxLabel)
|
|
827
840
|
this.maxInput.type = this.inputType
|
|
828
841
|
this.maxInput.step = 'any'
|
|
842
|
+
this.maxInput.min = this.prepareForHTML(min)
|
|
843
|
+
this.maxInput.max = this.prepareForHTML(max)
|
|
829
844
|
if (max != null) {
|
|
830
|
-
|
|
831
|
-
this.maxInput.
|
|
845
|
+
// Cf comment above about setAttribute vs value
|
|
846
|
+
this.maxInput.setAttribute('value', this.prepareForHTML(max))
|
|
847
|
+
this.maxInput.value = this.prepareForHTML(currentMax)
|
|
832
848
|
}
|
|
849
|
+
this.toggleStatus()
|
|
833
850
|
|
|
834
|
-
L.DomEvent.on(this.minInput, 'change', (
|
|
835
|
-
L.DomEvent.on(this.maxInput, 'change', (
|
|
851
|
+
L.DomEvent.on(this.minInput, 'change', () => this.sync())
|
|
852
|
+
L.DomEvent.on(this.maxInput, 'change', () => this.sync())
|
|
836
853
|
},
|
|
837
854
|
|
|
838
|
-
|
|
839
|
-
this.
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
855
|
+
toggleStatus: function () {
|
|
856
|
+
this.minInput.dataset.modified = this.isMinModified()
|
|
857
|
+
this.maxInput.dataset.modified = this.isMaxModified()
|
|
858
|
+
},
|
|
859
|
+
|
|
860
|
+
sync: function () {
|
|
861
|
+
L.FormBuilder.Element.prototype.sync.call(this)
|
|
862
|
+
this.toggleStatus()
|
|
863
|
+
},
|
|
864
|
+
|
|
865
|
+
isMinModified: function () {
|
|
866
|
+
const default_ = this.minInput.getAttribute('value')
|
|
867
|
+
const current = this.minInput.value
|
|
868
|
+
return current != default_
|
|
869
|
+
},
|
|
870
|
+
|
|
871
|
+
isMaxModified: function () {
|
|
872
|
+
const default_ = this.maxInput.getAttribute('value')
|
|
873
|
+
const current = this.maxInput.value
|
|
874
|
+
return current != default_
|
|
843
875
|
},
|
|
844
876
|
|
|
845
877
|
toJS: function () {
|
|
846
|
-
|
|
878
|
+
const opts = {
|
|
847
879
|
type: this.type,
|
|
848
|
-
min: this.minInput.value,
|
|
849
|
-
max: this.maxInput.value,
|
|
850
880
|
}
|
|
881
|
+
if (this.minInput.value !== '' && this.isMinModified()) {
|
|
882
|
+
opts.min = this.prepareForJS(this.minInput.value)
|
|
883
|
+
}
|
|
884
|
+
if (this.maxInput.value !== '' && this.isMaxModified()) {
|
|
885
|
+
opts.max = this.prepareForJS(this.maxInput.value)
|
|
886
|
+
}
|
|
887
|
+
return opts
|
|
851
888
|
},
|
|
852
889
|
})
|
|
853
890
|
|
|
854
|
-
L.FormBuilder.FacetSearchNumber = L.FormBuilder.MinMaxBase.extend({
|
|
891
|
+
L.FormBuilder.FacetSearchNumber = L.FormBuilder.MinMaxBase.extend({
|
|
892
|
+
prepareForJS: function (value) {
|
|
893
|
+
return new Number(value)
|
|
894
|
+
},
|
|
895
|
+
})
|
|
855
896
|
|
|
856
897
|
L.FormBuilder.FacetSearchDate = L.FormBuilder.MinMaxBase.extend({
|
|
857
|
-
|
|
858
|
-
return
|
|
898
|
+
prepareForJS: function (value) {
|
|
899
|
+
return new Date(value)
|
|
900
|
+
},
|
|
901
|
+
|
|
902
|
+
toLocaleDateTime: function (dt) {
|
|
903
|
+
return new Date(dt.valueOf() - dt.getTimezoneOffset() * 60000)
|
|
904
|
+
},
|
|
905
|
+
|
|
906
|
+
prepareForHTML: function (value) {
|
|
907
|
+
// Value must be in local time
|
|
908
|
+
if (isNaN(value)) return
|
|
909
|
+
return this.toLocaleDateTime(value).toISOString().substr(0, 10)
|
|
859
910
|
},
|
|
911
|
+
|
|
860
912
|
getLabels: function () {
|
|
861
913
|
return [L._('From'), L._('Until')]
|
|
862
914
|
},
|
|
@@ -866,6 +918,12 @@ L.FormBuilder.FacetSearchDateTime = L.FormBuilder.FacetSearchDate.extend({
|
|
|
866
918
|
getInputType: function (type) {
|
|
867
919
|
return 'datetime-local'
|
|
868
920
|
},
|
|
921
|
+
|
|
922
|
+
prepareForHTML: function (value) {
|
|
923
|
+
// Value must be in local time
|
|
924
|
+
if (isNaN(value)) return
|
|
925
|
+
return this.toLocaleDateTime(value).toISOString().slice(0, -1)
|
|
926
|
+
},
|
|
869
927
|
})
|
|
870
928
|
|
|
871
929
|
L.FormBuilder.MultiChoice = L.FormBuilder.Element.extend({
|
|
@@ -878,13 +936,16 @@ L.FormBuilder.MultiChoice = L.FormBuilder.Element.extend({
|
|
|
878
936
|
},
|
|
879
937
|
|
|
880
938
|
fetch: function () {
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
939
|
+
this.backup = this.toHTML()
|
|
940
|
+
let value = this.backup
|
|
941
|
+
if (!this.container.querySelector(`input[type="radio"][value="${value}"]`)) {
|
|
942
|
+
value = this.options.default !== undefined ? this.options.default : this.default
|
|
943
|
+
}
|
|
944
|
+
const choices = this.getChoices().map(([value, label]) => value)
|
|
945
|
+
if (choices.includes(value)) {
|
|
946
|
+
this.container.querySelector(`input[type="radio"][value="${value}"]`).checked =
|
|
947
|
+
true
|
|
948
|
+
}
|
|
888
949
|
},
|
|
889
950
|
|
|
890
951
|
value: function () {
|
umap/static/umap/js/umap.js
CHANGED
|
@@ -149,6 +149,9 @@ U.Map = L.Map.extend({
|
|
|
149
149
|
if (this.options.datalayersControl === 'expanded') {
|
|
150
150
|
this.options.onLoadPanel = 'datalayers'
|
|
151
151
|
}
|
|
152
|
+
if (this.options.onLoadPanel === 'facet') {
|
|
153
|
+
this.options.onLoadPanel = 'datafilters'
|
|
154
|
+
}
|
|
152
155
|
|
|
153
156
|
let isDirty = false // self status
|
|
154
157
|
try {
|
|
@@ -211,15 +214,17 @@ U.Map = L.Map.extend({
|
|
|
211
214
|
if (L.Util.queryString('share')) {
|
|
212
215
|
this.share.open()
|
|
213
216
|
} else if (this.options.onLoadPanel === 'databrowser') {
|
|
214
|
-
this.
|
|
217
|
+
this.panel.setDefaultMode('expanded')
|
|
218
|
+
this.openBrowser('data')
|
|
215
219
|
} else if (this.options.onLoadPanel === 'datalayers') {
|
|
216
|
-
this.
|
|
220
|
+
this.panel.setDefaultMode('condensed')
|
|
221
|
+
this.openBrowser('layers')
|
|
222
|
+
} else if (this.options.onLoadPanel === 'datafilters') {
|
|
223
|
+
this.panel.setDefaultMode('expanded')
|
|
224
|
+
this.openBrowser('filters')
|
|
217
225
|
} else if (this.options.onLoadPanel === 'caption') {
|
|
218
|
-
this.panel.
|
|
219
|
-
this.
|
|
220
|
-
} else if (['facet', 'datafilters'].includes(this.options.onLoadPanel)) {
|
|
221
|
-
this.panel.mode = 'expanded'
|
|
222
|
-
this.openFacet()
|
|
226
|
+
this.panel.setDefaultMode('condensed')
|
|
227
|
+
this.openCaption()
|
|
223
228
|
}
|
|
224
229
|
if (L.Util.queryString('edit')) {
|
|
225
230
|
if (this.hasEditMode()) this.enableEdit()
|
|
@@ -252,7 +257,7 @@ U.Map = L.Map.extend({
|
|
|
252
257
|
this.initCaptionBar()
|
|
253
258
|
this.renderEditToolbar()
|
|
254
259
|
this.renderControls()
|
|
255
|
-
this.
|
|
260
|
+
this.browser.redraw()
|
|
256
261
|
break
|
|
257
262
|
case 'data':
|
|
258
263
|
this.redrawVisibleDataLayers()
|
|
@@ -379,6 +384,7 @@ U.Map = L.Map.extend({
|
|
|
379
384
|
else this.scrollWheelZoom.disable()
|
|
380
385
|
this.browser = new U.Browser(this)
|
|
381
386
|
this.facets = new U.Facets(this)
|
|
387
|
+
this.caption = new U.Caption(this)
|
|
382
388
|
this.importer = new U.Importer(this)
|
|
383
389
|
this.drop = new U.DropControl(this)
|
|
384
390
|
this.share = new U.Share(this)
|
|
@@ -386,17 +392,10 @@ U.Map = L.Map.extend({
|
|
|
386
392
|
},
|
|
387
393
|
|
|
388
394
|
renderControls: function () {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
(this.options.slideshow && this.options.slideshow.active)
|
|
394
|
-
)
|
|
395
|
-
L.DomUtil.classIf(
|
|
396
|
-
document.body,
|
|
397
|
-
'umap-slideshow-enabled',
|
|
398
|
-
this.options.slideshow && this.options.slideshow.active
|
|
399
|
-
)
|
|
395
|
+
const hasSlideshow = Boolean(this.options.slideshow && this.options.slideshow.active)
|
|
396
|
+
const barEnabled = this.options.captionBar || hasSlideshow
|
|
397
|
+
document.body.classList.toggle('umap-caption-bar-enabled', barEnabled)
|
|
398
|
+
document.body.classList.toggle('umap-slideshow-enabled', hasSlideshow)
|
|
400
399
|
for (const control of Object.values(this._controls)) {
|
|
401
400
|
this.removeControl(control)
|
|
402
401
|
}
|
|
@@ -471,6 +470,7 @@ U.Map = L.Map.extend({
|
|
|
471
470
|
|
|
472
471
|
onDataLayersChanged: function () {
|
|
473
472
|
if (this.browser) this.browser.update()
|
|
473
|
+
this.caption.refresh()
|
|
474
474
|
},
|
|
475
475
|
|
|
476
476
|
ensurePanesOrder: function () {
|
|
@@ -514,11 +514,11 @@ U.Map = L.Map.extend({
|
|
|
514
514
|
|
|
515
515
|
initShortcuts: function () {
|
|
516
516
|
const globalShortcuts = function (e) {
|
|
517
|
-
const key = e.keyCode
|
|
518
|
-
|
|
517
|
+
const key = e.keyCode
|
|
518
|
+
const hasModifier = (e.ctrlKey || e.metaKey) && !e.shiftKey
|
|
519
519
|
|
|
520
520
|
/* Generic shortcuts */
|
|
521
|
-
if (key === U.Keys.F &&
|
|
521
|
+
if (key === U.Keys.F && hasModifier) {
|
|
522
522
|
L.DomEvent.stop(e)
|
|
523
523
|
this.search()
|
|
524
524
|
} else if (e.keyCode === U.Keys.ESC) {
|
|
@@ -534,44 +534,44 @@ U.Map = L.Map.extend({
|
|
|
534
534
|
if (!this.hasEditMode()) return
|
|
535
535
|
|
|
536
536
|
/* Edit mode only shortcuts */
|
|
537
|
-
if (key === U.Keys.E &&
|
|
537
|
+
if (key === U.Keys.E && hasModifier && !this.editEnabled) {
|
|
538
538
|
L.DomEvent.stop(e)
|
|
539
539
|
this.enableEdit()
|
|
540
|
-
} else if (key === U.Keys.E &&
|
|
540
|
+
} else if (key === U.Keys.E && hasModifier && this.editEnabled && !this.isDirty) {
|
|
541
541
|
L.DomEvent.stop(e)
|
|
542
542
|
this.disableEdit()
|
|
543
543
|
}
|
|
544
|
-
if (key === U.Keys.S &&
|
|
544
|
+
if (key === U.Keys.S && hasModifier) {
|
|
545
545
|
L.DomEvent.stop(e)
|
|
546
546
|
if (this.isDirty) {
|
|
547
547
|
this.save()
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
if (key === U.Keys.Z &&
|
|
550
|
+
if (key === U.Keys.Z && hasModifier && this.isDirty) {
|
|
551
551
|
L.DomEvent.stop(e)
|
|
552
552
|
this.askForReset()
|
|
553
553
|
}
|
|
554
|
-
if (key === U.Keys.M &&
|
|
554
|
+
if (key === U.Keys.M && hasModifier && this.editEnabled) {
|
|
555
555
|
L.DomEvent.stop(e)
|
|
556
556
|
this.editTools.startMarker()
|
|
557
557
|
}
|
|
558
|
-
if (key === U.Keys.P &&
|
|
558
|
+
if (key === U.Keys.P && hasModifier && this.editEnabled) {
|
|
559
559
|
L.DomEvent.stop(e)
|
|
560
560
|
this.editTools.startPolygon()
|
|
561
561
|
}
|
|
562
|
-
if (key === U.Keys.L &&
|
|
562
|
+
if (key === U.Keys.L && hasModifier && this.editEnabled) {
|
|
563
563
|
L.DomEvent.stop(e)
|
|
564
564
|
this.editTools.startPolyline()
|
|
565
565
|
}
|
|
566
|
-
if (key === U.Keys.I &&
|
|
566
|
+
if (key === U.Keys.I && hasModifier && this.editEnabled) {
|
|
567
567
|
L.DomEvent.stop(e)
|
|
568
568
|
this.importer.open()
|
|
569
569
|
}
|
|
570
|
-
if (key === U.Keys.O &&
|
|
570
|
+
if (key === U.Keys.O && hasModifier && this.editEnabled) {
|
|
571
571
|
L.DomEvent.stop(e)
|
|
572
572
|
this.importer.openFiles()
|
|
573
573
|
}
|
|
574
|
-
if (key === U.Keys.H &&
|
|
574
|
+
if (key === U.Keys.H && hasModifier && this.editEnabled) {
|
|
575
575
|
L.DomEvent.stop(e)
|
|
576
576
|
this.help.show('edit')
|
|
577
577
|
}
|
|
@@ -908,16 +908,11 @@ U.Map = L.Map.extend({
|
|
|
908
908
|
},
|
|
909
909
|
|
|
910
910
|
openBrowser: function (mode) {
|
|
911
|
-
|
|
912
|
-
this.onceDatalayersLoaded(function () {
|
|
913
|
-
this.browser.open()
|
|
914
|
-
})
|
|
911
|
+
this.onceDatalayersLoaded(() => this.browser.open(mode))
|
|
915
912
|
},
|
|
916
913
|
|
|
917
|
-
|
|
918
|
-
this.
|
|
919
|
-
this._openFacet()
|
|
920
|
-
})
|
|
914
|
+
openCaption: function () {
|
|
915
|
+
this.onceDatalayersLoaded(() => this.caption.open())
|
|
921
916
|
},
|
|
922
917
|
|
|
923
918
|
eachDataLayer: function (method, context) {
|
|
@@ -969,7 +964,7 @@ U.Map = L.Map.extend({
|
|
|
969
964
|
},
|
|
970
965
|
|
|
971
966
|
checkDirty: function () {
|
|
972
|
-
|
|
967
|
+
this._container.classList.toggle('umap-is-dirty', this.isDirty)
|
|
973
968
|
},
|
|
974
969
|
|
|
975
970
|
addDirtyDatalayer: function (datalayer) {
|
|
@@ -1064,7 +1059,6 @@ U.Map = L.Map.extend({
|
|
|
1064
1059
|
else window.location = data.url
|
|
1065
1060
|
alert.content = data.info || alert.content
|
|
1066
1061
|
this.once('saved', () => this.ui.alert(alert))
|
|
1067
|
-
this.editPanel.close()
|
|
1068
1062
|
this.permissions.save()
|
|
1069
1063
|
}
|
|
1070
1064
|
},
|
|
@@ -1229,7 +1223,7 @@ U.Map = L.Map.extend({
|
|
|
1229
1223
|
handler: 'Input',
|
|
1230
1224
|
helpEntries: 'filterKey',
|
|
1231
1225
|
placeholder: L._('Default: name'),
|
|
1232
|
-
label: L._('
|
|
1226
|
+
label: L._('Search keys'),
|
|
1233
1227
|
inheritable: true,
|
|
1234
1228
|
},
|
|
1235
1229
|
],
|
|
@@ -1239,7 +1233,7 @@ U.Map = L.Map.extend({
|
|
|
1239
1233
|
handler: 'BlurInput',
|
|
1240
1234
|
helpEntries: 'facetKey',
|
|
1241
1235
|
placeholder: L._('Example: key1,key2|Label 2,key3|Label 3|checkbox'),
|
|
1242
|
-
label: L._('
|
|
1236
|
+
label: L._('Filters keys'),
|
|
1243
1237
|
},
|
|
1244
1238
|
],
|
|
1245
1239
|
[
|
|
@@ -1595,22 +1589,21 @@ U.Map = L.Map.extend({
|
|
|
1595
1589
|
'umap-about-link flat',
|
|
1596
1590
|
container,
|
|
1597
1591
|
L._('About'),
|
|
1598
|
-
this.
|
|
1592
|
+
this.openCaption,
|
|
1599
1593
|
this
|
|
1600
1594
|
)
|
|
1601
1595
|
L.DomUtil.createButton(
|
|
1602
1596
|
'umap-open-browser-link flat',
|
|
1603
1597
|
container,
|
|
1604
1598
|
L._('Browse data'),
|
|
1605
|
-
() => this.openBrowser('
|
|
1599
|
+
() => this.openBrowser('data')
|
|
1606
1600
|
)
|
|
1607
1601
|
if (this.options.facetKey) {
|
|
1608
1602
|
L.DomUtil.createButton(
|
|
1609
1603
|
'umap-open-filter-link flat',
|
|
1610
1604
|
container,
|
|
1611
|
-
L._('
|
|
1612
|
-
this.
|
|
1613
|
-
this
|
|
1605
|
+
L._('Filter data'),
|
|
1606
|
+
() => this.openBrowser('filters')
|
|
1614
1607
|
)
|
|
1615
1608
|
}
|
|
1616
1609
|
}
|
|
@@ -1747,23 +1740,23 @@ U.Map = L.Map.extend({
|
|
|
1747
1740
|
'-',
|
|
1748
1741
|
{
|
|
1749
1742
|
text: L._('See layers'),
|
|
1750
|
-
callback: () => this.openBrowser('
|
|
1743
|
+
callback: () => this.openBrowser('layers'),
|
|
1751
1744
|
},
|
|
1752
1745
|
{
|
|
1753
1746
|
text: L._('Browse data'),
|
|
1754
|
-
callback: () => this.openBrowser('
|
|
1747
|
+
callback: () => this.openBrowser('data'),
|
|
1755
1748
|
}
|
|
1756
1749
|
)
|
|
1757
1750
|
if (this.options.facetKey) {
|
|
1758
1751
|
items.push({
|
|
1759
|
-
text: L._('
|
|
1760
|
-
callback: this.
|
|
1752
|
+
text: L._('Filter data'),
|
|
1753
|
+
callback: () => this.openBrowser('filters'),
|
|
1761
1754
|
})
|
|
1762
1755
|
}
|
|
1763
1756
|
items.push(
|
|
1764
1757
|
{
|
|
1765
1758
|
text: L._('About'),
|
|
1766
|
-
callback: this.
|
|
1759
|
+
callback: this.openCaption,
|
|
1767
1760
|
},
|
|
1768
1761
|
{
|
|
1769
1762
|
text: this.help.displayLabel('SEARCH'),
|
|
@@ -463,8 +463,8 @@ U.Layer.Heat = L.HeatLayer.extend({
|
|
|
463
463
|
this._latlngs[i].alt !== undefined
|
|
464
464
|
? this._latlngs[i].alt
|
|
465
465
|
: this._latlngs[i][2] !== undefined
|
|
466
|
-
|
|
467
|
-
|
|
466
|
+
? +this._latlngs[i][2]
|
|
467
|
+
: 1
|
|
468
468
|
|
|
469
469
|
grid[y] = grid[y] || []
|
|
470
470
|
cell = grid[y][x]
|
|
@@ -863,7 +863,7 @@ U.DataLayer = L.Evented.extend({
|
|
|
863
863
|
},
|
|
864
864
|
|
|
865
865
|
isRemoteLayer: function () {
|
|
866
|
-
return
|
|
866
|
+
return Boolean(
|
|
867
867
|
this.options.remoteData &&
|
|
868
868
|
this.options.remoteData.url &&
|
|
869
869
|
this.options.remoteData.format
|
|
@@ -875,10 +875,7 @@ U.DataLayer = L.Evented.extend({
|
|
|
875
875
|
},
|
|
876
876
|
|
|
877
877
|
showFeature: function (feature) {
|
|
878
|
-
|
|
879
|
-
filter = this.map.browser.options.filter
|
|
880
|
-
if (filter && !feature.matchFilter(filter, filterKeys)) return
|
|
881
|
-
if (!feature.matchFacets()) return
|
|
878
|
+
if (feature.isFiltered()) return
|
|
882
879
|
this.layer.addLayer(feature)
|
|
883
880
|
},
|
|
884
881
|
|
|
@@ -1531,7 +1528,7 @@ U.DataLayer = L.Evented.extend({
|
|
|
1531
1528
|
},
|
|
1532
1529
|
|
|
1533
1530
|
isVisible: function () {
|
|
1534
|
-
return this.layer && this.map.hasLayer(this.layer)
|
|
1531
|
+
return Boolean(this.layer && this.map.hasLayer(this.layer))
|
|
1535
1532
|
},
|
|
1536
1533
|
|
|
1537
1534
|
getFeatureByIndex: function (index) {
|
umap/static/umap/locale/am_ET.js
CHANGED
|
@@ -83,7 +83,6 @@ const locale = {
|
|
|
83
83
|
"color": "ከለር",
|
|
84
84
|
"Comma separated list of numbers, including min and max values.": "Comma separated list of numbers, including min and max values.",
|
|
85
85
|
"Comma separated list of properties to use for sorting features. To reverse the sort, put a minus sign (-) before. Eg. mykey,-otherkey.": "Comma separated list of properties to use for sorting features. To reverse the sort, put a minus sign (-) before. Eg. mykey,-otherkey.",
|
|
86
|
-
"Comma separated list of properties to use when filtering features": "ፊቸሮችን በሚያጣሩበት ጊዜ ሊጠቀሙ የሚችሏቸው በኮማ የተከፋፈሉ የባህርያት ዝርዝር",
|
|
87
86
|
"Comma, tab or semi-colon separated values. SRS WGS84 is implied. Only Point geometries are imported. The import will look at the column headers for any mention of «lat» and «lon» at the begining of the header, case insensitive. All other column are imported as properties.": "በኮማ፣ታብ፣ግማሽኮለን የተከፋፈሉ ውጤቶች። SRSWG84 ተመላክቷል። የነጥብ ጂኦሜትሪዎች ብቻ መጥተዋል። የማምጣት ሂደቱ የኮለምን ሄደሮችን በማሰስ «ላቲትዩድ» እና «ሎንጊትዩድ» የሚሉትን ቃላት መኖር ከመጀመሪያው በመነሳት ያጣራል። ሁሉም ኮለምኖች እንደባህርይ መጥተዋል።",
|
|
88
87
|
"Congratulations, your map has been created!": "Congratulations, your map has been created!",
|
|
89
88
|
"Continue line": "መስመሩን ቀጥል",
|
|
@@ -96,7 +95,6 @@ const locale = {
|
|
|
96
95
|
"Custom background": "የተስተካከለ ጀርባ",
|
|
97
96
|
"Custom overlay": "Custom overlay",
|
|
98
97
|
"dash array": "ዳሽ አሬይ",
|
|
99
|
-
"Data browser": "የመረጃ ማሰሻ",
|
|
100
98
|
"Data is browsable": "Data is browsable",
|
|
101
99
|
"Datalayers": "Datalayers",
|
|
102
100
|
"Default interaction options": "Default interaction options",
|
|
@@ -165,16 +163,12 @@ const locale = {
|
|
|
165
163
|
"Exit Fullscreen": "Exit Fullscreen",
|
|
166
164
|
"expanded": "expanded",
|
|
167
165
|
"Extract shape to separate feature": "ፊቸሩን ለመለየት ቅርፁን ነጥለህ አውጣ",
|
|
168
|
-
"Facet keys": "Facet keys",
|
|
169
|
-
"Facet search": "Facet search",
|
|
170
166
|
"Feature identifier key": "Feature identifier key",
|
|
171
167
|
"Feature properties": "Feature properties",
|
|
172
168
|
"Fetch data each time map view changes.": "Fetch data each time map view changes.",
|
|
173
169
|
"fill color": "ከለር ሙላ",
|
|
174
170
|
"fill opacity": "ኦፓሲቲውን ሙላ",
|
|
175
171
|
"fill": "ሙላ",
|
|
176
|
-
"Filter keys": "Filter keys",
|
|
177
|
-
"Filter": "Filter",
|
|
178
172
|
"Fit all data": "Fit all data",
|
|
179
173
|
"Format": "ፎርማት",
|
|
180
174
|
"From zoom": "ከዙም",
|
|
@@ -267,7 +261,6 @@ const locale = {
|
|
|
267
261
|
"NM": "NM",
|
|
268
262
|
"No cache": "No cache",
|
|
269
263
|
"No licence has been set": "ምንም ፈቃድ አልተሰጠም",
|
|
270
|
-
"No results for these facets": "No results for these facets",
|
|
271
264
|
"No results": "No results",
|
|
272
265
|
"no": "አይደለም",
|
|
273
266
|
"No.": "No.",
|
|
@@ -332,7 +325,6 @@ const locale = {
|
|
|
332
325
|
"See layers": "See layers",
|
|
333
326
|
"See full screen": "ሙሉውን ስክሪን ተመልከት",
|
|
334
327
|
"See on OpenStreetMap": "See on OpenStreetMap",
|
|
335
|
-
"Select data": "Select data",
|
|
336
328
|
"Send me the link": "Send me the link",
|
|
337
329
|
"Set it to false to hide this layer from the slideshow, the data browser, the popup navigation…": "Set it to false to hide this layer from the slideshow, the data browser, the popup navigation…",
|
|
338
330
|
"settings": "settings",
|
|
@@ -434,9 +426,7 @@ const locale = {
|
|
|
434
426
|
"Edit map details": "Edit map details",
|
|
435
427
|
"Back to browser": "Back to browser",
|
|
436
428
|
"Toggle size": "Toggle size",
|
|
437
|
-
"Layers": "Layers",
|
|
438
429
|
"Display the caption control": "Display the caption control",
|
|
439
|
-
"Comma separated list of properties to use for facet search (eg.: mykey,otherkey). To control label, add it after a | (eg.: mykey|My Key,otherkey|Other Key). To control input field type, add it after another | (eg.: mykey|My Key|checkbox,otherkey|Other Key|datetime). Allowed values for the input field type are checkbox (default), radio, number, date and datetime.": "Comma separated list of properties to use for facet search (eg.: mykey,otherkey). To control label, add it after a | (eg.: mykey|My Key,otherkey|Other Key). To control input field type, add it after another | (eg.: mykey|My Key|checkbox,otherkey|Other Key|datetime). Allowed values for the input field type are checkbox (default), radio, number, date and datetime.",
|
|
440
430
|
"<empty value>": "<empty value>",
|
|
441
431
|
"Min": "Min",
|
|
442
432
|
"Max": "Max",
|
|
@@ -446,8 +436,17 @@ const locale = {
|
|
|
446
436
|
"Edit in OpenStreetMap": "Edit in OpenStreetMap",
|
|
447
437
|
"Cannot determine latitude and longitude columns.": "Cannot determine latitude and longitude columns.",
|
|
448
438
|
"Back to layers": "Back to layers",
|
|
449
|
-
"
|
|
450
|
-
"
|
|
439
|
+
"Filters": "Filters",
|
|
440
|
+
"Comma separated list of properties to use when filtering features by text input": "Comma separated list of properties to use when filtering features by text input",
|
|
441
|
+
"Comma separated list of properties to use for filters (eg.: mykey,otherkey). To control label, add it after a | (eg.: mykey|My Key,otherkey|Other Key). To control input field type, add it after another | (eg.: mykey|My Key|checkbox,otherkey|Other Key|datetime). Allowed values for the input field type are checkbox (default), radio, number, date and datetime.": "Comma separated list of properties to use for filters (eg.: mykey,otherkey). To control label, add it after a | (eg.: mykey|My Key,otherkey|Other Key). To control input field type, add it after another | (eg.: mykey|My Key|checkbox,otherkey|Other Key|datetime). Allowed values for the input field type are checkbox (default), radio, number, date and datetime.",
|
|
442
|
+
"Search keys": "Search keys",
|
|
443
|
+
"Filters keys": "Filters keys",
|
|
444
|
+
"Filter data": "Filter data",
|
|
445
|
+
"Search map features…": "Search map features…",
|
|
446
|
+
"Reset all": "Reset all",
|
|
447
|
+
"Browser in data mode": "Browser in data mode",
|
|
448
|
+
"Browser in layers mode": "Browser in layers mode",
|
|
449
|
+
"Browser in filters mode": "Browser in filters mode"
|
|
451
450
|
}
|
|
452
451
|
L.registerLocale("am_ET", locale)
|
|
453
452
|
L.setLocale("am_ET")
|