Skip to content

Commit cb88bf0

Browse files
committed
merged master
2 parents 56e460c + 8cfeb91 commit cb88bf0

43 files changed

Lines changed: 1310 additions & 482 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,28 @@ const config = {
4545
//
4646
// E.g. the 'bike' entry will add a "bike" profile for which we send a request with the specified 'details' parameter. You can even change the profile itself when you specify
4747
// bike: { profile: 'raw_bike', ... }
48+
49+
// You can 'collapse' or group certain profiles to reduce the number of profiles in the panel. Instead they're listed in the settings but still a profile icon is shown.
50+
// Note: the name of the group must be the default option for this group.
51+
profile_group_mapping: {},
52+
// profile_group_mapping: {
53+
// car: {
54+
// options: [
55+
// { profile: 'car' },
56+
// { profile: 'car_avoid_motorway' },
57+
// { profile: 'car_avoid_ferry' },
58+
// { profile: 'car_avoid_toll' }
59+
// ]
60+
// },
61+
// bike: {
62+
// options: [
63+
// { profile: 'bike' },
64+
// { profile: 'mtb' },
65+
// { profile: 'racingbike' },
66+
// { profile: 'ecargobike' }
67+
// ]
68+
// }
69+
// }
4870
}
4971

5072
// this is needed for jest (with our current setup at least)

package-lock.json

Lines changed: 60 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@
1717
},
1818
"dependencies": {
1919
"maplibre-gl": "^3.1.0",
20-
21-
"custom-model-editor": "github:graphhopper/custom-model-editor#3a46b6981d170b7eb70d621bbb92caed149e5a97",
20+
"custom-model-editor": "github:graphhopper/custom-model-editor#5ebd80570329f7abfc95c39624be1f1a379cf392",
2221
"geojson": "^0.5.0",
2322
"heightgraph": "github:easbar/Leaflet.Heightgraph#5f4f0b1fff3646aa071981381f5955c9e6f111f0",
24-
"ol": "10.2.1",
25-
"ol-mapbox-style": "12.3.5",
26-
"react": "^18.2.0",
27-
"react-dom": "^18.2.0",
28-
"react-responsive": "^9.0.0"
23+
"ol": "10.4.0",
24+
"ol-mapbox-style": "12.5.0",
25+
"react": "^18.3.1",
26+
"react-dom": "^18.3.1",
27+
"react-responsive": "^10.0.1"
2928
},
3029
"devDependencies": {
3130
"@svgr/webpack": "^8.0.1",

src/App.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,12 @@ function LargeScreenLayout({
222222
drawAreas={drawAreas}
223223
/>
224224
)}
225-
<Search points={query.queryPoints} map={map} turnNavigationSettings={turnNavigation.settings} />
225+
<Search
226+
points={query.queryPoints}
227+
profile={query.routingProfile}
228+
map={map}
229+
turnNavigationSettings={turnNavigation.settings}
230+
/>
226231
<div>{!error.isDismissed && <ErrorMessage error={error} />}</div>
227232
<RoutingResults
228233
info={route.routingResult.info}

src/Converters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { GeocodingHit } from '@/api/graphhopper'
22

3-
import { Coordinate } from '@/stores/QueryStore'
3+
import { Coordinate } from '@/utils'
44

55
export function milliSecondsToText(ms: number) {
66
const hours = Math.floor(ms / 3600000)

src/NavBar.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import Dispatcher from '@/stores/Dispatcher'
33
import { ClearPoints, SelectMapLayer, SetBBox, SetQueryPoints, SetVehicleProfile } from '@/actions/Actions'
44
// import the window like this so that it can be mocked during testing
55
import { window } from '@/Window'
6-
import QueryStore, { getBBoxFromCoord, QueryPoint, QueryPointType, QueryStoreState } from '@/stores/QueryStore'
6+
import QueryStore, { QueryPoint, QueryPointType, QueryStoreState } from '@/stores/QueryStore'
77
import MapOptionsStore, { MapOptionsStoreState } from './stores/MapOptionsStore'
88
import { ApiImpl, getApi } from '@/api/Api'
99
import { AddressParseResult } from '@/pois/AddressParseResult'
1010
import { getQueryStore } from '@/stores/Stores'
11+
import { getBBoxFromCoord, getBBoxPoints } from '@/utils'
1112

1213
export default class NavBar {
1314
private readonly queryStore: QueryStore
@@ -159,7 +160,7 @@ export default class NavBar {
159160
const bbox =
160161
initializedPoints.length == 1
161162
? getBBoxFromCoord(initializedPoints[0].coordinate)
162-
: ApiImpl.getBBoxPoints(initializedPoints.map(p => p.coordinate))
163+
: getBBoxPoints(initializedPoints.map(p => p.coordinate))
163164
if (bbox) Dispatcher.dispatch(new SetBBox(bbox))
164165
return Dispatcher.dispatch(new SetQueryPoints(points))
165166
}

src/actions/Actions.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { Action } from '@/stores/Dispatcher'
2-
import { Coordinate, QueryPoint } from '@/stores/QueryStore'
2+
import { QueryPoint } from '@/stores/QueryStore'
33
import { ApiInfo, Bbox, Path, RoutingArgs, RoutingProfile, RoutingResult } from '@/api/graphhopper'
44
import { PathDetailsPoint } from '@/stores/PathDetailsStore'
55
import { TNSettingsState } from '@/stores/TurnNavigationStore'
66
import { POI } from '@/stores/POIsStore'
77
import { Settings } from '@/stores/SettingsStore'
8+
import { Coordinate } from '@/utils'
89

910
export class InfoReceived implements Action {
1011
readonly result: ApiInfo
@@ -82,6 +83,14 @@ export class SetVehicleProfile implements Action {
8283
}
8384
}
8485

86+
export class SetVehicleProfileGroup implements Action {
87+
readonly group: string
88+
89+
constructor(group: string) {
90+
this.group = group
91+
}
92+
}
93+
8594
export class AddPoint implements Action {
8695
readonly atIndex: number
8796
readonly coordinate: Coordinate

0 commit comments

Comments
 (0)