From 83a0f5b79f3b0733cb13dac946beff4db388ec30 Mon Sep 17 00:00:00 2001 From: webprofusion-chrisc Date: Wed, 29 Nov 2023 15:24:45 +0800 Subject: [PATCH] Fix build issues --- src/app/components/route-planner/route-planner.ts | 2 +- src/app/services/GoogleMapsDirections.ts | 2 +- src/app/services/mapping/providers/MapBox.ts | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/components/route-planner/route-planner.ts b/src/app/components/route-planner/route-planner.ts index a829aa9b..922f6ad1 100644 --- a/src/app/components/route-planner/route-planner.ts +++ b/src/app/components/route-planner/route-planner.ts @@ -108,7 +108,7 @@ export class RoutePlanner { this.routeStartPlace.Location.latitude + ',' + this.routeStartPlace.Location.longitude, this.routeDestinationPlace.Location.latitude + ',' + this.routeDestinationPlace.Location.longitude) - .then((result: google.maps.DirectionsResult) => { + .then((result: any) => { if (result.routes != null && result.routes.length > 0) { this.logging.log('Got route directions, analysing..'); this.routePolyline = (result.routes[0]).overview_polyline; diff --git a/src/app/services/GoogleMapsDirections.ts b/src/app/services/GoogleMapsDirections.ts index 79a3d7f8..08fab0fe 100644 --- a/src/app/services/GoogleMapsDirections.ts +++ b/src/app/services/GoogleMapsDirections.ts @@ -42,7 +42,7 @@ export class GoogleMapsDirections { }); } - public analyseRoutes(routeResults: google.maps.DirectionsResult, kWhPerKM: number): Array { + public analyseRoutes(routeResults: any, kWhPerKM: number): Array { const journeyRoutes = new Array(); // analyse power consumption of the routes and summarise the route diff --git a/src/app/services/mapping/providers/MapBox.ts b/src/app/services/mapping/providers/MapBox.ts index 6cb084b6..ce38259c 100644 --- a/src/app/services/mapping/providers/MapBox.ts +++ b/src/app/services/mapping/providers/MapBox.ts @@ -49,7 +49,8 @@ export class MapBoxMapProvider implements IMapProvider { initAPI() { if (mapboxgl) { - (mapboxgl).accessToken = environment.mapBoxToken; + //(mapboxgl).accessToken = environment.mapBoxToken; + Object.getOwnPropertyDescriptor(mapboxgl, "accessToken").set(environment.mapBoxToken); } }