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.

Files changed (156) hide show
  1. umap/__init__.py +1 -1
  2. umap/locale/pl/LC_MESSAGES/django.mo +0 -0
  3. umap/locale/pl/LC_MESSAGES/django.po +83 -78
  4. umap/locale/pt/LC_MESSAGES/django.mo +0 -0
  5. umap/locale/pt/LC_MESSAGES/django.po +129 -123
  6. umap/static/umap/base.css +85 -44
  7. umap/static/umap/css/icon.css +6 -0
  8. umap/static/umap/css/panel.css +9 -4
  9. umap/static/umap/img/16.svg +2 -2
  10. umap/static/umap/img/source/16.svg +3 -3
  11. umap/static/umap/js/modules/browser.js +58 -24
  12. umap/static/umap/js/modules/caption.js +118 -0
  13. umap/static/umap/js/modules/facets.js +14 -39
  14. umap/static/umap/js/modules/global.js +2 -0
  15. umap/static/umap/js/modules/orderable.js +1 -1
  16. umap/static/umap/js/modules/panel.js +13 -7
  17. umap/static/umap/js/modules/schema.js +4 -4
  18. umap/static/umap/js/modules/urls.js +1 -1
  19. umap/static/umap/js/modules/utils.js +9 -1
  20. umap/static/umap/js/umap.controls.js +40 -110
  21. umap/static/umap/js/umap.core.js +19 -20
  22. umap/static/umap/js/umap.features.js +8 -2
  23. umap/static/umap/js/umap.forms.js +95 -34
  24. umap/static/umap/js/umap.js +47 -54
  25. umap/static/umap/js/umap.layer.js +5 -8
  26. umap/static/umap/js/umap.popup.js +1 -0
  27. umap/static/umap/locale/am_ET.js +11 -12
  28. umap/static/umap/locale/am_ET.json +11 -12
  29. umap/static/umap/locale/ar.js +11 -12
  30. umap/static/umap/locale/ar.json +11 -12
  31. umap/static/umap/locale/ast.js +11 -12
  32. umap/static/umap/locale/ast.json +11 -12
  33. umap/static/umap/locale/bg.js +11 -12
  34. umap/static/umap/locale/bg.json +11 -12
  35. umap/static/umap/locale/br.js +11 -12
  36. umap/static/umap/locale/br.json +11 -12
  37. umap/static/umap/locale/ca.js +11 -12
  38. umap/static/umap/locale/ca.json +11 -12
  39. umap/static/umap/locale/cs_CZ.js +11 -12
  40. umap/static/umap/locale/cs_CZ.json +11 -12
  41. umap/static/umap/locale/da.js +11 -12
  42. umap/static/umap/locale/da.json +11 -12
  43. umap/static/umap/locale/de.js +11 -12
  44. umap/static/umap/locale/de.json +11 -12
  45. umap/static/umap/locale/el.js +11 -12
  46. umap/static/umap/locale/el.json +11 -12
  47. umap/static/umap/locale/en.js +11 -12
  48. umap/static/umap/locale/en.json +11 -12
  49. umap/static/umap/locale/en_US.json +11 -12
  50. umap/static/umap/locale/es.js +11 -12
  51. umap/static/umap/locale/es.json +11 -12
  52. umap/static/umap/locale/et.js +11 -12
  53. umap/static/umap/locale/et.json +11 -12
  54. umap/static/umap/locale/eu.js +27 -16
  55. umap/static/umap/locale/eu.json +27 -16
  56. umap/static/umap/locale/fa_IR.js +11 -12
  57. umap/static/umap/locale/fa_IR.json +11 -12
  58. umap/static/umap/locale/fi.js +11 -12
  59. umap/static/umap/locale/fi.json +11 -12
  60. umap/static/umap/locale/fr.js +11 -12
  61. umap/static/umap/locale/fr.json +11 -12
  62. umap/static/umap/locale/gl.js +11 -12
  63. umap/static/umap/locale/gl.json +11 -12
  64. umap/static/umap/locale/he.js +11 -12
  65. umap/static/umap/locale/he.json +11 -12
  66. umap/static/umap/locale/hr.js +11 -12
  67. umap/static/umap/locale/hr.json +11 -12
  68. umap/static/umap/locale/hu.js +29 -30
  69. umap/static/umap/locale/hu.json +29 -30
  70. umap/static/umap/locale/id.js +11 -12
  71. umap/static/umap/locale/id.json +11 -12
  72. umap/static/umap/locale/is.js +11 -12
  73. umap/static/umap/locale/is.json +11 -12
  74. umap/static/umap/locale/it.js +11 -12
  75. umap/static/umap/locale/it.json +11 -12
  76. umap/static/umap/locale/ja.js +11 -12
  77. umap/static/umap/locale/ja.json +11 -12
  78. umap/static/umap/locale/ko.js +11 -12
  79. umap/static/umap/locale/ko.json +11 -12
  80. umap/static/umap/locale/lt.js +11 -12
  81. umap/static/umap/locale/lt.json +11 -12
  82. umap/static/umap/locale/ms.js +20 -21
  83. umap/static/umap/locale/ms.json +20 -21
  84. umap/static/umap/locale/nl.js +11 -12
  85. umap/static/umap/locale/nl.json +11 -12
  86. umap/static/umap/locale/no.js +11 -12
  87. umap/static/umap/locale/no.json +11 -12
  88. umap/static/umap/locale/pl.js +11 -12
  89. umap/static/umap/locale/pl.json +11 -12
  90. umap/static/umap/locale/pl_PL.json +11 -12
  91. umap/static/umap/locale/pt.js +11 -12
  92. umap/static/umap/locale/pt.json +11 -12
  93. umap/static/umap/locale/pt_BR.js +11 -12
  94. umap/static/umap/locale/pt_BR.json +11 -12
  95. umap/static/umap/locale/pt_PT.js +11 -12
  96. umap/static/umap/locale/pt_PT.json +11 -12
  97. umap/static/umap/locale/ro.js +11 -12
  98. umap/static/umap/locale/ro.json +11 -12
  99. umap/static/umap/locale/ru.js +11 -12
  100. umap/static/umap/locale/ru.json +11 -12
  101. umap/static/umap/locale/si.js +240 -227
  102. umap/static/umap/locale/si.json +240 -227
  103. umap/static/umap/locale/sk_SK.js +11 -12
  104. umap/static/umap/locale/sk_SK.json +11 -12
  105. umap/static/umap/locale/sl.js +11 -12
  106. umap/static/umap/locale/sl.json +11 -12
  107. umap/static/umap/locale/sr.js +11 -12
  108. umap/static/umap/locale/sr.json +11 -12
  109. umap/static/umap/locale/sv.js +11 -12
  110. umap/static/umap/locale/sv.json +11 -12
  111. umap/static/umap/locale/th_TH.js +11 -12
  112. umap/static/umap/locale/th_TH.json +11 -12
  113. umap/static/umap/locale/tr.js +11 -12
  114. umap/static/umap/locale/tr.json +11 -12
  115. umap/static/umap/locale/uk_UA.js +11 -12
  116. umap/static/umap/locale/uk_UA.json +11 -12
  117. umap/static/umap/locale/vi.js +11 -12
  118. umap/static/umap/locale/vi.json +11 -12
  119. umap/static/umap/locale/vi_VN.json +11 -12
  120. umap/static/umap/locale/zh.js +11 -12
  121. umap/static/umap/locale/zh.json +11 -12
  122. umap/static/umap/locale/zh_CN.json +11 -12
  123. umap/static/umap/locale/zh_TW.Big5.json +11 -12
  124. umap/static/umap/locale/zh_TW.js +11 -12
  125. umap/static/umap/locale/zh_TW.json +11 -12
  126. umap/static/umap/map.css +17 -2
  127. umap/static/umap/unittests/utils.js +7 -0
  128. umap/static/umap/vars.css +10 -0
  129. umap/static/umap/vendors/dompurify/purify.es.js +96 -12
  130. umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -1
  131. umap/tests/base.py +1 -0
  132. umap/tests/integration/conftest.py +5 -4
  133. umap/tests/integration/test_browser.py +11 -2
  134. umap/tests/integration/test_caption.py +27 -0
  135. umap/tests/integration/test_choropleth.py +1 -1
  136. umap/tests/integration/test_draw_polygon.py +6 -0
  137. umap/tests/integration/test_draw_polyline.py +6 -0
  138. umap/tests/integration/test_edit_datalayer.py +34 -5
  139. umap/tests/integration/test_edit_map.py +4 -4
  140. umap/tests/integration/test_edit_marker.py +6 -6
  141. umap/tests/integration/test_edit_polygon.py +6 -6
  142. umap/tests/integration/test_facets_browser.py +85 -13
  143. umap/tests/integration/test_map.py +0 -15
  144. umap/tests/integration/test_view_marker.py +17 -0
  145. {umap_project-2.2.2.dist-info → umap_project-2.3.1.dist-info}/METADATA +9 -8
  146. {umap_project-2.2.2.dist-info → umap_project-2.3.1.dist-info}/RECORD +149 -154
  147. {umap_project-2.2.2.dist-info → umap_project-2.3.1.dist-info}/WHEEL +1 -1
  148. umap/.DS_Store +0 -0
  149. umap/static/.DS_Store +0 -0
  150. umap/static/umap/.DS_Store +0 -0
  151. umap/static/umap/favicons/.DS_Store +0 -0
  152. umap/static/umap/fonts/.DS_Store +0 -0
  153. umap/tests/.DS_Store +0 -0
  154. umap/tests/integration/.DS_Store +0 -0
  155. {umap_project-2.2.2.dist-info → umap_project-2.3.1.dist-info}/entry_points.txt +0 -0
  156. {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.FacetSearchChoices = L.FormBuilder.Element.extend({
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.Element.extend({
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
- castValue: function (value) {
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
- this.minInput.valueAsNumber = this.castValue(min)
820
- this.minInput.dataset.value = min
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
- this.maxInput.valueAsNumber = this.castValue(max)
831
- this.maxInput.dataset.value = max
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', (e) => this.sync())
835
- L.DomEvent.on(this.maxInput, 'change', (e) => this.sync())
851
+ L.DomEvent.on(this.minInput, 'change', () => this.sync())
852
+ L.DomEvent.on(this.maxInput, 'change', () => this.sync())
836
853
  },
837
854
 
838
- buildLabel: function () {
839
- this.label = L.DomUtil.element({
840
- tagName: 'legend',
841
- textContent: this.options.label,
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
- return {
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
- castValue: function (value) {
858
- return value.valueOf() - value.getTimezoneOffset() * 60000
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
- let value = (this.backup = this.toHTML())
882
- if (!this.container.querySelector(`input[type="radio"][value="${value}"]`))
883
- value =
884
- typeof this.options.default !== 'undefined'
885
- ? this.options.default
886
- : this.default
887
- this.container.querySelector(`input[type="radio"][value="${value}"]`).checked = true
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 () {
@@ -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.openBrowser('expanded')
217
+ this.panel.setDefaultMode('expanded')
218
+ this.openBrowser('data')
215
219
  } else if (this.options.onLoadPanel === 'datalayers') {
216
- this.openBrowser('condensed')
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.mode = 'condensed'
219
- this.displayCaption()
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.facets.redraw()
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
- L.DomUtil.classIf(
390
- document.body,
391
- 'umap-caption-bar-enabled',
392
- this.options.captionBar ||
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
- modifierKey = e.ctrlKey || e.metaKey
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 && modifierKey) {
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 && modifierKey && !this.editEnabled) {
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 && modifierKey && this.editEnabled && !this.isDirty) {
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 && modifierKey) {
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 && modifierKey && this.isDirty) {
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 && modifierKey && this.editEnabled) {
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 && modifierKey && this.editEnabled) {
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 && modifierKey && this.editEnabled) {
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 && modifierKey && this.editEnabled) {
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 && modifierKey && this.editEnabled) {
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 && modifierKey && this.editEnabled) {
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
- if (mode) this.panel.mode = mode
912
- this.onceDatalayersLoaded(function () {
913
- this.browser.open()
914
- })
911
+ this.onceDatalayersLoaded(() => this.browser.open(mode))
915
912
  },
916
913
 
917
- openFacet: function () {
918
- this.onceDataLoaded(function () {
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
- L.DomUtil.classIf(this._container, 'umap-is-dirty', this.isDirty)
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._('Filter keys'),
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._('Facet keys'),
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.displayCaption,
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('expanded')
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._('Select data'),
1612
- this.openFacet,
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('condensed'),
1743
+ callback: () => this.openBrowser('layers'),
1751
1744
  },
1752
1745
  {
1753
1746
  text: L._('Browse data'),
1754
- callback: () => this.openBrowser('expanded'),
1747
+ callback: () => this.openBrowser('data'),
1755
1748
  }
1756
1749
  )
1757
1750
  if (this.options.facetKey) {
1758
1751
  items.push({
1759
- text: L._('Facet search'),
1760
- callback: this.openFacet,
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.displayCaption,
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
- ? +this._latlngs[i][2]
467
- : 1
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
- const filterKeys = this.map.getFilterKeys(),
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) {
@@ -55,6 +55,7 @@ U.Popup.Panel = U.Popup.extend({
55
55
  },
56
56
 
57
57
  onAdd: function (map) {
58
+ map.panel.setDefaultMode('expanded')
58
59
  map.panel.open({
59
60
  content: this._content,
60
61
  actions: [U.Browser.backButton(map)],
@@ -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
- "Data": "Data",
450
- "Filters": "Filters"
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")