Skip to content

Commit

Permalink
Zoom to location when detected
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolai-b committed Jan 11, 2017
1 parent 070492d commit c79b164
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/assets/javascripts/location_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ $(document).ready(function() {

if (navigator.geolocation) {
var updateLocation = function(pos){
changeStartLocation({latlng: {lat: pos.coords.latitude, lng: pos.coords.longitude} });
var lat = pos.coords.latitude, lng = pos.coords.longitude;
map.map.setView([lat, lng], 13);
changeStartLocation({latlng: {lat: lat, lng: lng} });
userLocationPlaceholder = userLocationEl.find("input").attr("placeholder");
userLocationEl.find("input").attr("placeholder", userLocationEl.data("currentLocation"));
};
Expand Down

0 comments on commit c79b164

Please sign in to comment.