How do I set google map from JSON?

Get help using Construct 2

Post » Thu Jan 04, 2018 5:20 pm

Hello.
I need some tips on how can i use "set from JSON" option in google map plugin?
What i am trying to achieve is like this iFrame URL:

https://www.google.com/maps/embed/v1/search?q="pizza"&zoom=13&key=xxxxxxxxxxxxxMyApiKeyxxxxxxxxxxxxxx

Thanx!
Last edited by irina on Fri Jan 05, 2018 10:09 am, edited 2 times in total.
B
33
S
14
G
3
Posts: 801
Reputation: 6,316

Post » Thu Jan 04, 2018 5:40 pm

What do you want to load from the JSON? Coordinates? Zoom? Map type? What information would you be loading exactly?
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 717
Reputation: 3,996

Post » Thu Jan 04, 2018 6:13 pm

@brunopalermo

i can get coordinates from geolocation and then open map with those coordinates and search for a certain store (that i have in variable) in that area.
B
33
S
14
G
3
Posts: 801
Reputation: 6,316

Post » Thu Jan 04, 2018 6:37 pm

Ok. So what you need to store in the JSON? What information would you load from the JSON? Because maybe a JSON isn't even necessary... It would be better if you detailed what exactly are you trying to achieve, so we can try and help you. :)
Last edited by brunopalermo on Thu Jan 25, 2018 10:34 am, edited 1 time in total.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 717
Reputation: 3,996

Post » Fri Jan 05, 2018 10:08 am

@brunopalermo
What i want to do basicly is to perform a search.
B
33
S
14
G
3
Posts: 801
Reputation: 6,316

Post » Fri Jan 19, 2018 9:46 am

Still no luck with this... :(
Is it even possible with googlemap plugin to perform a search for some specific term?
Like... when map get's openned to display certain stores near by?

and one more thing.... where do i input my API key?
B
33
S
14
G
3
Posts: 801
Reputation: 6,316

Post » Fri Jan 19, 2018 11:01 am

this is what i am looking for...

https://developers.google.com/maps/docu ... mbed/guide

example can be found there half way down the page under the title "Search mode":

https://www.google.com/maps/embed/v1/se ... in+Seattle

Image
B
33
S
14
G
3
Posts: 801
Reputation: 6,316

Post » Sat Jan 20, 2018 12:24 am

help needed!

can anyone tell me how to correctly load google map data via JSON?

Iw made my test JSON file from this google call:
https://maps.googleapis.com/maps/api/pl ... zum&key=MY API KEY

tryed directly set this URL into google map > set from JSON string - but no luck

iw stored it on test server:
http://www.vixus.hr/test/konzum.json

typed this URL into google map > set from JSON string - but nothing happens...

but still i cant get data to be visible inside of google map ?

@Ashley
@brunopalermo

anyone?
B
33
S
14
G
3
Posts: 801
Reputation: 6,316

Post » Mon Jan 22, 2018 3:36 am

Hi Irina,
The URL requiered by your link is The Google Maps API server rejected your request. The provided API key is invalid. Which means the token is incorrect. Take a look at the documentation and use of the plugin. And the example that Json has posted has coordinates already pre-established in Seattle as an example. From what I read in the documentation you need a key. (there are standard keys).

So the request format of the link plugin looks like this: https://maps.googleapis.com/maps/api/ge ... w,+CA&key=YOUR_API_KEY
* remembering that YOUR_API_KEY should be replaced with the key you need to create

Links
docs: https://developers.google.com/maps/docu ... o?hl=en-us

the key of your link xxxxxxxxxxxxxMyApiKeyxxxxxxxxxxxxxx is incorrect, you enter a correct key as described above ^^

Get key
https://developers.google.com/maps/docu ... mbed/guide >>> (click em button get key and follow step)
B
19
S
6
Posts: 12
Reputation: 1,253

Post » Mon Jan 22, 2018 9:10 am

@marceloborghi
First URL that i provided is correct but i did not share MY API KEY and therefore it dosent work as live link but thats why iw copied JSON to my server and displayed it in the second url in my last post:
http://www.vixus.hr/test/konzum.json

anyway, thanx for trying to help me.
B
33
S
14
G
3
Posts: 801
Reputation: 6,316

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests