obsidian-map-view icon indicating copy to clipboard operation
obsidian-map-view copied to clipboard

Custom marker colours for map icons no longer work

Open huy-vuong opened this issue 2 years ago • 4 comments

Version

I just upgraded to 3.0.1 (though I might've been on something older than 3.0.0 before; quite possibly 2.2.0 or older).

Expected Behaviour

  • Background colours support custom colours (rgb(), rgba(), hexadecimals, etc.) as well as text-based colours.

Actual Behaviour

  • I noticed that the background colours for all of my pins no longer show up and I have no background whatsoever (just icons).
    • From playing with a fresh data.json, it looks like custom colours like rgb(126, 208, 255) or #7ED0FF don't work anymore.
  • Meanwhile, text colours like red or yellow still appear to work.

Notes

  • From what Leaflet.ExtraMarkers indicates, non-text colours work if the svg property is set to true. Would that be related to the root cause?
  • Happy to help test this in older versions like 3.0.0 or 2.3.0 too, but I haven't figured out how in Obsidian to downgrade versions.
    • Could also check out the source again if there isn't one.

huy-vuong avatar Feb 22 '23 09:02 huy-vuong

In 3.0.0 I did a major revision to how map markers are shown, because leaflet.ExtraMarkers became horribly slow when scaling to thousands of markers, so I wrote some custom rendering code that is substantially faster. It's quite certain that this is where it broke. I'll work on supporting it back.

esm7 avatar Feb 23 '23 07:02 esm7

In 3.0.0 I did a major revision to how map markers are shown, because leaflet.ExtraMarkers became horribly slow when scaling to thousands of markers, so I wrote some custom rendering code that is substantially faster. It's quite certain that this is where it broke. I'll work on supporting it back.

That'd make sense. Definitely noticed the performance boost, so that part's real nice. ^_^

Thanks!

huy-vuong avatar Feb 23 '23 08:02 huy-vuong

To clarify: is the property you are modifying iconColor or markerColor?

esm7 avatar Feb 23 '23 10:02 esm7

I'm modifying markerColor.

huy-vuong avatar Feb 23 '23 13:02 huy-vuong