fix: polyline decoding bug with large bounds and fix ulys API toll pricing precision
This commit is contained in:
@@ -49,8 +49,14 @@ function loadTollStations() {
|
||||
// ─────────────────────────────────────────────
|
||||
async function getUlysTollLegs(encodedPolyline) {
|
||||
try {
|
||||
// La polyline Google est encodée avec une précision de 5.
|
||||
// L'API Ulys (precision=6) attend une précision de 6.
|
||||
// On la décode (precision 5) puis on la réencode (precision 6).
|
||||
const decodedCoords = polylineLib.decode(encodedPolyline, 5);
|
||||
const polyline6 = polylineLib.encode(decodedCoords, 6);
|
||||
|
||||
const url = 'https://api-ulys.azure-api.net/placemark/v2/legs?precision=6&includeLayersIds=GaresPeage';
|
||||
const body = JSON.stringify(encodedPolyline);
|
||||
const body = JSON.stringify(polyline6);
|
||||
const res = await axios.post(url, body, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user