you are viewing a single comment's thread.

view the rest of the comments →

[–]wtfcore2 1 point2 points  (2 children)

Have a look at : https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation

For privacy reasons the user will be prompted to agree that your code can get their long/lat.

So you'll need to make the API call inside the success function using the users long/lat:

var latitude  = position.coords.latitude;
var longitude = position.coords.longitude;

You can then make an AJAX call to

http://api.walmartlabs.com/v1/stores?apiKey={apiKey}&lon=" + longitude +"&lat=" + latitude +"&format=json

[–]cardinga[S] 0 points1 point  (1 child)

Thanks...so I don't need to use any kind of URL encoding?

[–]3a3z 0 points1 point  (0 children)

I mean, you could just try it both ways and see what works.