Problem/Motivation
When adding a custom icon via the backend of Drupal at for example: "/admin/structure/block-content/manage/map/display" but the type doesn't really matter the custom icon is not shown.
This is due to the fact that inside of "LeafletMarkerIcon.js"
we have:
if (!currentIcon) {
if (this.settings.marker_icon_path === 'string') {
iconUrl = this.settings.marker_icon_path;
} else {
return;
}
} else {
iconUrl = currentIcon;
}
This code checks if marker_icon_path is a string, but we should check if typeof marker_icon_path is a string as we did above (more or less):
if (typeof marker.wrapper !== 'undefined') {
currentIcon = marker.wrapper.dataset.icon ?? null;
}
When changing the code to add "typeof" my custom marker icon is shown properly.

Steps to reproduce
Utilize a custom marker icon inside of leaflet maps.
Proposed resolution
Add typeof.
Remaining tasks
Review the code
Comments
Comment #3
mschudders commentedit's just this commit: https://git.drupalcode.org/issue/geolocation-3562586/-/commit/9503b5d1dc...
Probably it started of 3.x I guess. Will wait if I need to change.
Comment #5
christianadamski commentedThanks!