@@ -35,11 +35,12 @@ export function getBBoxFromCoord(c: Coordinate, offset: number = 0.005): Bbox {
3535export class ProfileGroupMap {
3636 public static create ( map : Record < string , ProfileGroup > ) : Record < string , string > {
3737 let res : Record < string , string > = { }
38- for ( const [ key , value ] of Object . entries ( map ) ) {
39- for ( const option of value . options ) {
40- res [ option . profile ] = key
38+ if ( map )
39+ for ( const [ key , value ] of Object . entries ( map ) ) {
40+ for ( const option of value . options ) {
41+ res [ option . profile ] = key
42+ }
4143 }
42- }
4344 return res
4445 }
4546}
@@ -50,7 +51,6 @@ export interface ProfileGroup {
5051
5152export interface QueryStoreState {
5253 readonly profiles : RoutingProfile [ ]
53- readonly profileGroupMapping : Record < string , ProfileGroup >
5454 readonly lastProfiles : Record < string , string >
5555 readonly queryPoints : QueryPoint [ ]
5656 readonly nextQueryPointId : number
@@ -117,7 +117,6 @@ export default class QueryStore extends Store<QueryStoreState> {
117117
118118 return {
119119 profiles : [ ] ,
120- profileGroupMapping : { } ,
121120 lastProfiles : { } ,
122121 queryPoints : [
123122 QueryStore . getEmptyPoint ( 0 , QueryPointType . From ) ,
@@ -278,7 +277,6 @@ export default class QueryStore extends Store<QueryStoreState> {
278277 {
279278 ...state ,
280279 profiles,
281- profileGroupMapping : config . profile_group_mapping ,
282280 routingProfile : profile ,
283281 } ,
284282 true
@@ -300,7 +298,7 @@ export default class QueryStore extends Store<QueryStoreState> {
300298
301299 const newState : QueryStoreState = {
302300 ...state ,
303- routingProfile : { name : name } ,
301+ routingProfile : { ... action . profile , name : name } ,
304302 lastProfiles : { ...state . lastProfiles , [ key ] : value } ,
305303 }
306304 return this . routeIfReady ( newState , true )
0 commit comments