From c0b3be5b0cbb79e28711421707f22f7170838097 Mon Sep 17 00:00:00 2001 From: Mike Horn Date: Sun, 22 Feb 2015 16:42:32 -0800 Subject: [PATCH] If you enter a coordinate, use that. --- app/components/geolocation-control.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/components/geolocation-control.js b/app/components/geolocation-control.js index 1f308f37..bb361737 100644 --- a/app/components/geolocation-control.js +++ b/app/components/geolocation-control.js @@ -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