[Google Maps Mobile] Error parsing options JSON string. Using defaut options

[Google Maps Mobile] Error parsing options JSON string. Using defaut options

  
Forge Component
(9)
Published on 24 May by Labs
9 votes
Published on 24 May by Labs

Error parsing options JSON string. Using defaut options

Hello Eduardo,

As I have being using this component lately without problems, I'll assume you have an error in the JSON options you are providing for the component.

If you want, you can share here and we can try to figure out what is the problem.

Cheers,
Eduardo Jauch

The error occurs the moment I open the screen

"{'mapTypeId': google.maps.MapTypeId.TERRAIN}"

Hi Eduardo,

In your screenshot you have {'mapTypeId': 'google.maps.MapTypeId.TERRAIN'} (the constant is between single quotes) but on the code you pasted, it has no quotes.

Which one do you have in your code now? I would expect it to not work with the quotes in there, as that's a constant, not a string.

Please clarify this point, and if you get the error without quotes it would be helpful if you post an oml with the problem occurring.

Cheers

Hello Eduardo,

In the image, the configuration is "different" from the text you put here. It is with single quotes around the type:

"{'mapTypeId': 'google.maps.MapTypeId.TERRAIN'}"

Remove the single quotes and set like this:

"{""mapTypeId"": google.maps.MapTypeId.TERRAIN}"

Cheers,
Eduardo Jauch

The last one I put on was this way.

"{'mapTypeId': google.maps.MapTypeId.TERRAIN}"

I'm going to change now to:

"{""mapTypeId"": google.maps.MapTypeId.TERRAIN}"

And see if it works

- Could you tell me, I put my location on the map?

In my case, this only appearing the markers that I am filling the listing, and also wish to access the google icons page.

Thank you friends!

Eduardo Jauch wrote:

Hello Eduardo,

In the image, the configuration is "different" from the text you put here. It is with single quotes around the type:

"{'mapTypeId': 'google.maps.MapTypeId.TERRAIN'}"

Remove the single quotes and set like this:

"{""mapTypeId"": google.maps.MapTypeId.TERRAIN}"

Cheers,
Eduardo Jauch

"{""mapTypeId"": google.maps.MapTypeId.TERRAIN}"


As above the map is not even appearing. But there was no mistake.


Eduardo Benites wrote:

"{""mapTypeId"": google.maps.MapTypeId.TERRAIN}"


As above the map is not even appearing. But there was no mistake.


Hi Eduardo,

I used this form in a test (Directory Mobile) and had no problem at all.
Maybe you could share your module (oml) here so we can see what's the problem?

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Eduardo Benites wrote:

"{""mapTypeId"": google.maps.MapTypeId.TERRAIN}"


As above the map is not even appearing. But there was no mistake.


Hi Eduardo,

I used this form in a test (Directory Mobile) and had no problem at all.
Maybe you could share your module (oml) here so we can see what's the problem?

Cheers,
Eduardo Jauch

Unfortunately I can not do this, can you send me your example so I can go here?


Hi Eduardo

You can install the Directory Mobile app from forge and add the line above to the Map Options (the map is in the Location Web Block, in the Main Flow)

.
I tested with the configuration I gave and with this configuration and worked like a charm:

"{
    ""draggable"":false,
    ""mapTypeControl"":true,
    ""panControl"":false,
    ""overviewMapControl"":false,
    ""streetViewControl"":false,
    ""zoomControl"":false,
    ""mapTypeId"": google.maps.MapTypeId.SATELLITE
}"

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hi Eduardo

You can install the Directory Mobile app from forge and add the line above to the Map Options (the map is in the Location Web Block, in the Main Flow)

.
I tested with the configuration I gave and with this configuration and worked like a charm:

"{
    ""draggable"":false,
    ""mapTypeControl"":true,
    ""panControl"":false,
    ""overviewMapControl"":false,
    ""streetViewControl"":false,
    ""zoomControl"":false,
    ""mapTypeId"": google.maps.MapTypeId.SATELLITE
}"

Cheers,
Eduardo Jauch


In the GetOptionsObject action, I bypassed an if ErrorParsingJSON ?, ignoring this condition and the error stopped giving.


Hi Eduardo,

You shouldn't do this...
Doing this you are simply ignoring your Map Options. It can work or maybe not (depending on what you put there). The verification is there for a reason.

What is the server version you are using?
Are all components up to date? Like the Common, Silk UI Web, Google Maps Mobile...

Did you tried the DirectoryMobile app and tested it? it is working on my Personal. If it works on yours, you have a problem in your app. If it doesn't, you have a problem in your environment, probably (outdated components, etc).

Cheers,
Eduardo Jauch