fix: make default picto always white for now

fix #1594
This commit is contained in:
Yohan Boniface 2024-02-14 18:37:26 +01:00
parent 34608f55c1
commit 9e805ea8da
4 changed files with 9 additions and 6 deletions

View file

@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="circle" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
<path d="M14,7.5c0,3.5899-2.9101,6.5-6.5,6.5S1,11.0899,1,7.5S3.9101,1,7.5,1S14,3.9101,14,7.5z"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" id="circle" width="15" height="15" viewBox="0 0 15 15" sodipodi:docname="marker.svg" inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<defs id="defs1" />
<sodipodi:namedview id="namedview1" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" inkscape:zoom="53.666667" inkscape:cx="7.4906832" inkscape:cy="7.5" inkscape:window-width="1920" inkscape:window-height="1011" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="circle" />
<path d="M14,7.5c0,3.5899-2.9101,6.5-6.5,6.5S1,11.0899,1,7.5S3.9101,1,7.5,1S14,3.9101,14,7.5z" id="path1" style="fill:#ffffff" />
</svg>

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -682,7 +682,7 @@ L.FormBuilder.IconUrl = L.FormBuilder.BlurInput.extend({
},
isDefault: function () {
return !this.value() || this.value() === this.obj.getMap().options.default_iconUrl
return !this.value() || this.value() === U.DEFAULT_ICON_URL
},
showSymbolsTab: async function () {

View file

@ -222,7 +222,7 @@ U.Icon.setIconContrast = function (icon, parent, src, bgcolor) {
if (L.DomUtil.contrastedColor(parent, bgcolor)) {
// Decide whether to switch svg to white or not, but do it
// only for internal SVG, as invert could do weird things
if (L.Util.isPath(src) && src.endsWith('.svg')) {
if (L.Util.isPath(src) && src.endsWith('.svg') && src !== U.DEFAULT_ICON_URL) {
// Must be called after icon container is added to the DOM
// An image
icon.style.filter = 'invert(1)'

View file

@ -139,6 +139,7 @@ U.Map = L.Map.extend({
this.setOptionsFromQueryString(geojson.properties)
L.Map.prototype.initialize.call(this, el, geojson.properties)
U.DEFAULT_ICON_URL = this.options.default_iconUrl
// After calling parent initialize, as we are doing initCenter our-selves
if (geojson.geometry) this.options.center = this.latLng(geojson.geometry)