[Google Maps Library] Complex custom marker parameters proper JSON format

Forge Component
Published on 26 Feb by Labs
22 votes
Published on 26 Feb by Labs


I'm trying to add a complex marker to the map with this marker options:

SyntaxEditor Code Snippet

    title: 'test',
icon: {        size: new google.maps.Size(32,32),
           scaledSize: new google.maps.Size(32,32),
           origin: new google.maps.Point(0,0),
           url: ""data:image/png;base64," + BinaryToBase64(GetPicture.Picture)  + """,
           anchor: new google.maps.Point(0,16)}

however I have error on console:


 JSON Parse error: Unexpected identifier "newgoogle"

I've used example from this post https://www.outsystems.com/forums/discussion/20425/google-map-mobile-on-marker-click/#Post79826 MarkerEventTest.oap and assigned above mentioned value into to MapMarker.MarkerOptions variable.

What should be proper format to not cause son parse error?

PS: it is probably related to using CorrectJSONStringForParse on Mobile maps component on GetOptionsObject

Thank you

Hi Mykola,

Currently adding images in base64 is not supported by our component, could you use a direct url link instead?

Thank you,


Hi Hugo, 

Images are in database.

I currently using a workaround adding markers via JS node...

I believe problem is not in base 64 but in a way that parameters are parsed. As Even with url I would need to put anchor points and size via new google.maps. and that what causes the error. 

Do you plan to support this custom markers parameters in future updates? 

Thank you.