Skip to content

Commit

Permalink
Fix: object {lat:1,lon:1} working fine now
Browse files Browse the repository at this point in the history
  • Loading branch information
HazemKhaled committed Jun 10, 2015
1 parent 8b651fb commit ef28551
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/client/autoform-map.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ initTemplateAndGoogleMaps = ->
@data.map = new google.maps.Map @find('.js-map'), mapOptions

if @data.value
location = if typeof @data.value == 'string' then @data.value.split ',' else if typeof @data.value == 'Array' then [@data.value.lat, @data.value.lng] else [@data.value[1],@data.value[0]]
location = if typeof @data.value == 'string' then @data.value.split ',' else if @data.value.hasOwnProperty 'lat' then [@data.value.lat, @data.value.lng] else [@data.value[1],@data.value[0]]
location = new google.maps.LatLng parseFloat(location[0]), parseFloat(location[1])
@data.setMarker @data.map, location, @data.options.zoom
@data.map.setCenter location
Expand Down

0 comments on commit ef28551

Please sign in to comment.