umap-project 2.4.1__py3-none-any.whl → 2.4.2__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/el/LC_MESSAGES/django.po +145 -90
- umap/locale/en/LC_MESSAGES/django.po +13 -13
- umap/locale/eu/LC_MESSAGES/django.po +145 -89
- umap/static/umap/base.css +1 -1
- umap/static/umap/content.css +2 -2
- umap/static/umap/css/dialog.css +1 -1
- umap/static/umap/css/importers.css +2 -0
- umap/static/umap/css/panel.css +2 -2
- umap/static/umap/css/tooltip.css +1 -1
- umap/static/umap/js/components/alerts/alert.css +1 -1
- umap/static/umap/js/components/alerts/alert.js +1 -1
- umap/static/umap/js/modules/autocomplete.js +4 -4
- umap/static/umap/js/modules/browser.js +6 -6
- umap/static/umap/js/modules/caption.js +4 -4
- umap/static/umap/js/modules/dompurify.js +2 -3
- umap/static/umap/js/modules/facets.js +16 -10
- umap/static/umap/js/modules/global.js +16 -16
- umap/static/umap/js/modules/help.js +2 -2
- umap/static/umap/js/modules/importer.js +6 -6
- umap/static/umap/js/modules/importers/geodatamine.js +4 -4
- umap/static/umap/js/modules/importers/overpass.js +2 -2
- umap/static/umap/js/modules/orderable.js +2 -2
- umap/static/umap/js/modules/request.js +1 -1
- umap/static/umap/js/modules/rules.js +13 -10
- umap/static/umap/js/modules/sync/engine.js +3 -3
- umap/static/umap/js/modules/sync/updaters.js +10 -11
- umap/static/umap/js/modules/sync/websocket.js +1 -1
- umap/static/umap/js/modules/ui/dialog.js +1 -1
- umap/static/umap/js/modules/ui/panel.js +1 -1
- umap/static/umap/js/modules/ui/tooltip.js +6 -6
- umap/static/umap/js/modules/urls.js +1 -2
- umap/static/umap/js/modules/utils.js +16 -16
- umap/static/umap/js/umap.controls.js +26 -28
- umap/static/umap/js/umap.core.js +19 -15
- umap/static/umap/js/umap.datalayer.permissions.js +15 -18
- umap/static/umap/js/umap.features.js +91 -117
- umap/static/umap/js/umap.forms.js +46 -74
- umap/static/umap/js/umap.icon.js +17 -22
- umap/static/umap/js/umap.js +79 -83
- umap/static/umap/js/umap.layer.js +151 -169
- umap/static/umap/js/umap.permissions.js +6 -9
- umap/static/umap/js/umap.popup.js +19 -19
- umap/static/umap/js/umap.share.js +9 -15
- umap/static/umap/js/umap.slideshow.js +12 -14
- umap/static/umap/js/umap.tableeditor.js +5 -5
- umap/static/umap/locale/am_ET.json +5 -2
- umap/static/umap/locale/ar.json +5 -2
- umap/static/umap/locale/ast.json +5 -2
- umap/static/umap/locale/bg.json +5 -2
- umap/static/umap/locale/br.json +5 -2
- umap/static/umap/locale/ca.json +5 -2
- umap/static/umap/locale/cs_CZ.json +5 -2
- umap/static/umap/locale/da.json +5 -2
- umap/static/umap/locale/de.json +5 -2
- umap/static/umap/locale/el.json +10 -7
- umap/static/umap/locale/en.json +4 -2
- umap/static/umap/locale/en_US.json +5 -2
- umap/static/umap/locale/es.json +4 -2
- umap/static/umap/locale/et.json +5 -2
- umap/static/umap/locale/fa_IR.json +5 -2
- umap/static/umap/locale/fi.json +5 -2
- umap/static/umap/locale/fr.json +4 -2
- umap/static/umap/locale/gl.json +5 -2
- umap/static/umap/locale/he.json +5 -2
- umap/static/umap/locale/hr.json +5 -2
- umap/static/umap/locale/hu.json +5 -2
- umap/static/umap/locale/id.json +5 -2
- umap/static/umap/locale/is.json +5 -2
- umap/static/umap/locale/it.json +5 -2
- umap/static/umap/locale/ja.json +5 -2
- umap/static/umap/locale/ko.json +5 -2
- umap/static/umap/locale/lt.json +5 -2
- umap/static/umap/locale/ms.json +5 -2
- umap/static/umap/locale/nl.json +5 -2
- umap/static/umap/locale/no.json +5 -2
- umap/static/umap/locale/pl.json +5 -2
- umap/static/umap/locale/pl_PL.json +5 -2
- umap/static/umap/locale/pt.json +4 -2
- umap/static/umap/locale/pt_BR.json +5 -2
- umap/static/umap/locale/pt_PT.json +5 -2
- umap/static/umap/locale/ro.json +5 -2
- umap/static/umap/locale/ru.json +5 -2
- umap/static/umap/locale/sk_SK.json +5 -2
- umap/static/umap/locale/sl.json +5 -2
- umap/static/umap/locale/sr.json +5 -2
- umap/static/umap/locale/sv.json +5 -2
- umap/static/umap/locale/th_TH.json +5 -2
- umap/static/umap/locale/tr.json +5 -2
- umap/static/umap/locale/uk_UA.json +5 -2
- umap/static/umap/locale/vi.json +5 -2
- umap/static/umap/locale/vi_VN.json +5 -2
- umap/static/umap/locale/zh.json +5 -2
- umap/static/umap/locale/zh_CN.json +5 -2
- umap/static/umap/locale/zh_TW.Big5.json +5 -2
- umap/static/umap/locale/zh_TW.json +5 -2
- umap/static/umap/map.css +8 -9
- umap/static/umap/vars.css +10 -0
- umap/static/umap/vendors/dompurify/purify.es.js +5 -59
- umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -1
- umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +2 -2
- umap/storage.py +1 -1
- umap/tests/integration/test_map_preview.py +36 -2
- umap/tests/test_views.py +2 -2
- umap/views.py +3 -2
- {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/METADATA +2 -2
- {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/RECORD +110 -110
- {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/WHEEL +0 -0
- {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/entry_points.txt +0 -0
- {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -61,8 +61,8 @@ L.FormBuilder.Element.include({
|
|
|
61
61
|
|
|
62
62
|
get: function (own) {
|
|
63
63
|
if (!this.options.inheritable || own) return this.builder.getter(this.field)
|
|
64
|
-
const path = this.field.split('.')
|
|
65
|
-
|
|
64
|
+
const path = this.field.split('.')
|
|
65
|
+
const key = path[path.length - 1]
|
|
66
66
|
return this.obj.getOption(key)
|
|
67
67
|
},
|
|
68
68
|
|
|
@@ -296,10 +296,9 @@ L.FormBuilder.ColorPicker = L.FormBuilder.Input.extend({
|
|
|
296
296
|
},
|
|
297
297
|
|
|
298
298
|
onBlur: function () {
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}
|
|
299
|
+
const closePicker = () => {
|
|
300
|
+
this.container.style.display = 'none'
|
|
301
|
+
}
|
|
303
302
|
// We must leave time for the click to be listened.
|
|
304
303
|
window.setTimeout(closePicker, 100)
|
|
305
304
|
},
|
|
@@ -341,7 +340,7 @@ L.FormBuilder.TextColorPicker = L.FormBuilder.ColorPicker.extend({
|
|
|
341
340
|
})
|
|
342
341
|
|
|
343
342
|
L.FormBuilder.LayerTypeChooser = L.FormBuilder.Select.extend({
|
|
344
|
-
getOptions:
|
|
343
|
+
getOptions: () => {
|
|
345
344
|
const layer_classes = [
|
|
346
345
|
U.Layer.Default,
|
|
347
346
|
U.Layer.Cluster,
|
|
@@ -353,7 +352,7 @@ L.FormBuilder.LayerTypeChooser = L.FormBuilder.Select.extend({
|
|
|
353
352
|
})
|
|
354
353
|
|
|
355
354
|
L.FormBuilder.SlideshowDelay = L.FormBuilder.IntSelect.extend({
|
|
356
|
-
getOptions:
|
|
355
|
+
getOptions: () => {
|
|
357
356
|
const options = []
|
|
358
357
|
for (let i = 1; i < 30; i++) {
|
|
359
358
|
options.push([i * 1000, L._('{delay} seconds', { delay: i })])
|
|
@@ -459,9 +458,7 @@ L.FormBuilder.BlurInput.include({
|
|
|
459
458
|
})
|
|
460
459
|
|
|
461
460
|
L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
462
|
-
type:
|
|
463
|
-
return 'hidden'
|
|
464
|
-
},
|
|
461
|
+
type: () => 'hidden',
|
|
465
462
|
|
|
466
463
|
build: function () {
|
|
467
464
|
L.FormBuilder.BlurInput.prototype.build.call(this)
|
|
@@ -517,18 +514,13 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
|
517
514
|
this
|
|
518
515
|
)
|
|
519
516
|
}
|
|
520
|
-
const symbol = L.DomUtil.add(
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
)
|
|
526
|
-
|
|
527
|
-
'button',
|
|
528
|
-
'flat tab-chars',
|
|
529
|
-
this.tabs,
|
|
530
|
-
L._('Emoji & Character')
|
|
531
|
-
)
|
|
517
|
+
const symbol = L.DomUtil.add('button', 'flat tab-symbols', this.tabs, L._('Symbol'))
|
|
518
|
+
const char = L.DomUtil.add(
|
|
519
|
+
'button',
|
|
520
|
+
'flat tab-chars',
|
|
521
|
+
this.tabs,
|
|
522
|
+
L._('Emoji & Character')
|
|
523
|
+
)
|
|
532
524
|
url = L.DomUtil.add('button', 'flat tab-url', this.tabs, L._('URL'))
|
|
533
525
|
L.DomEvent.on(symbol, 'click', L.DomEvent.stop).on(
|
|
534
526
|
symbol,
|
|
@@ -547,10 +539,10 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
|
547
539
|
|
|
548
540
|
openTab: function (name) {
|
|
549
541
|
const els = this.tabs.querySelectorAll('button')
|
|
550
|
-
for (
|
|
542
|
+
for (const el of els) {
|
|
551
543
|
L.DomUtil.removeClass(el, 'on')
|
|
552
544
|
}
|
|
553
|
-
|
|
545
|
+
const el = this.tabs.querySelector(`.tab-${name}`)
|
|
554
546
|
L.DomUtil.addClass(el, 'on')
|
|
555
547
|
this.body.innerHTML = ''
|
|
556
548
|
},
|
|
@@ -574,15 +566,15 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
|
574
566
|
},
|
|
575
567
|
|
|
576
568
|
addIconPreview: function (pictogram, parent) {
|
|
577
|
-
const baseClass = 'umap-pictogram-choice'
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
569
|
+
const baseClass = 'umap-pictogram-choice'
|
|
570
|
+
const value = pictogram.src
|
|
571
|
+
const search = U.Utils.normalize(this.searchInput.value)
|
|
572
|
+
const title = pictogram.attribution
|
|
573
|
+
? `${pictogram.name} — © ${pictogram.attribution}`
|
|
574
|
+
: pictogram.name || pictogram.src
|
|
583
575
|
if (search && U.Utils.normalize(title).indexOf(search) === -1) return
|
|
584
|
-
const className = value === this.value() ? `${baseClass} selected` : baseClass
|
|
585
|
-
|
|
576
|
+
const className = value === this.value() ? `${baseClass} selected` : baseClass
|
|
577
|
+
const container = L.DomUtil.create('div', className, parent)
|
|
586
578
|
U.Icon.makeIconElement(value, container)
|
|
587
579
|
container.title = title
|
|
588
580
|
L.DomEvent.on(
|
|
@@ -612,7 +604,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
|
612
604
|
if (name) L.DomUtil.add('h6', '', parent, name)
|
|
613
605
|
const grid = L.DomUtil.create('div', 'umap-pictogram-grid', parent)
|
|
614
606
|
let status = false
|
|
615
|
-
for (
|
|
607
|
+
for (const item of items) {
|
|
616
608
|
status = this.addIconPreview(item, grid) || status
|
|
617
609
|
}
|
|
618
610
|
if (status) this.grid.appendChild(parent)
|
|
@@ -630,7 +622,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
|
630
622
|
const sorted = Object.entries(categories).toSorted(([a], [b]) =>
|
|
631
623
|
U.Utils.naturalSort(a, b, L.lang)
|
|
632
624
|
)
|
|
633
|
-
for (
|
|
625
|
+
for (const [name, items] of sorted) {
|
|
634
626
|
this.addCategory(items, name)
|
|
635
627
|
}
|
|
636
628
|
},
|
|
@@ -701,7 +693,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
|
701
693
|
return input
|
|
702
694
|
},
|
|
703
695
|
|
|
704
|
-
unselectAll:
|
|
696
|
+
unselectAll: (container) => {
|
|
705
697
|
const els = container.querySelectorAll('div.selected')
|
|
706
698
|
for (const el in els) {
|
|
707
699
|
if (els.hasOwnProperty(el)) L.DomUtil.removeClass(els[el], 'selected')
|
|
@@ -710,9 +702,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
|
|
|
710
702
|
})
|
|
711
703
|
|
|
712
704
|
L.FormBuilder.Url = L.FormBuilder.Input.extend({
|
|
713
|
-
type:
|
|
714
|
-
return 'url'
|
|
715
|
-
},
|
|
705
|
+
type: () => 'url',
|
|
716
706
|
})
|
|
717
707
|
|
|
718
708
|
L.FormBuilder.Switch = L.FormBuilder.CheckBox.extend({
|
|
@@ -748,9 +738,9 @@ L.FormBuilder.FacetSearchChoices = L.FormBuilder.FacetSearchBase.extend({
|
|
|
748
738
|
this.container = L.DomUtil.create('fieldset', 'umap-facet', this.parentNode)
|
|
749
739
|
this.container.appendChild(this.label)
|
|
750
740
|
this.ul = L.DomUtil.create('ul', '', this.container)
|
|
751
|
-
this.type = this.options.criteria
|
|
741
|
+
this.type = this.options.criteria.type
|
|
752
742
|
|
|
753
|
-
const choices = this.options.criteria
|
|
743
|
+
const choices = this.options.criteria.choices
|
|
754
744
|
choices.sort()
|
|
755
745
|
choices.forEach((value) => this.buildLi(value))
|
|
756
746
|
},
|
|
@@ -763,7 +753,7 @@ L.FormBuilder.FacetSearchChoices = L.FormBuilder.FacetSearchBase.extend({
|
|
|
763
753
|
|
|
764
754
|
input.type = this.type
|
|
765
755
|
input.name = `${this.type}_${this.name}`
|
|
766
|
-
input.checked = this.get()
|
|
756
|
+
input.checked = this.get().choices.includes(value)
|
|
767
757
|
input.dataset.value = value
|
|
768
758
|
|
|
769
759
|
L.DomEvent.on(input, 'change', (e) => this.sync())
|
|
@@ -780,17 +770,11 @@ L.FormBuilder.FacetSearchChoices = L.FormBuilder.FacetSearchBase.extend({
|
|
|
780
770
|
})
|
|
781
771
|
|
|
782
772
|
L.FormBuilder.MinMaxBase = L.FormBuilder.FacetSearchBase.extend({
|
|
783
|
-
getInputType:
|
|
784
|
-
return type
|
|
785
|
-
},
|
|
773
|
+
getInputType: (type) => type,
|
|
786
774
|
|
|
787
|
-
getLabels:
|
|
788
|
-
return [L._('Min'), L._('Max')]
|
|
789
|
-
},
|
|
775
|
+
getLabels: () => [L._('Min'), L._('Max')],
|
|
790
776
|
|
|
791
|
-
prepareForHTML:
|
|
792
|
-
return value.valueOf()
|
|
793
|
-
},
|
|
777
|
+
prepareForHTML: (value) => value.valueOf(),
|
|
794
778
|
|
|
795
779
|
build: function () {
|
|
796
780
|
this.container = L.DomUtil.create('fieldset', 'umap-facet', this.parentNode)
|
|
@@ -856,13 +840,13 @@ L.FormBuilder.MinMaxBase = L.FormBuilder.FacetSearchBase.extend({
|
|
|
856
840
|
isMinModified: function () {
|
|
857
841
|
const default_ = this.minInput.getAttribute('value')
|
|
858
842
|
const current = this.minInput.value
|
|
859
|
-
return current
|
|
843
|
+
return current !== default_
|
|
860
844
|
},
|
|
861
845
|
|
|
862
846
|
isMaxModified: function () {
|
|
863
847
|
const default_ = this.maxInput.getAttribute('value')
|
|
864
848
|
const current = this.maxInput.value
|
|
865
|
-
return current
|
|
849
|
+
return current !== default_
|
|
866
850
|
},
|
|
867
851
|
|
|
868
852
|
toJS: function () {
|
|
@@ -880,39 +864,29 @@ L.FormBuilder.MinMaxBase = L.FormBuilder.FacetSearchBase.extend({
|
|
|
880
864
|
})
|
|
881
865
|
|
|
882
866
|
L.FormBuilder.FacetSearchNumber = L.FormBuilder.MinMaxBase.extend({
|
|
883
|
-
prepareForJS:
|
|
884
|
-
return new Number(value)
|
|
885
|
-
},
|
|
867
|
+
prepareForJS: (value) => new Number(value),
|
|
886
868
|
})
|
|
887
869
|
|
|
888
870
|
L.FormBuilder.FacetSearchDate = L.FormBuilder.MinMaxBase.extend({
|
|
889
|
-
prepareForJS:
|
|
890
|
-
return new Date(value)
|
|
891
|
-
},
|
|
871
|
+
prepareForJS: (value) => new Date(value),
|
|
892
872
|
|
|
893
|
-
toLocaleDateTime:
|
|
894
|
-
return new Date(dt.valueOf() - dt.getTimezoneOffset() * 60000)
|
|
895
|
-
},
|
|
873
|
+
toLocaleDateTime: (dt) => new Date(dt.valueOf() - dt.getTimezoneOffset() * 60000),
|
|
896
874
|
|
|
897
875
|
prepareForHTML: function (value) {
|
|
898
876
|
// Value must be in local time
|
|
899
|
-
if (isNaN(value)) return
|
|
877
|
+
if (Number.isNaN(value)) return
|
|
900
878
|
return this.toLocaleDateTime(value).toISOString().substr(0, 10)
|
|
901
879
|
},
|
|
902
880
|
|
|
903
|
-
getLabels:
|
|
904
|
-
return [L._('From'), L._('Until')]
|
|
905
|
-
},
|
|
881
|
+
getLabels: () => [L._('From'), L._('Until')],
|
|
906
882
|
})
|
|
907
883
|
|
|
908
884
|
L.FormBuilder.FacetSearchDateTime = L.FormBuilder.FacetSearchDate.extend({
|
|
909
|
-
getInputType:
|
|
910
|
-
return 'datetime-local'
|
|
911
|
-
},
|
|
885
|
+
getInputType: (type) => 'datetime-local',
|
|
912
886
|
|
|
913
887
|
prepareForHTML: function (value) {
|
|
914
888
|
// Value must be in local time
|
|
915
|
-
if (isNaN(value)) return
|
|
889
|
+
if (Number.isNaN(value)) return
|
|
916
890
|
return this.toLocaleDateTime(value).toISOString().slice(0, -1)
|
|
917
891
|
},
|
|
918
892
|
})
|
|
@@ -1020,9 +994,7 @@ L.FormBuilder.DataLayersControl = L.FormBuilder.TernaryChoices.extend({
|
|
|
1020
994
|
})
|
|
1021
995
|
|
|
1022
996
|
L.FormBuilder.Range = L.FormBuilder.FloatInput.extend({
|
|
1023
|
-
type:
|
|
1024
|
-
return 'range'
|
|
1025
|
-
},
|
|
997
|
+
type: () => 'range',
|
|
1026
998
|
|
|
1027
999
|
value: function () {
|
|
1028
1000
|
return L.DomUtil.hasClass(this.wrapper, 'undefined')
|
|
@@ -1124,7 +1096,7 @@ U.FormBuilder = L.FormBuilder.extend({
|
|
|
1124
1096
|
},
|
|
1125
1097
|
|
|
1126
1098
|
computeDefaultOptions: function () {
|
|
1127
|
-
for (
|
|
1099
|
+
for (const [key, schema] of Object.entries(U.SCHEMA)) {
|
|
1128
1100
|
if (schema.type === Boolean) {
|
|
1129
1101
|
if (schema.nullable) schema.handler = 'NullableChoices'
|
|
1130
1102
|
else schema.handler = 'Switch'
|
umap/static/umap/js/umap.icon.js
CHANGED
|
@@ -12,12 +12,12 @@ U.Icon = L.DivIcon.extend({
|
|
|
12
12
|
options = L.Util.extend({}, default_options, options)
|
|
13
13
|
L.Icon.prototype.initialize.call(this, options)
|
|
14
14
|
this.feature = this.options.feature
|
|
15
|
-
if (this.feature
|
|
15
|
+
if (this.feature?.isReadOnly()) {
|
|
16
16
|
this.options.className += ' readonly'
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
|
|
20
|
-
_setRecent:
|
|
20
|
+
_setRecent: (url) => {
|
|
21
21
|
if (U.Utils.hasVar(url)) return
|
|
22
22
|
if (url === U.SCHEMA.iconUrl.default) return
|
|
23
23
|
if (U.Icon.RECENT.indexOf(url) === -1) {
|
|
@@ -27,7 +27,7 @@ U.Icon = L.DivIcon.extend({
|
|
|
27
27
|
|
|
28
28
|
_getIconUrl: function (name) {
|
|
29
29
|
let url
|
|
30
|
-
if (this.feature
|
|
30
|
+
if (this.feature?._getIconUrl(name)) {
|
|
31
31
|
url = this.feature._getIconUrl(name)
|
|
32
32
|
this._setRecent(url)
|
|
33
33
|
} else {
|
|
@@ -49,14 +49,10 @@ U.Icon = L.DivIcon.extend({
|
|
|
49
49
|
return this.map.getDefaultOption('iconOpacity')
|
|
50
50
|
},
|
|
51
51
|
|
|
52
|
-
formatUrl:
|
|
53
|
-
|
|
54
|
-
url || '',
|
|
55
|
-
feature ? feature.extendedProperties() : {}
|
|
56
|
-
)
|
|
57
|
-
},
|
|
52
|
+
formatUrl: (url, feature) =>
|
|
53
|
+
U.Utils.greedyTemplate(url || '', feature ? feature.extendedProperties() : {}),
|
|
58
54
|
|
|
59
|
-
onAdd:
|
|
55
|
+
onAdd: () => {},
|
|
60
56
|
})
|
|
61
57
|
|
|
62
58
|
U.Icon.Default = U.Icon.extend({
|
|
@@ -74,8 +70,8 @@ U.Icon.Default = U.Icon.extend({
|
|
|
74
70
|
|
|
75
71
|
_setIconStyles: function (img, name) {
|
|
76
72
|
U.Icon.prototype._setIconStyles.call(this, img, name)
|
|
77
|
-
const color = this._getColor()
|
|
78
|
-
|
|
73
|
+
const color = this._getColor()
|
|
74
|
+
const opacity = this._getOpacity()
|
|
79
75
|
this.elements.container.style.backgroundColor = color
|
|
80
76
|
this.elements.arrow.style.borderTopColor = color
|
|
81
77
|
this.elements.container.style.opacity = opacity
|
|
@@ -189,10 +185,10 @@ U.Icon.Cluster = L.DivIcon.extend({
|
|
|
189
185
|
},
|
|
190
186
|
|
|
191
187
|
createIcon: function () {
|
|
192
|
-
const container = L.DomUtil.create('div', 'leaflet-marker-icon marker-cluster')
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
188
|
+
const container = L.DomUtil.create('div', 'leaflet-marker-icon marker-cluster')
|
|
189
|
+
const div = L.DomUtil.create('div', '', container)
|
|
190
|
+
const span = L.DomUtil.create('span', '', div)
|
|
191
|
+
const backgroundColor = this.datalayer.getColor()
|
|
196
192
|
span.textContent = this.cluster.getChildCount()
|
|
197
193
|
div.style.backgroundColor = backgroundColor
|
|
198
194
|
return container
|
|
@@ -201,18 +197,17 @@ U.Icon.Cluster = L.DivIcon.extend({
|
|
|
201
197
|
computeTextColor: function (el) {
|
|
202
198
|
let color
|
|
203
199
|
const backgroundColor = this.datalayer.getColor()
|
|
204
|
-
if (this.datalayer.options.cluster
|
|
200
|
+
if (this.datalayer.options.cluster?.textColor) {
|
|
205
201
|
color = this.datalayer.options.cluster.textColor
|
|
206
202
|
}
|
|
207
203
|
return color || L.DomUtil.TextColorFromBackgroundColor(el, backgroundColor)
|
|
208
204
|
},
|
|
209
205
|
})
|
|
210
206
|
|
|
211
|
-
U.Icon.isImg =
|
|
212
|
-
|
|
213
|
-
}
|
|
207
|
+
U.Icon.isImg = (src) =>
|
|
208
|
+
U.Utils.isPath(src) || U.Utils.isRemoteUrl(src) || U.Utils.isDataImage(src)
|
|
214
209
|
|
|
215
|
-
U.Icon.makeIconElement =
|
|
210
|
+
U.Icon.makeIconElement = (src, parent) => {
|
|
216
211
|
let icon
|
|
217
212
|
if (U.Icon.isImg(src)) {
|
|
218
213
|
icon = L.DomUtil.create('img')
|
|
@@ -225,7 +220,7 @@ U.Icon.makeIconElement = function (src, parent) {
|
|
|
225
220
|
return icon
|
|
226
221
|
}
|
|
227
222
|
|
|
228
|
-
U.Icon.setIconContrast =
|
|
223
|
+
U.Icon.setIconContrast = (icon, parent, src, bgcolor) => {
|
|
229
224
|
/*
|
|
230
225
|
* icon: the element we'll adapt the style, it can be an image or text
|
|
231
226
|
* parent: the element we'll consider to decide whether to adapt the style,
|