493
Views
3
Comments
[Google Maps Web] Custom marker image not working
Question
google-maps-web
Web icon
Forge asset by Labs
Hi,
I'm trying to add custom image to a map marker in base64 using in Marker Options
"
{
icon: {size: new google.maps.Size(220,220),
           scaledSize: new google.maps.Size(32,32),
           origin: new google.maps.Point(0,0),
           url: ""data:image/png;base64," + BinaryToBase64(Picture)  + """,
           anchor: new google.maps.Point(16,16)}
}"
But marker in this case is not displayed at all.

I've tried to put manually JS form google maps api from this example https://jsfiddle.net/J7mf7/1/ and it worked fine. But I would like to use this component for this task as it is more reusable. Will apreciate any help.
Thank you.

Best regards,
Nick
2016-04-22 00-29-45
Nuno Reis
 
MVP
I made it very easy by just following Google API examples.
I end up with an AddCoordinateMarkerToMap action with TriggeringEvent ="click" and Handler

"{draggable: false, title: 'Name', icon: 'img/Image.png'}"
2021-05-05 13-05-18
Mykola (Nick) Tkachenko
The problem was in GenerateMarkerOptionsByPosition action that repleces } with  , and appends coordinates value. And in case of nested options the worng } was replaced. So I've made small change to this action replacing { (that always first one) - see attached image.
Screen Shot 2016-04-28 at 12.09.08.png
2018-05-10 22-41-57
Carlos Filipe Simões
Staff
Hey, Mykola,

Thank you for sharing! We'll update the component to allow you to pass these parameters without having to modify it.

Best regards,

Carlos Simões
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.