Skip to content

Commit

Permalink
If you enter a coordinate, use that.
Browse files Browse the repository at this point in the history
  • Loading branch information
gpbmike committed Feb 23, 2015
1 parent a88f66f commit c0b3be5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/components/geolocation-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ export default Ember.Component.extend({
return;
}

var coords = value.split(',');
var lat = parseFloat(coords[0]) || null;
var lng = parseFloat(coords[1]) || null;
if (typeof lat === 'number' && typeof lng === 'number') {
component.set('control.value', { latitude: lat, longitude: lng });
return;
}

// Use Google Geocoding service for address lookups.
Ember.$.getJSON('https://maps.googleapis.com/maps/api/geocode/json', {
address: value
Expand Down

0 comments on commit c0b3be5

Please sign in to comment.