Custom Google map markers from the collection property

Hello, Team WeWeb.

I’m using custom markers from the Supabase and show them on Google Map.
I can set static markers and it works well. I want to use an option to use marker images from Supabase.

As Supabase doesn’t know, which theme is applied, I have some wrapper, which transforms marker: "default" to marker: "map-light-default.svg".

My function:

//return null; // debug only to prevent map reload on every keypress
const col = collections['9f9e6e8d-51c2-40ef-9e55-58474b914110']?.['data'];

var theme = variables['17f294ed-2c25-4322-9e57-37f16c725137']; // Set your theme here

// Loop through each object in the array
col.forEach(function(item) {
    // Check if the marker already contains ".svg"
    if (!item.marker.includes(".svg")){
        // Append theme and ".svg" to the marker property
        item.marker = "map-" + theme + "-" + item.marker + ".svg";
    }
});

return col;

I can’t see my markers. Maybe I should set the full url instead of filename?

Yes, it requires a full url instead of file name.