Rename var in popup.js
This commit is contained in:
parent
48ab865b9a
commit
50e8161b89
1 changed files with 6 additions and 6 deletions
|
@ -270,17 +270,17 @@ L.U.PopupTemplate.OSM = L.U.PopupTemplate.Default.extend({
|
|||
const color = this.feature.getDynamicOption('color')
|
||||
title.style.backgroundColor = color
|
||||
const iconUrl = this.feature.getDynamicOption('iconUrl')
|
||||
let img
|
||||
let icon
|
||||
if (L.Util.isPath(iconUrl) || L.Util.isRemoteUrl(iconUrl) || L.Util.isDataImage(iconUrl)) {
|
||||
img = L.DomUtil.add('img', 'popup-icon', title)
|
||||
img.src = iconUrl
|
||||
icon = L.DomUtil.add('img', 'popup-icon', title)
|
||||
icon.src = iconUrl
|
||||
} else {
|
||||
img = L.DomUtil.add('span', 'popup-icon', title)
|
||||
img.textContent = iconUrl
|
||||
icon = L.DomUtil.add('span', 'popup-icon', title)
|
||||
icon.textContent = iconUrl
|
||||
}
|
||||
if (L.DomUtil.contrastedColor(title, color)) {
|
||||
if (L.Util.isPath(iconUrl) && iconUrl.endsWith('.svg')) {
|
||||
img.style.filter = 'invert(1)'
|
||||
icon.style.filter = 'invert(1)'
|
||||
}
|
||||
title.style.color = 'white'
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue