Skip to content

Commit

Permalink
motorcycle profile for direction (copy from car) (gis-ops#196)
Browse files Browse the repository at this point in the history
Co-authored-by: Nguyên Nguyễn (Technical Architect) <nguyen.nguyen6@be.com.vn>
Co-authored-by: Nils <nilsnolde@proton.me>
  • Loading branch information
3 people committed Sep 25, 2023
1 parent 67ca167 commit c204bb8
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Controls/Directions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class DirectionsControl extends React.Component {
'truck',
'bus',
'motor_scooter',
'motorcycle',
]}
loading={loading}
popupContent={[
Expand All @@ -87,6 +88,7 @@ class DirectionsControl extends React.Component {
'Truck',
'Bus',
'Motor Scooter',
'Motorcycle',
]}
activeProfile={profile}
handleUpdateProfile={this.handleUpdateProfile}
Expand Down
57 changes: 57 additions & 0 deletions src/Controls/settings-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,18 @@ const maxHikingDifficulty = {
},
}

const useTrails = {
name: 'Use Trails',
param: 'use_trails',
unit: 'willingness',
description: `A riders's desire for adventure in their routes. This is a range of values from 0 to 1, where 0 will avoid trails, tracks, unclassified or bad surfaces and values towards 1 will tend to avoid major roads and route on secondary roads. The default value is 0.0.`,
settings: {
min: 0,
max: 1,
step: 0.1,
},
}

export const settingsInit = {
maneuver_penalty: 5,
country_crossing_penalty: 0,
Expand Down Expand Up @@ -688,6 +700,7 @@ export const settingsInit = {
transit_start_end_max_distance: 2145,
transit_transfer_max_distance: 800,
disable_hierarchy_pruning: false,
use_trails: 0,
}

export const settingsInitTruckOverride = {
Expand Down Expand Up @@ -815,6 +828,31 @@ export const profile_settings = {
boolean: [shortest],
enum: [bicycleType],
},
motorcycle: {
numeric: [
width,
height,
topSpeed,
fixedSpeed,
privateAccessPenalty,
closureFactor,
servicePenalty,
serviceFactor,
maneuverPenalty,
gateCost,
gatePenalty,
countryCrossingCost,
countryCrossingPenality,
],
boolean: [
shortest,
includeHOV2,
includeHOV3,
includeHot,
ignoreHierarchies,
],
enum: [],
},
}

export const settings_general = {
Expand Down Expand Up @@ -909,6 +947,25 @@ export const settings_general = {
boolean: [],
enum: [],
},
motorcycle: {
numeric: [
turnPenalityCost,
countryCrossingPenality,
countryCrossingCost,
useHighways,
useTrails,
useTollways,
tollBoothCost,
tollBoothPenalty,
useFerry,
ferryCost,
useLivingStreets,
useTracks,
excludeUnpaved,
],
boolean: [ignoreClosures, excludeCashOnlyTolls],
enum: [],
},
all: {
boolean: [useGeocoding],
},
Expand Down
2 changes: 2 additions & 0 deletions src/components/profile-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ReactComponent as CarSvg } from 'images/car.svg'
import { ReactComponent as TruckSvg } from 'images/truck.svg'
import { ReactComponent as BikeSvg } from 'images/bike.svg'
import { ReactComponent as PedestrianSvg } from 'images/pedestrian.svg'
import { ReactComponent as MotorbikeSvg } from 'images/motorbike.svg'

const iconMap = {
truck: <TruckSvg />,
Expand All @@ -16,6 +17,7 @@ const iconMap = {
pedestrian: <PedestrianSvg />,
motor_scooter: <ScooterSvg />,
bus: <BusSvg />,
motorcycle: <MotorbikeSvg />,
}

export const ProfilePicker = ({
Expand Down
27 changes: 27 additions & 0 deletions src/images/motorbike.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c204bb8

Please sign in to comment.