From 44df6c05348eff65d2e519a8f7e34d7674766ce3 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 17 Aug 2017 12:42:18 +0300 Subject: [PATCH] Convert Google's LatLng to SDK's LatLng --- src/util/googleMaps.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/util/googleMaps.js b/src/util/googleMaps.js index 9d5614a9..8ee66c46 100644 --- a/src/util/googleMaps.js +++ b/src/util/googleMaps.js @@ -93,6 +93,17 @@ export const getPlacePredictions = search => }); }); +/** + * Convert Google formatted LatLng object to Sharetribe SDK's LatLng coordinate format + * + * @param {LatLng} googleLatLng - Google Maps LatLng + * + * @return {SDKLatLng} - Converted latLng coordinate + */ +export const googleLatLngToSDKLatLng = googleLatLng => { + return new SDKLatLng(googleLatLng.lat(), googleLatLng.lng()); +}; + /** * Convert Google formatted bounds object to Sharetribe SDK's bounds format *