Skip to content

Commit

Permalink
#238 add ip location function to JS.
Browse files Browse the repository at this point in the history
  • Loading branch information
bm5w committed May 28, 2015
1 parent 90b3579 commit 3c5d48e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/app/static/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ new L.Control.Zoom({

// Seattle, WA
var lat = 47.568, lng = -122.582;
var temp = 0;
$.get("http://ipinfo.io", function(response) {
temp = response.loc;
temp = temp.split(",");
lat = temp[0]
lng = temp[1]
console.log(lat, lng);
}, "jsonp");

$(document).ready(function() {
// If user has moved the map, reset to their last location.
Expand Down

0 comments on commit 3c5d48e

Please sign in to comment.