Skip to content

Commit 95427c0

Browse files
wip
1 parent 70cd672 commit 95427c0

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

server/server.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ function handleCommonParams(query, options, format) {
180180
options.generate_hints = query.generate_hints;
181181
}
182182
if (query.skip_waypoints) {
183-
options.skip_waypoints = query.skip_waypoints === 'true' ? true : false;
183+
options.skip_waypoints = query.skip_waypoints;
184184
}
185185
if (query.continue_straight) {
186-
options.continue_straight = query.continue_straight === 'true' ? true : false;
186+
options.continue_straight = query.continue_straight;
187187
}
188188
}
189189
async function handleMatch(osrm, coordinates, query, format) {
@@ -206,7 +206,7 @@ async function handleTrip(osrm, coordinates, query, format) {
206206
};
207207
handleCommonParams(query, options, format);
208208
if (query.roundtrip) {
209-
options.roundtrip = query.roundtrip === 'true' ? true : false;
209+
options.roundtrip = query.roundtrip;
210210
}
211211
if (query.source) {
212212
options.source = query.source;
@@ -223,7 +223,8 @@ async function handleRoute(osrm, coordinates, query, format) {
223223
};
224224
handleCommonParams(query, options, format);
225225
if (query.alternatives) {
226-
options.alternatives = query.alternatives === 'true' ? true : false;
226+
// TODO: number ?
227+
options.alternatives = query.alternatives;
227228
}
228229
if (query.approaches) {
229230
options.approaches = query.approaches.split(';');

server/server.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ function handleCommonParams(query: any, options: any, format: Format) {
194194
}
195195

196196
if (query.skip_waypoints) {
197-
options.skip_waypoints = query.skip_waypoints === 'true' ? true : false;
197+
options.skip_waypoints = query.skip_waypoints;
198198
}
199199

200200
if (query.continue_straight) {
201-
options.continue_straight = query.continue_straight === 'true' ? true : false;
201+
options.continue_straight = query.continue_straight;
202202
}
203203
}
204204

@@ -226,7 +226,7 @@ async function handleTrip(osrm: any, coordinates: [number, number][], query: any
226226
};
227227
handleCommonParams(query, options, format);
228228
if (query.roundtrip) {
229-
options.roundtrip = query.roundtrip === 'true' ? true : false;
229+
options.roundtrip = query.roundtrip;
230230
}
231231
if (query.source) {
232232
options.source = query.source;
@@ -244,7 +244,8 @@ async function handleRoute(osrm: any, coordinates: [number, number][], query: an
244244
};
245245
handleCommonParams(query, options, format);
246246
if (query.alternatives) {
247-
options.alternatives = query.alternatives === 'true' ? true : false;
247+
// TODO: number ?
248+
options.alternatives = query.alternatives;
248249
}
249250
if (query.approaches) {
250251
options.approaches = query.approaches.split(';');
@@ -373,7 +374,7 @@ async function main() {
373374
return processRequest(handleTrip, request, reply);
374375
});
375376

376-
fastify.get('/tile/v1/:profile/tile(:x,:y,:zoom).mvt', { schema: tileSchema } async (request, reply) => {
377+
fastify.get('/tile/v1/:profile/tile(:x,:y,:zoom).mvt', { schema: tileSchema }, async (request, reply) => {
377378
const { x, y, zoom } = request.params as any;
378379

379380
reply.type('application/x-protobuf').code(200);

0 commit comments

Comments
 (0)