Skip to content

Commit

Permalink
Merge pull request #43 from rapito/master
Browse files Browse the repository at this point in the history
Fix issue #42
  • Loading branch information
renancouto committed Apr 27, 2016
2 parents 0086ea0 + a6f7035 commit 3fe9f24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.build*
.idea
7 changes: 4 additions & 3 deletions lib/client/autoform-map.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AutoForm.addInputType 'map',
lat = node.find('.js-lat').val()
lng = node.find('.js-lng').val()

if lat.length > 0 and lng.length > 0
if lat?.length > 0 and lng?.length > 0
lat: lat
lng: lng
contextAdjust: (ctx) ->
Expand Down 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 3fe9f24

Please sign in to comment.