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 *