Skip to content

Commit

Permalink
Small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rugoncalves committed Feb 9, 2024
1 parent 0261014 commit 56ae3bd
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Providers/Maps/Google/SharedComponents/MapsAndSearchPlaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Provider.Maps.Google.SharedComponents {
window.GMCB = () => {
//this method is just to avoid unnecessary warning on the console;
window.GMCB = undefined;
resolve(undefined);
resolve(0);
googleMapsLoadPromise = undefined;
};
const script = document.createElement('script');
Expand All @@ -38,13 +38,14 @@ namespace Provider.Maps.Google.SharedComponents {
});
}

// We have to use this listener instead of the callback of the library because the callback will only work of 1st map on the page
// We have to use this promise instead of the callback of the library because
// the callback will only work of 1st map on the page
googleMapsLoadPromise.then(cb);
}
}

/**
* Remove... balbal
* Remove...
* @param object
*/
export function RemoveEventsFromProvider(
Expand All @@ -58,10 +59,17 @@ namespace Provider.Maps.Google.SharedComponents {
});
}

/** This method will help converting the bounds (string) into the respective coordinates that will be used on the bounds
/**
* This method will help converting the bounds (string) into the respective coordinates that will be used on the bounds
* It returns a promise because bounds will get converted into coordinates
* The method resposible for this conversion (Helper.Conversions.ConvertToCoordinates) also returns a Promise
* This Promise will only get resolved after the provider gets built (asynchronously)
*
* @export
* @param {OSFramework.Maps.OSStructures.OSMap.BoundsString} bounds
* @param {string} apiKey
* @param {() => void} errorCb
* @return {*} {Promise<OSFramework.Maps.OSStructures.OSMap.Bounds>}
*/
export function ConvertStringToBounds(
bounds: OSFramework.Maps.OSStructures.OSMap.BoundsString,
Expand Down

0 comments on commit 56ae3bd

Please sign in to comment.