Skip to content

Google Maps: Custom Markers (AdvancedMapMarker) #244

Closed
@abigailojeda

Description

@abigailojeda

📚 Is your documentation request related to a problem?

I'm trying to add some markers with icon to my map but I can't find the issue. I'm not getting an error or anything, it just does not show.

This is what I have tried:

<script> const handleReady = async () => { console.log(maps.value.map); markers.value.forEach((marker) => { const markerContent = document.createElement('div'); markerContent.innerHTML = `

`; maps.value.createAdvancedMapMarker({ position: marker.position, content: markerContent.firstChild as Node, }).then((mapMarker: any) => { mapMarker.setMap(maps.value.map); // console.log('Marker added:', mapMarker.map); }).catch((error: any) => { console.error('Error adding marker:', error); }); }); } </script>

Thanks for your help!

🔍 Where should you find it?

This is the only thing I have found on the docs(Guide section) but it is quite vage.

ℹ️ Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions