@maptiler/client 3.2.0-rc.2 → 3.2.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/maptiler-client.cjs
CHANGED
|
@@ -1334,6 +1334,8 @@ function addProfileOptions(search, req) {
|
|
|
1334
1334
|
search.set("truck.height", String(opts.height));
|
|
1335
1335
|
if (opts.weight !== void 0)
|
|
1336
1336
|
search.set("truck.weight", String(opts.weight));
|
|
1337
|
+
if (opts.length !== void 0)
|
|
1338
|
+
search.set("truck.length", String(opts.length));
|
|
1337
1339
|
if (opts.axleLoad !== void 0)
|
|
1338
1340
|
search.set("truck.axleLoad", String(opts.axleLoad));
|
|
1339
1341
|
if (opts.hazmat !== void 0)
|
|
@@ -1410,7 +1412,16 @@ async function directionsPost(body, options = {}) {
|
|
|
1410
1412
|
...fetchExtras,
|
|
1411
1413
|
method: "POST",
|
|
1412
1414
|
headers,
|
|
1413
|
-
body: JSON.stringify(
|
|
1415
|
+
body: JSON.stringify({
|
|
1416
|
+
...body,
|
|
1417
|
+
// The API rejects locations with unknown fields, let's strip these
|
|
1418
|
+
locations: body.locations.map(({ lon, lat, heading, waypoint }) => ({
|
|
1419
|
+
lon,
|
|
1420
|
+
lat,
|
|
1421
|
+
heading,
|
|
1422
|
+
waypoint
|
|
1423
|
+
}))
|
|
1424
|
+
})
|
|
1414
1425
|
});
|
|
1415
1426
|
return await processDirectionsResponse(res);
|
|
1416
1427
|
}
|