Question regarding JSON & Google Maps api

Hi there,

I am trying to get the coordinates (lat&lon) with the google maps API.

For this I tried both extensions jsontools and jsonutils but I can’t get a proper result.
See below the setup. I currently get the red part:

{“lat”:41…,“lng”:-87…}

How can I get ONLY the 41 to display so that I can save it in a variable?

json%20coords2

Why do you want to get a part of coordinate?
Is it not possible to store that in a variable?

right now I just get this as a result:

{“lat”:41…,“lng”:-87…}

but I want to store only the lat & lng value in a variable - however I am not sure how I can extract just the numbers.

I tried to add another GetStringInSubJSONObject to extract the lat & lng out of location but it gave me an error. I guess I am doing it wrong.

i don’t know if you find a solution but the problem is that with your code you extract in a string the lat and long.
to devide them you can try to use this code: Immagine

It’s a Google Place API.

Example:

It’s the same app which was made with Google Place API

For understanding I can help you how to handle json content.

i’m creating an app for the trasports of Milan and i used google maps direction API that returned a long and complicated Json.
can i ask you how you handle json content in you app?
Thanks
ps i’m doing confusion with the post :joy:

Yes, you can use any of the 2 extensions.

  1. JsonTool by LukeGackle
  2. JsonUtils by ColinTree

But before proceeding u need to be clear about Array, Object and string. Only then you can parse it correctly.

yes, i’m already working with it but now i would implement direction information and the Json is more complicated so i thought that there was an easier way.

thanks!

Okay, can I borrow some time? To make you understand

sure, with pleasure!

Hi
Is there any free alternative available to Places Api?
It is costly so any one can suggest a free one.

if you use the “basic data”: address_component , adr_address , formatted_address , geometry , icon , name , permanently_closed , photo , place_id , plus_code , type , url , utc_offset , vicinity the google Places API is free for less then 100,000 request

I will be uploading a guide tonight regarding json. It would be helpful for not only but also many users of this community. Till then hold on.

@vknow360
Yes there are cheap/Free alternatives. Mailbox, LocationIQ, OpenCage etc are there. For more search on google.

wow, thanks a lot !
i’m looking forward to reading it.
link your guide in this discuss if you can, so i receive a notify

1 Like

@simone_sergi
Hope this may help you :blush:

1 Like