Skip to content

Commit

Permalink
Fix get current location #42
Browse files Browse the repository at this point in the history
  • Loading branch information
rapito committed Jan 13, 2016
1 parent 88b71b5 commit b9a3a03
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/client/autoform-map.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ Template.afMap.events
unless navigator.geolocation then return false

@loading.set true
t = Template.instance()
navigator.geolocation.getCurrentPosition (position) =>
location = new google.maps.LatLng position.coords.latitude, position.coords.longitude
@setMarker @map, location, @options.zoom
@map.setCenter location
t.setMarker t.map, location, @options?.zoom
t.map.setCenter location
@loading.set false

'keydown .js-search': (e) ->
Expand Down

0 comments on commit b9a3a03

Please sign in to comment.