Skip to content
13 changes: 12 additions & 1 deletion src/Providers/Maps/Google/Constants/Constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace Provider.Maps.Google.Constants {
// Regular expression to validate if a string is a set of coordinates. Accepts "12.300,-8.220" and "12.300, -8.220".
export const coordinateValidator = /^-{0,1}\d*\.{0,1}\d*,( )?-{0,1}\d*\.{0,1}\d*$/;

// Name of the Google Maps Version in the LocalStorage
export const googleMapsLocalStorageVersionKey = 'gmVersion';

Expand Down Expand Up @@ -27,14 +30,22 @@ namespace Provider.Maps.Google.Constants {
/** URL for GoogleMapsApis */
/************************** */
export const googleMapsApiURL = 'https://maps.googleapis.com/maps/api';
// URL for GoogleMaps API to make use of the routes API
export const googleMapsRoutesApiURL = 'https://routes.googleapis.com/directions/v2:computeRoutes';
// URL for GoogleMaps API to make use of the Google Map
export const googleMapsApiMap = `${googleMapsApiURL}/js`;
// URL for GoogleMaps API to make use of the Google StaticMap
export const googleMapsApiStaticMap = `${googleMapsApiURL}/staticmap`;

/****************************** */
/** Options for GoogleMapsApis */
/****************************** */
// When using Google Maps Routes API, these are the options that we want to retrieve.
export const GoogleMapsRouteOptions = 'routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline';
// In order to use the drawingTools we need to add it into the libraries via the URL = drawing
// In order to use the heatmap we need to add it into the libraries via the URL = visualization
// In order to use the searchplaces we need to add it into the libraries via the URL = places (in case the Map is the first to import the scripts)
export const GoogleMapsLibraries = 'drawing,visualization,places,marker';
export const GoogleMapsLibraries = 'drawing,visualization,places,marker,geometry';
// Used to check if modules are available on cycles of 100ms */
export const checkGoogleMapsLibrariesMaxAttempts = 25;
// Version of the Google Maps to be loaded.
Expand Down
Loading
Loading