@@ -4,7 +4,6 @@ import Color from '@js/color';
44import ajax from '@js/core/utils/ajax' ;
55import { noop } from '@js/core/utils/common' ;
66import { extend } from '@js/core/utils/extend' ;
7- import { each , map } from '@js/core/utils/iterator' ;
87import { getHeight , getWidth } from '@js/core/utils/size' ;
98import { isDefined } from '@js/core/utils/type' ;
109import { getWindow } from '@js/core/utils/window' ;
@@ -371,8 +370,8 @@ class BingProvider extends DynamicProvider {
371370 }
372371
373372 _renderRoute ( options : RouteOptions ) : Promise < RouteObject > {
374- // const locations = options.locations ?? [];
375- return Promise . all ( map ( options . locations , ( point ) => this . _resolveLocation ( point ) ) )
373+ const routeLocations = options . locations ?? [ ] ;
374+ return Promise . all ( routeLocations . map ( ( point ) => this . _resolveLocation ( point ) ) )
376375 . then ( ( locations ) => new Promise ( ( resolve ) => {
377376 const direction = new Microsoft . Maps . Directions . DirectionsManager ( this . _map ) ;
378377 const color = new Color ( options . color || this . _defaultRouteColor ( ) ) . toHex ( ) ;
@@ -398,7 +397,7 @@ class BingProvider extends DynamicProvider {
398397 routeDraggable : false ,
399398 } ) ;
400399
401- each ( locations , ( _ , location ) => {
400+ locations . forEach ( ( location ) => {
402401 const waypoint = new Microsoft . Maps . Directions . Waypoint ( { location } ) ;
403402 direction . addWaypoint ( waypoint ) ;
404403 } ) ;
0 commit comments