Google Places API
If you are setting up a REST service in Tiggzi, use GET and then parameters will be appended in the URL, after ?, for example ?param=value;param2=value2;
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
If you are setting up a REST service in Tiggzi, use GET and then parameters will be appended in the URL, after ?, for example ?param=value;param2=value2;
I thought I had tried and it didn't work, but now it works! Thank you Max.
Data mapping the response, I am still lost and having trouble with it - I'm using the geolocation service to get the lat/lng of the user.
When the page loads, the Geolocation service is invoked. Upon success, the lat/lng response is stored in a local storage variable and the Google Places REST service is invoked. At which point, the Google Places REST service uses the local storage variable to get the lat/lng. For some reason it doesn't work though, all I get is a "blue screen of death" with a single red marker.
Geolocation Response:
Local Storage Variable
Google Places Request:
Google Places Response
Does Google Places API work when you do Test Connection (with some default values)?
Yes, here is a successful test response via the REST service with some default values filled in.
I just found out that the "blue screen of death" I'm getting in the browser test environment is actually the middle of the Atlantic ocean! That doesn't help me though because it's not working as it should. When the map loads, the location of the user as well as the location of the places searched for should be displayed. I have no idea why I'm ending up in the middle of the Atlantic ocean.
Edit: I have also removed the word "text" in the value field for the local storage variable.
From the first image in this reply: https://getsatisfaction.com/tiggzi/to..., it looks like you are mapping latitude and longitude into the same local storage variable (Location)...?
Correct, it's because I was under the impression the lat/lng has to be stored as one variable in order for the Google Places REST service to work properly. I can't give the location parameter in Google Places REST service two different inputs (I've tried).
So that means the latitude and longtitude response from the Geolocation has to be combined into one before the Google Places REST service pulls it.
What's the format that Google API needs..?
Google API supports XML and JSON. I prefer JSON and that is what Google recommends.
The location parameter input has to be formatted as: latitude,longitude ( you can't split them into two separate input parameters - I tried that too, lol).
Save both (latitude, longitude) into local storage as separate variables. On input to Google service, for location simply run this JavaScript:
return localStorage.getItem('latitude') + ',' + localStorage.getItem('longitude');
Thank you Max. I made the appropriate adjustments and I still end up in the middle of the Atlantic.
I've got the geolocation response going to separate local storage variables, then on the Google places REST i've inserted the javascript in the location parameter input.
I also tried creating the two local storage variables by binding it to googlemaps1latitude and doing googlemaps1longitude and then using the javascript in the Google Places REST for the location parameter - but that didn't work either.
I'm fresh out of ideas.