[Google Maps Mobile] Markers options are not applied

[Google Maps Mobile] Markers options are not applied

  
Forge Component
(9)
Published on 11 Oct (8 days ago) by Labs
9 votes
Published on 11 Oct (8 days ago) by Labs

Hi,

On our app on the map we have custom markers icons and markers Options I have this code:

SyntaxEditor Code Snippet

"          
{""size"": ""new google.maps.Size(21,25)"",
""scaledSize"": ""new google.maps.Size(21,25)"",
""origin"": ""new google.maps.Point(0,0)"",
""anchor"": ""new google.maps.Point(0,13)""}
"

but markers size is not affected - it shows full size marker image.

Are the markers options wrong or I'm using it incorrectly?

Thank you.

I think maybe too many "-symbols. Have you tried this?

"{
  size: new google.maps.Size(21,25),
  scaledSize: new google.maps.Size(21,25),
  origin: new google.maps.Point(0,0),
  anchor: new google.maps.Point(0,13)
}"

Hi Frans.

This is quite old thread and the code mentioned above is currently working fine - can be due to plugin updates. Your code without "-symbols gives "Error parsing options JSON string. Using default options." warning message.

Mykola (Nick) Tkachenko wrote:

Hi Frans.

This is quite old thread and the code mentioned above is currently working fine - can be due to plugin updates. Your code without "-symbols gives "Error parsing options JSON string. Using default options." warning message.

OK, that's odd. Maybe your code is used in a different context? I have similar code that is fine using that syntax.

I did not pay attention to the date. Perhaps you could mark your question as solved if it is no longer valid?


Hi Mykola,


Currently, I'm using the same way as yours to set Point for labelOrigin but it doesn't because the value set to labelOrigin is a String but not a Point object. Are you sure it's still working for you? And if so could you find where this string is converted and initialized as an object?


Thanks,

Marshall