feat: (broken) implement route map and address autocomplete widgets with associated infrastructure testing scripts
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
version.json,1780570658922,2ad4fa9c19907dedbcb21222822497894cd953384477486c22e19df772eb4bdb
|
||||
test_audio_tts.js,1772996026925,be4d2d713c256578bc16646116e3e81fc2627a1d89e45b211318b51e3612f259
|
||||
manifest.json,1766235870190,1fb17c7a1d11e0160d9ffe48e4e4f7fb5028d23477915a17ca496083050946e2
|
||||
flutter.js,1759914809272,d9a92a27a30723981b176a08293dedbe86c080fcc08e0128e5f8a01ce1d3fcb4
|
||||
favicon.png,1766235850956,3cf717d02cd8014f223307dee1bde538442eb9de23568e649fd8aae686dc9db0
|
||||
@@ -18,12 +20,15 @@ canvaskit/canvaskit.js,1759914809082,bb9141a62dec1f0a41e311b845569915df9ebb5f074
|
||||
canvaskit/chromium/canvaskit.wasm,1759914809184,4a868d7961a9740ae6694f62fc15b2b0ed76df50598e8311d61e8ee814d78229
|
||||
canvaskit/chromium/canvaskit.js.symbols,1759914809141,f395278c466a0eaed0201edd6b14a3aa8fee0a16bfedee2d239835cd7e865472
|
||||
canvaskit/chromium/canvaskit.js,1759914809136,ce5184f74e2501d849490df34d0506167a0708b9120be088039b785343335664
|
||||
assets/packages/flutter_map/lib/assets/flutter_map_logo.png,1780575617087,26fe50c9203ccf93512b80d4ee1a7578184a910457b36a6a5b7d41b799efb966
|
||||
assets/packages/flutter_dropzone_web/assets/flutter_dropzone.js,1748366257688,d640313cd6a02692249cd41e4643c2771b4202cc84e0f07f5f65cdc77a36826f
|
||||
assets/packages/cupertino_icons/assets/CupertinoIcons.ttf,1732993801504,b074450dadface9752fdee576c4773f5f816b25cfc2cb56eac78373f7962ec70
|
||||
assets/fonts/MaterialIcons-Regular.otf,1732993370530,e6fe489d50a1844caab286655353fe5574ddef2d8013fb4bb9e2745776b6131c
|
||||
assets/assets/Google__G__logo.svg,1741027482182,b365d560438f8f04caf08ffaa5d8995eff6c09b36b4483f44d6f5f82d8559d4f
|
||||
assets/assets/google.png,1741029771653,537ca60ffa74c28eca4e62d249237403a7d47d2bc90bb90431b8d5aa923a92ee
|
||||
assets/assets/EM2_NsurB.jpg,1741031103452,687267bbd4e1a663ffc1d2256c34969dd424cbaaf503b530db529a345570ddcd
|
||||
assets/assets/sounds/ok.mp3,1771938119844,cb452794752fa5e7622b2bd9413e9245464788be3f88cc838a7c9716f87f82a3
|
||||
assets/assets/sounds/error.mp3,1771938125144,5e1974fa40050421304357c75e834ab5f7c8ba7a61acfbb5885ed913afc0fc0b
|
||||
assets/assets/sounds/ok.mp3,1772996026461,cb452794752fa5e7622b2bd9413e9245464788be3f88cc838a7c9716f87f82a3
|
||||
assets/assets/sounds/error.mp3,1772996026458,5e1974fa40050421304357c75e834ab5f7c8ba7a61acfbb5885ed913afc0fc0b
|
||||
assets/assets/logos/SquareLogoWhite.png,1760462340000,786ce2571303bb96dfae1fba5faaab57a9142468fa29ad73ab6b3c1f75be3703
|
||||
assets/assets/logos/SquareLogoBlack.png,1760462340000,b4425fae1dbd25ce7c218c602d530f75d85e0eb444746b48b09b5028ed88bbd1
|
||||
assets/assets/logos/RectangleLogoWhite.png,1760462340000,1f6df22df6560a2dae2d42cf6e29f01e6df4002f1a9c20a8499923d74b02115c
|
||||
@@ -33,17 +38,13 @@ assets/assets/images/tshirt-incrust.webp,1737393735487,af7cb34adfca19c0b41c8eb63
|
||||
assets/assets/icons/truss.svg,1761734811263,8ddfbbb4f96de5614348eb23fa55f61b2eb1edb064719a8bbd791c35883ec4cc
|
||||
assets/assets/icons/tape.svg,1761734809221,631183f0ff972aa4dc3f9f51dc7abd41a607df749d1f9a44fa7e77202d95ccde
|
||||
assets/assets/icons/flight-case.svg,1761734822495,0cef47fdf5d7efdd110763c32f792ef9735df35c4f42ae7d02d5fbda40e6148d
|
||||
version.json,1772532792027,2b3f91e827bc27a1901342a048b1bd81d0aabc50935717f9851e1a3ad6cb7411
|
||||
test_audio_tts.js,1772532705302,d7b70556456d3b5e7832506b2dafe31480d94db8d0027b89c1633cc9b5c5bdae
|
||||
index.html,1772532797157,4e8c00552c71ef134bead8bc03706952e7a415d70fca602a3839dc02a3f7ae10
|
||||
flutter_bootstrap.js,1772532797146,ca3df8691f4db5962ed165489bd051dfd31307628ab4f1ee68842dc747d39fd9
|
||||
flutter_service_worker.js,1772532894886,9ce6b8d9f09c957b763a8d3db3baf03c96d4f84e805f6d629294749d9966cfad
|
||||
assets/FontManifest.json,1772532889954,e38b95988f5d060cf9b7ce97cb5ac9236d6f4cc04a11d69567df97b2b4cbc5e5
|
||||
assets/AssetManifest.json,1772532889954,0e35e7214421c832bf41b0af7c03037e66fee508b857d3143f40f6862e454dd6
|
||||
assets/AssetManifest.bin.json,1772532889954,3a244f5f866d93c17f420cc01b1ba318584b4da92af9512d9ba4acd099b49d53
|
||||
assets/AssetManifest.bin,1772532889954,205908d2fcf1ca9708b7d1f91ec7ea80c5f07eaf6cfc1458cb9364a4d9106907
|
||||
assets/shaders/ink_sparkle.frag,1772532890224,591c7517d5cb43eb91ea451e0d3f9f585cbf8298cf6c46a9144b77cb0775a406
|
||||
assets/packages/cupertino_icons/assets/CupertinoIcons.ttf,1772532893514,d41473de1f7708a0702d7f19327693486512db442f6ab0cf7774e6d6576f9fcb
|
||||
assets/fonts/MaterialIcons-Regular.otf,1772532893530,71c7128cf890cf3e18fffca405a98480f174bb3fa79d20c575b473d36c8c3093
|
||||
assets/NOTICES,1772532889955,8479783d331c9ff6d2b2e2e0a4b1705eda46ab0000b7753779fb98526ae54d74
|
||||
main.dart.js,1772532888607,df89975075062e0983691b8997b9e4a1ae4b4d5dfe6c06ca5b42ffa5407fdd3f
|
||||
index.html,1780603957835,4e8c00552c71ef134bead8bc03706952e7a415d70fca602a3839dc02a3f7ae10
|
||||
assets/FontManifest.json,1780604052367,e38b95988f5d060cf9b7ce97cb5ac9236d6f4cc04a11d69567df97b2b4cbc5e5
|
||||
flutter_service_worker.js,1780604053760,1519187477cb9e35df5ca9c83a72867c5c016b640a1bb5bf01120a7f2b461bfb
|
||||
flutter_bootstrap.js,1780603957820,6ac3038a9a13b989407467989e62fc34f516800f6d7a36e95cb898b3131279ca
|
||||
assets/AssetManifest.json,1780604052366,a75793b913dabecfa1b5eade2735ec6f8f280210572cf25d0ce010d2a6d95e8f
|
||||
assets/AssetManifest.bin.json,1780604052367,a26149597dbbee9aeaec0377943061e2b76c73bf974246f6af0b1a82e7455eaa
|
||||
assets/AssetManifest.bin,1780604052366,61f45b0f17a664717759ebf0f1271212f4658bd4b83e35bd5d134689b73a01d6
|
||||
assets/shaders/ink_sparkle.frag,1780604052544,591c7517d5cb43eb91ea451e0d3f9f585cbf8298cf6c46a9144b77cb0775a406
|
||||
assets/NOTICES,1780604052369,805d491eb7ed2c115d329c7395c52ae8aa69a02b1486c3ea8dcf46671786d9f3
|
||||
main.dart.js,1780604051275,97cefc9ac862c3289b61a32a4e561a73d65e9eaa4409f65575019494c86a78d1
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
const axios = require('axios');
|
||||
const polylineLib = require('@mapbox/polyline');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
const { _distKm } = require('./src/travel.js'); // Not exported, I'll copy the logic
|
||||
|
||||
function distKm(lat1, lng1, lat2, lng2) {
|
||||
const dLat = (lat2 - lat1) * Math.PI / 180;
|
||||
const dLng = (lng2 - lng1) * Math.PI / 180;
|
||||
const a = Math.sin(dLat/2)**2 + Math.cos(lat1*Math.PI/180) * Math.cos(lat2*Math.PI/180) * Math.sin(dLng/2)**2;
|
||||
return 6371 * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
|
||||
}
|
||||
|
||||
async function bulkRateTest() {
|
||||
const apiKey = process.env.API_MAPS;
|
||||
const origin = "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France";
|
||||
const destination = "Toulouse, France";
|
||||
|
||||
const routesUrl = 'https://routes.googleapis.com/directions/v2:computeRoutes';
|
||||
const resToll = await axios.post(routesUrl, {
|
||||
travelMode: 'DRIVE', routingPreference: 'TRAFFIC_UNAWARE',
|
||||
origin: { address: origin }, destination: { address: destination },
|
||||
}, { headers: { 'Content-Type': 'application/json', 'X-Goog-Api-Key': apiKey, 'X-Goog-FieldMask': 'routes.polyline.encodedPolyline' } });
|
||||
|
||||
const poly = resToll.data.routes[0].polyline.encodedPolyline;
|
||||
const polylineCoords = polylineLib.decode(poly, 5);
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const csvPath = path.join(__dirname, 'travel', 'gares_peage_export.csv');
|
||||
const rawCsv = fs.readFileSync(csvPath, 'utf8');
|
||||
const stations = [];
|
||||
const lines = rawCsv.split('\n');
|
||||
for (let i = 1; i < lines.length; i++) {
|
||||
const l = lines[i].trim();
|
||||
if (!l) continue;
|
||||
const parts = l.split(',');
|
||||
if (parts.length >= 4) {
|
||||
const idStr = String(parts[0]).padStart(5, '0');
|
||||
stations.push({
|
||||
id: idStr,
|
||||
operatorId: idStr.substring(0, 2),
|
||||
tollId: idStr.substring(2, 5),
|
||||
name: parts[1],
|
||||
lat: parseFloat(parts[2]),
|
||||
lon: parseFloat(parts[3]),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const candidates = [];
|
||||
stations.forEach(s => {
|
||||
let minDist = Infinity;
|
||||
let minIndex = -1;
|
||||
for (let i = 0; i < polylineCoords.length; i++) {
|
||||
const d = distKm(s.lat, s.lon, polylineCoords[i][0], polylineCoords[i][1]);
|
||||
if (d < minDist) { minDist = d; minIndex = i; }
|
||||
}
|
||||
if (minDist < 2) {
|
||||
candidates.push({ ...s, polyIndex: minIndex });
|
||||
}
|
||||
});
|
||||
candidates.sort((a, b) => a.polyIndex - b.polyIndex);
|
||||
|
||||
const passages = candidates.map(c => ({
|
||||
toll: { operatorId: c.operatorId, tollId: c.tollId },
|
||||
passageDate: new Date().toISOString()
|
||||
}));
|
||||
|
||||
try {
|
||||
console.log(`Sending ${passages.length} passages to Ulys...`);
|
||||
const res = await axios.post('https://api-ulys.azure-api.net/tollstation/v1/rate', {
|
||||
vehicleCategory: "2", paymentOption: 2, tollPassages: passages
|
||||
});
|
||||
console.log(JSON.stringify(res.data, null, 2));
|
||||
} catch(e) {
|
||||
console.log(e.response ? e.response.data : e.message);
|
||||
}
|
||||
}
|
||||
bulkRateTest();
|
||||
@@ -0,0 +1,17 @@
|
||||
const travel = require('./src/travel.js');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
const auth = require('./utils/auth.js');
|
||||
auth.authenticateUser = async () => ({ uid: 'dummy' });
|
||||
|
||||
async function test() {
|
||||
const req = {
|
||||
headers: { authorization: 'Bearer dummy' },
|
||||
body: { origin: "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France", destination: "Grenoble, France", vehicleCategory: "2" }
|
||||
};
|
||||
const res = {
|
||||
status: function() { return this; },
|
||||
json: function(data) { console.log(JSON.stringify(data, null, 2)); }
|
||||
};
|
||||
await travel.googleMapsComputeRoute(req, res);
|
||||
}
|
||||
test();
|
||||
@@ -0,0 +1,32 @@
|
||||
const axios = require('axios');
|
||||
const polylineLib = require('@mapbox/polyline');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
const { googleMapsComputeRoute } = require('./src/travel.js');
|
||||
|
||||
async function testGrenobleDetailed() {
|
||||
const origin = "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France";
|
||||
const destination = "Grenoble, France";
|
||||
|
||||
const req = {
|
||||
headers: { authorization: 'Bearer MOCK' },
|
||||
body: { origin, destination, vehicleTollCategory: 2 }
|
||||
};
|
||||
let resultBody = null;
|
||||
const res = {
|
||||
set: () => {}, status: () => res,
|
||||
json: (data) => { resultBody = data; return res; },
|
||||
send: (data) => { resultBody = data; return res; }
|
||||
};
|
||||
|
||||
const auth = require('./utils/auth');
|
||||
auth.authenticateUser = async () => {};
|
||||
|
||||
await googleMapsComputeRoute(req, res);
|
||||
|
||||
if (resultBody.error) {
|
||||
console.error(`Error: ${resultBody.error}`);
|
||||
} else {
|
||||
console.log(JSON.stringify(resultBody.routes[0], null, 2));
|
||||
}
|
||||
}
|
||||
testGrenobleDetailed();
|
||||
@@ -0,0 +1,14 @@
|
||||
const axios = require('axios');
|
||||
async function getUlysRate(vehicleCategory, passages) {
|
||||
const payload = {
|
||||
vehicleCategory: String(vehicleCategory),
|
||||
paymentOption: 2,
|
||||
tollPassages: passages.map((p) => ({
|
||||
toll: { operatorId: p.operatorId, tollId: p.tollId },
|
||||
passageDate: new Date().toISOString(),
|
||||
})),
|
||||
};
|
||||
const res = await axios.post('https://api-ulys.azure-api.net/tollstation/v1/rate', payload);
|
||||
console.log(JSON.stringify(res.data, null, 2));
|
||||
}
|
||||
getUlysRate(2, [{operatorId: '03', tollId: '001'}, {operatorId: '03', tollId: '003'}]);
|
||||
@@ -0,0 +1,37 @@
|
||||
const axios = require('axios');
|
||||
const polylineLib = require('@mapbox/polyline');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
|
||||
async function testHalfPolyline() {
|
||||
const apiKey = process.env.API_MAPS;
|
||||
const resToll = await axios.post('https://routes.googleapis.com/directions/v2:computeRoutes', {
|
||||
travelMode: 'DRIVE', routingPreference: 'TRAFFIC_UNAWARE',
|
||||
origin: { address: "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France" },
|
||||
destination: { address: "Toulouse, France" },
|
||||
}, { headers: { 'Content-Type': 'application/json', 'X-Goog-Api-Key': apiKey, 'X-Goog-FieldMask': 'routes.polyline.encodedPolyline' } });
|
||||
|
||||
const mainPoly = resToll.data.routes[0].polyline.encodedPolyline;
|
||||
const mainCoords = polylineLib.decode(mainPoly, 5);
|
||||
|
||||
const halfCoords = mainCoords.slice(0, Math.floor(mainCoords.length / 2));
|
||||
const halfPoly = polylineLib.encode(halfCoords, 5);
|
||||
|
||||
console.log(`Sending first half (${halfCoords.length} points)`);
|
||||
|
||||
const ulysUrl = `https://api-ulys.azure-api.net/placemark/v2/legs?precision=5&includeLayersIds=GaresPeage`;
|
||||
|
||||
try {
|
||||
const res = await axios.post(ulysUrl, JSON.stringify(halfPoly), {
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
const feats = res.data.features || res.data;
|
||||
console.log(`Found ${feats.length} gates.`);
|
||||
feats.forEach(f => {
|
||||
const pm = f.Placemark || f.placemark || {};
|
||||
console.log(pm.Preview || pm.preview || "Gate");
|
||||
});
|
||||
} catch(e) {
|
||||
console.log("Error:", e.message);
|
||||
}
|
||||
}
|
||||
testHalfPolyline();
|
||||
@@ -0,0 +1,66 @@
|
||||
const axios = require('axios');
|
||||
const polylineLib = require('@mapbox/polyline');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
|
||||
function distKm(lat1, lng1, lat2, lng2) {
|
||||
const dLat = (lat2 - lat1) * Math.PI / 180;
|
||||
const dLng = (lng2 - lng1) * Math.PI / 180;
|
||||
const a = Math.sin(dLat/2)**2 + Math.cos(lat1*Math.PI/180) * Math.cos(lat2*Math.PI/180) * Math.sin(dLng/2)**2;
|
||||
return 6371 * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
|
||||
}
|
||||
|
||||
function interpolatePolyline(coords, maxDistKm = 0.05) {
|
||||
const newCoords = [];
|
||||
if(coords.length === 0) return newCoords;
|
||||
newCoords.push(coords[0]);
|
||||
for(let i=1; i<coords.length; i++) {
|
||||
const p1 = coords[i-1];
|
||||
const p2 = coords[i];
|
||||
const d = distKm(p1[0], p1[1], p2[0], p2[1]);
|
||||
if(d > maxDistKm) {
|
||||
const steps = Math.ceil(d / maxDistKm);
|
||||
for(let step=1; step<steps; step++) {
|
||||
const fraction = step / steps;
|
||||
const lat = p1[0] + (p2[0] - p1[0]) * fraction;
|
||||
const lng = p1[1] + (p2[1] - p1[1]) * fraction;
|
||||
newCoords.push([lat, lng]);
|
||||
}
|
||||
}
|
||||
newCoords.push(p2);
|
||||
}
|
||||
return newCoords;
|
||||
}
|
||||
|
||||
async function testInterpolatedToulouse() {
|
||||
const apiKey = process.env.API_MAPS;
|
||||
const resToll = await axios.post('https://routes.googleapis.com/directions/v2:computeRoutes', {
|
||||
travelMode: 'DRIVE', routingPreference: 'TRAFFIC_UNAWARE',
|
||||
origin: { address: "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France" },
|
||||
destination: { address: "Toulouse, France" },
|
||||
}, { headers: { 'Content-Type': 'application/json', 'X-Goog-Api-Key': apiKey, 'X-Goog-FieldMask': 'routes.polyline.encodedPolyline' } });
|
||||
|
||||
const poly = resToll.data.routes[0].polyline.encodedPolyline;
|
||||
const coords = polylineLib.decode(poly, 5);
|
||||
|
||||
const interpolated = interpolatePolyline(coords, 0.05); // 50 meters
|
||||
console.log(`Original points: ${coords.length}, Interpolated: ${interpolated.length}`);
|
||||
|
||||
const polyInt = polylineLib.encode(interpolated, 5);
|
||||
|
||||
const ulysUrl = `https://api-ulys.azure-api.net/placemark/v2/legs?precision=5&includeLayersIds=GaresPeage`;
|
||||
|
||||
try {
|
||||
const res = await axios.post(ulysUrl, JSON.stringify(polyInt), {
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
const feats = res.data.features || res.data;
|
||||
console.log(`Found ${feats.length} gates.`);
|
||||
feats.forEach(f => {
|
||||
const pm = f.Placemark || f.placemark || {};
|
||||
console.log(pm.Preview || pm.preview || "Gate");
|
||||
});
|
||||
} catch(e) {
|
||||
console.log("Error:", e.message);
|
||||
}
|
||||
}
|
||||
testInterpolatedToulouse();
|
||||
@@ -0,0 +1,147 @@
|
||||
const axios = require('axios');
|
||||
const fs = require('fs');
|
||||
const csv = require('csv-parser');
|
||||
const polylineLib = require('@mapbox/polyline');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
|
||||
function loadTollStations() {
|
||||
return new Promise((resolve) => {
|
||||
const csvPath = './travel/gares_peage_export.csv';
|
||||
const results = [];
|
||||
fs.createReadStream(csvPath)
|
||||
.pipe(csv())
|
||||
.on('data', (row) => {
|
||||
if (row.id_gare && row.lat && row.lon) {
|
||||
results.push({
|
||||
id: row.id_gare,
|
||||
operatorId: row.id_gare.substring(0, 2),
|
||||
tollId: row.id_gare.substring(2, 5),
|
||||
name: row.nom || '',
|
||||
lat: parseFloat(row.lat),
|
||||
lon: parseFloat(row.lon),
|
||||
});
|
||||
}
|
||||
})
|
||||
.on('end', () => resolve(results));
|
||||
});
|
||||
}
|
||||
|
||||
function _distKm(lat1, lng1, lat2, lng2) {
|
||||
const dLat = (lat2 - lat1) * Math.PI / 180;
|
||||
const dLng = (lng2 - lng1) * Math.PI / 180;
|
||||
const a = Math.sin(dLat/2)**2 + Math.cos(lat1*Math.PI/180) * Math.cos(lat2*Math.PI/180) * Math.sin(dLng/2)**2;
|
||||
return 6371 * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
|
||||
}
|
||||
|
||||
async function getUlysRate(vehicleCategory, passages) {
|
||||
try {
|
||||
const payload = {
|
||||
vehicleCategory: String(vehicleCategory),
|
||||
paymentOption: 2,
|
||||
tollPassages: passages.map((p) => ({
|
||||
toll: { operatorId: p.operatorId, tollId: p.tollId },
|
||||
passageDate: new Date().toISOString(),
|
||||
})),
|
||||
};
|
||||
const res = await axios.post('https://api-ulys.azure-api.net/tollstation/v1/rate', payload);
|
||||
const data = res.data;
|
||||
if (Array.isArray(data) && data.length > 0) {
|
||||
if (passages.length === 2) {
|
||||
if (data.length !== 1 || !data[0].exitToll) return null;
|
||||
return data[0].price > 0 ? data[0].price : null;
|
||||
} else {
|
||||
if (data.length === 1 && data[0].price > 0) return data[0].price;
|
||||
const total = data.reduce((sum, d) => sum + (d.price || 0), 0);
|
||||
return total > 0 ? total : null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
} catch (e) { return null; }
|
||||
}
|
||||
|
||||
async function test() {
|
||||
const origin = "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France";
|
||||
const destination = "Nice, France";
|
||||
const apiKey = process.env.API_MAPS;
|
||||
|
||||
const routesUrl = 'https://routes.googleapis.com/directions/v2:computeRoutes';
|
||||
const res = await axios.post(routesUrl, {
|
||||
travelMode: 'DRIVE', routingPreference: 'TRAFFIC_UNAWARE', origin: { address: origin }, destination: { address: destination },
|
||||
}, { headers: { 'Content-Type': 'application/json', 'X-Goog-Api-Key': apiKey, 'X-Goog-FieldMask': 'routes.polyline.encodedPolyline' }});
|
||||
|
||||
const poly = res.data.routes[0].polyline.encodedPolyline;
|
||||
const coords = polylineLib.decode(poly, 5);
|
||||
|
||||
const safePolyline = poly;
|
||||
const url = 'https://api-ulys.azure-api.net/placemark/v2/legs?precision=5&includeLayersIds=GaresPeage';
|
||||
const ulysRes = await axios.post(url, JSON.stringify(safePolyline), { headers: { 'Content-Type': 'application/json' } });
|
||||
const items = Array.isArray(ulysRes.data) ? ulysRes.data : (ulysRes.data.features || []);
|
||||
|
||||
const stations = await loadTollStations();
|
||||
const gates = [];
|
||||
|
||||
for (const item of items) {
|
||||
const pm = item.Placemark || item.placemark || {};
|
||||
const tags = pm.Tags || pm.tags || {};
|
||||
let idStr = tags.ID_PEAGE;
|
||||
if (!idStr && pm.Code) idStr = pm.Code.split('_')[0];
|
||||
const s = stations.find(s => s.id === idStr);
|
||||
if (s && !gates.find(g => g.id === idStr)) gates.push(s);
|
||||
}
|
||||
|
||||
// Fallback for missing first system
|
||||
let missingSystemPrice = 0;
|
||||
if (gates.length > 0) {
|
||||
const originLat = coords[0][0];
|
||||
const originLng = coords[0][1];
|
||||
const firstGate = gates[0];
|
||||
const distToFirstGate = _distKm(originLat, originLng, firstGate.lat, firstGate.lon);
|
||||
|
||||
if (distToFirstGate > 50) {
|
||||
console.log(`First gate ${firstGate.name} is ${Math.round(distToFirstGate)}km from origin. Checking for missing system...`);
|
||||
// Find all geometric gates within 2km of the route, UP TO the firstGate
|
||||
let firstGateIndex = 0;
|
||||
for (let i = 0; i < coords.length; i++) {
|
||||
if (_distKm(coords[i][0], coords[i][1], firstGate.lat, firstGate.lon) < 1) {
|
||||
firstGateIndex = i; break;
|
||||
}
|
||||
}
|
||||
|
||||
const candidates = [];
|
||||
stations.forEach(s => {
|
||||
let minDist = Infinity;
|
||||
let minIndex = -1;
|
||||
for (let i = 0; i < firstGateIndex; i++) {
|
||||
const d = _distKm(s.lat, s.lon, coords[i][0], coords[i][1]);
|
||||
if (d < minDist) { minDist = d; minIndex = i; }
|
||||
}
|
||||
if (minDist < 2) {
|
||||
candidates.push({ ...s, polyIndex: minIndex });
|
||||
}
|
||||
});
|
||||
|
||||
candidates.sort((a, b) => a.polyIndex - b.polyIndex);
|
||||
|
||||
if (candidates.length >= 2) {
|
||||
// Try combinations from furthest to closest to find the longest closed system
|
||||
let found = false;
|
||||
for (let i = 0; i < Math.min(10, candidates.length); i++) {
|
||||
for (let j = candidates.length - 1; j > i && j > candidates.length - 10; j--) {
|
||||
if (candidates[i].operatorId !== candidates[j].operatorId) continue;
|
||||
const price = await getUlysRate(2, [candidates[i], candidates[j]]);
|
||||
if (price) {
|
||||
console.log(`Found missing system: ${candidates[i].name} -> ${candidates[j].name} = ${price}€`);
|
||||
missingSystemPrice += price;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Missing system price: ${missingSystemPrice}€`);
|
||||
}
|
||||
test();
|
||||
@@ -0,0 +1,44 @@
|
||||
const axios = require('axios');
|
||||
const polylineLib = require('@mapbox/polyline');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
|
||||
async function directTestToulouse() {
|
||||
const origin = "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France";
|
||||
const destination = "Toulouse, France";
|
||||
const apiKey = process.env.API_MAPS;
|
||||
|
||||
const routesUrl = 'https://routes.googleapis.com/directions/v2:computeRoutes';
|
||||
const fieldMask = 'routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline,routes.travelAdvisory.tollInfo';
|
||||
|
||||
const resToll = await axios.post(routesUrl, {
|
||||
travelMode: 'DRIVE',
|
||||
routingPreference: 'TRAFFIC_UNAWARE',
|
||||
origin: { address: origin },
|
||||
destination: { address: destination },
|
||||
routeModifiers: { avoidTolls: false }
|
||||
}, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Goog-Api-Key': apiKey,
|
||||
'X-Goog-FieldMask': fieldMask,
|
||||
}
|
||||
});
|
||||
|
||||
const poly = resToll.data.routes[0].polyline.encodedPolyline;
|
||||
const decoded = polylineLib.decode(poly, 5);
|
||||
const poly6 = polylineLib.encode(decoded, 6);
|
||||
|
||||
const ulysUrl = `https://api-ulys.azure-api.net/placemark/v2/legs?precision=6&includeLayersIds=GaresPeage`;
|
||||
|
||||
try {
|
||||
const res = await axios.post(ulysUrl, JSON.stringify(poly6), {
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
console.log("Ulys Response (precision=6):");
|
||||
console.log(res.data);
|
||||
} catch(e) {
|
||||
console.log("Ulys Error:", e.message);
|
||||
if(e.response && e.response.data) console.log(e.response.data);
|
||||
}
|
||||
}
|
||||
directTestToulouse();
|
||||
@@ -0,0 +1,23 @@
|
||||
const axios = require('axios');
|
||||
async function testRate() {
|
||||
const passages = [
|
||||
{ operatorId: '04', tollId: '201' }, // VIENNE
|
||||
{ operatorId: '04', tollId: '457' } // TOULOUSE-NORD/OUEST
|
||||
];
|
||||
const payload = {
|
||||
vehicleCategory: "2",
|
||||
paymentOption: 2,
|
||||
tollPassages: passages.map((p) => ({
|
||||
toll: { operatorId: p.operatorId, tollId: p.tollId },
|
||||
passageDate: new Date().toISOString(),
|
||||
})),
|
||||
};
|
||||
try {
|
||||
const res = await axios.post('https://api-ulys.azure-api.net/tollstation/v1/rate', payload);
|
||||
console.log("Rate:");
|
||||
console.log(JSON.stringify(res.data, null, 2));
|
||||
} catch (e) {
|
||||
console.error(e.response ? e.response.data : e.message);
|
||||
}
|
||||
}
|
||||
testRate();
|
||||
@@ -0,0 +1,21 @@
|
||||
const axios = require('axios');
|
||||
async function testRate() {
|
||||
const passages = [
|
||||
{ operatorId: '04', tollId: '178' },
|
||||
{ operatorId: '09', tollId: '079' }
|
||||
];
|
||||
const payload = {
|
||||
vehicleCategory: "2", paymentOption: 2,
|
||||
tollPassages: passages.map((p) => ({
|
||||
toll: { operatorId: p.operatorId, tollId: p.tollId }, passageDate: new Date().toISOString(),
|
||||
})),
|
||||
};
|
||||
try {
|
||||
const res = await axios.post('https://api-ulys.azure-api.net/tollstation/v1/rate', payload);
|
||||
console.log("Rate:");
|
||||
console.log(JSON.stringify(res.data, null, 2));
|
||||
} catch (e) {
|
||||
console.error(e.response ? e.response.data : e.message);
|
||||
}
|
||||
}
|
||||
testRate();
|
||||
@@ -0,0 +1,23 @@
|
||||
const axios = require('axios');
|
||||
async function testRateVienneToulouseEst() {
|
||||
const passages = [
|
||||
{ operatorId: '04', tollId: '178' }, // MONTBRISON (04178)
|
||||
{ operatorId: '04', tollId: '456' } // TOULOUSE-EST (04456)
|
||||
];
|
||||
const payload = {
|
||||
vehicleCategory: "2",
|
||||
paymentOption: 2,
|
||||
tollPassages: passages.map((p) => ({
|
||||
toll: { operatorId: p.operatorId, tollId: p.tollId },
|
||||
passageDate: new Date().toISOString(),
|
||||
})),
|
||||
};
|
||||
try {
|
||||
const res = await axios.post('https://api-ulys.azure-api.net/tollstation/v1/rate', payload);
|
||||
console.log("Rate MONTBRISON -> TOULOUSE-EST:");
|
||||
console.log(JSON.stringify(res.data, null, 2));
|
||||
} catch (e) {
|
||||
console.error(e.response ? e.response.data : e.message);
|
||||
}
|
||||
}
|
||||
testRateVienneToulouseEst();
|
||||
@@ -0,0 +1,23 @@
|
||||
const axios = require('axios');
|
||||
async function testRateVienneToulouseEst() {
|
||||
const passages = [
|
||||
{ operatorId: '04', tollId: '201' }, // VIENNE (04201)
|
||||
{ operatorId: '04', tollId: '456' } // TOULOUSE-EST (04456)
|
||||
];
|
||||
const payload = {
|
||||
vehicleCategory: "2",
|
||||
paymentOption: 2,
|
||||
tollPassages: passages.map((p) => ({
|
||||
toll: { operatorId: p.operatorId, tollId: p.tollId },
|
||||
passageDate: new Date().toISOString(),
|
||||
})),
|
||||
};
|
||||
try {
|
||||
const res = await axios.post('https://api-ulys.azure-api.net/tollstation/v1/rate', payload);
|
||||
console.log("Rate VIENNE -> TOULOUSE-EST:");
|
||||
console.log(JSON.stringify(res.data, null, 2));
|
||||
} catch (e) {
|
||||
console.error(e.response ? e.response.data : e.message);
|
||||
}
|
||||
}
|
||||
testRateVienneToulouseEst();
|
||||
@@ -0,0 +1,40 @@
|
||||
const axios = require('axios');
|
||||
const polylineLib = require('@mapbox/polyline');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
const { googleMapsComputeRoute } = require('./src/travel.js');
|
||||
|
||||
async function testRoute(destination, expectedPrice) {
|
||||
const origin = "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France";
|
||||
console.log(`\nTesting ${destination}...`);
|
||||
|
||||
const req = {
|
||||
headers: { authorization: 'Bearer MOCK' },
|
||||
body: { origin, destination, vehicleTollCategory: 2 }
|
||||
};
|
||||
let resultBody = null;
|
||||
const res = {
|
||||
set: () => {}, status: () => res,
|
||||
json: (data) => { resultBody = data; return res; },
|
||||
send: (data) => { resultBody = data; return res; }
|
||||
};
|
||||
|
||||
await googleMapsComputeRoute(req, res);
|
||||
|
||||
if (resultBody.error) {
|
||||
console.error(`Error: ${resultBody.error}`);
|
||||
} else {
|
||||
const toll = resultBody.routes && resultBody.routes.length > 0 ? resultBody.routes[0].tollCost : 0;
|
||||
console.log(`Toll: ${toll}€ (Expected: ${expectedPrice}€)`);
|
||||
}
|
||||
}
|
||||
|
||||
async function run() {
|
||||
// Mock Firebase auth specifically for this test
|
||||
const auth = require('./utils/auth');
|
||||
auth.authenticateUser = async () => {};
|
||||
|
||||
await testRoute("Saint-Denis, France", 64.3);
|
||||
await testRoute("Grenoble, France", 21.7);
|
||||
await testRoute("Nice, France", 77.2);
|
||||
}
|
||||
run();
|
||||
@@ -0,0 +1,130 @@
|
||||
const axios = require('axios');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
const { _distKm } = require('./src/travel.js');
|
||||
|
||||
function distKm(lat1, lng1, lat2, lng2) {
|
||||
const dLat = (lat2 - lat1) * Math.PI / 180;
|
||||
const dLng = (lng2 - lng1) * Math.PI / 180;
|
||||
const a = Math.sin(dLat/2)**2 + Math.cos(lat1*Math.PI/180) * Math.cos(lat2*Math.PI/180) * Math.sin(dLng/2)**2;
|
||||
return 6371 * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
|
||||
}
|
||||
|
||||
async function testTollSegments() {
|
||||
const apiKey = process.env.API_MAPS;
|
||||
const resToll = await axios.post('https://routes.googleapis.com/directions/v2:computeRoutes', {
|
||||
travelMode: 'DRIVE', routingPreference: 'TRAFFIC_UNAWARE',
|
||||
origin: { address: "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France" },
|
||||
destination: { address: "Nice, France" },
|
||||
}, { headers: { 'Content-Type': 'application/json', 'X-Goog-Api-Key': apiKey, 'X-Goog-FieldMask': 'routes.legs.steps.navigationInstruction,routes.legs.steps.distanceMeters,routes.legs.steps.startLocation,routes.legs.steps.endLocation,routes.legs.steps.polyline.encodedPolyline' } });
|
||||
|
||||
const steps = resToll.data.routes[0].legs[0].steps;
|
||||
|
||||
const rawCsv = fs.readFileSync(path.join(__dirname, 'travel', 'gares_peage_export.csv'), 'utf8');
|
||||
const stations = [];
|
||||
const lines = rawCsv.split('\n');
|
||||
for (let i = 1; i < lines.length; i++) {
|
||||
const l = lines[i].trim();
|
||||
if (!l) continue;
|
||||
const parts = l.split(',');
|
||||
if (parts.length >= 4) {
|
||||
const idStr = String(parts[0]).padStart(5, '0');
|
||||
stations.push({
|
||||
id: idStr, operatorId: idStr.substring(0, 2), tollId: idStr.substring(2, 5),
|
||||
name: parts[1], lat: parseFloat(parts[2]), lon: parseFloat(parts[3]),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getClosestGate(lat, lng) {
|
||||
let minDist = Infinity;
|
||||
let closest = null;
|
||||
for(let s of stations) {
|
||||
const d = distKm(lat, lng, s.lat, s.lon);
|
||||
if(d < minDist) { minDist = d; closest = s; }
|
||||
}
|
||||
return minDist < 5 ? closest : null;
|
||||
}
|
||||
|
||||
const segments = [];
|
||||
let currentSegment = null;
|
||||
for(let i=0; i<steps.length; i++) {
|
||||
const step = steps[i];
|
||||
const inst = step.navigationInstruction ? step.navigationInstruction.instructions : '';
|
||||
const isToll = inst.toLowerCase().includes('péage') || inst.toLowerCase().includes('toll');
|
||||
|
||||
if (isToll) {
|
||||
if (!currentSegment) {
|
||||
currentSegment = { steps: [] };
|
||||
}
|
||||
currentSegment.steps.push(step);
|
||||
} else {
|
||||
if (currentSegment) {
|
||||
segments.push(currentSegment);
|
||||
currentSegment = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (currentSegment) segments.push(currentSegment);
|
||||
|
||||
const polylineLib = require('@mapbox/polyline');
|
||||
let totalToll = 0;
|
||||
for (let i=0; i<segments.length; i++) {
|
||||
const seg = segments[i];
|
||||
let segCoords = [];
|
||||
for(let step of seg.steps) {
|
||||
if(step.polyline && step.polyline.encodedPolyline) {
|
||||
segCoords = segCoords.concat(polylineLib.decode(step.polyline.encodedPolyline, 5));
|
||||
}
|
||||
}
|
||||
|
||||
const candidates = [];
|
||||
stations.forEach(s => {
|
||||
let minDist = Infinity;
|
||||
let minIndex = -1;
|
||||
for (let j = 0; j < segCoords.length; j++) {
|
||||
const d = distKm(s.lat, s.lon, segCoords[j][0], segCoords[j][1]);
|
||||
if (d < minDist) { minDist = d; minIndex = j; }
|
||||
}
|
||||
if (minDist < 2) { // must be within 2km of the segment
|
||||
candidates.push({ ...s, polyIndex: minIndex });
|
||||
}
|
||||
});
|
||||
candidates.sort((a, b) => a.polyIndex - b.polyIndex);
|
||||
|
||||
let entry = null, exit = null;
|
||||
if (candidates.length > 0) {
|
||||
entry = candidates[0];
|
||||
exit = candidates[candidates.length - 1];
|
||||
}
|
||||
|
||||
console.log(`Segment ${i+1}: points=${segCoords.length}, candidates=${candidates.length}, Entry=${entry?entry.name:'none'}, Exit=${exit?exit.name:'none'}`);
|
||||
|
||||
|
||||
if (entry && exit) {
|
||||
try {
|
||||
const passages = [
|
||||
{ operatorId: entry.operatorId, tollId: entry.tollId },
|
||||
{ operatorId: exit.operatorId, tollId: exit.tollId }
|
||||
];
|
||||
const payload = {
|
||||
vehicleCategory: "2", paymentOption: 2,
|
||||
tollPassages: passages.map((p) => ({ toll: { operatorId: p.operatorId, tollId: p.tollId }, passageDate: new Date().toISOString() })),
|
||||
};
|
||||
const res = await axios.post('https://api-ulys.azure-api.net/tollstation/v1/rate', payload);
|
||||
const data = res.data;
|
||||
let price = 0;
|
||||
if (data.length === 1 && data[0].price > 0) price = data[0].price;
|
||||
if (data.length > 1) {
|
||||
const pItem = data.find(d => d.price > 0);
|
||||
if (pItem) price = pItem.price;
|
||||
}
|
||||
console.log(` -> Price: ${price}€`);
|
||||
totalToll += price;
|
||||
} catch(e) { console.log(` -> Ulys Error`); }
|
||||
}
|
||||
}
|
||||
console.log(`Total Toll: ${totalToll}€`);
|
||||
}
|
||||
testTollSegments();
|
||||
@@ -0,0 +1,21 @@
|
||||
const axios = require('axios');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
|
||||
async function testSteps() {
|
||||
const apiKey = process.env.API_MAPS;
|
||||
const resToll = await axios.post('https://routes.googleapis.com/directions/v2:computeRoutes', {
|
||||
travelMode: 'DRIVE', routingPreference: 'TRAFFIC_UNAWARE',
|
||||
origin: { address: "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France" },
|
||||
destination: { address: "Toulouse, France" },
|
||||
}, { headers: { 'Content-Type': 'application/json', 'X-Goog-Api-Key': apiKey, 'X-Goog-FieldMask': 'routes.legs.steps.navigationInstruction,routes.legs.steps.distanceMeters,routes.legs.steps.startLocation,routes.legs.steps.endLocation' } });
|
||||
|
||||
const steps = resToll.data.routes[0].legs[0].steps;
|
||||
for(let i=0; i<steps.length; i++) {
|
||||
const step = steps[i];
|
||||
const inst = step.navigationInstruction ? step.navigationInstruction.instructions : '';
|
||||
if(inst.toLowerCase().includes('péage') || inst.toLowerCase().includes('toll')) {
|
||||
console.log(`Step ${i}: ${inst} (Dist: ${step.distanceMeters}m)`);
|
||||
}
|
||||
}
|
||||
}
|
||||
testSteps();
|
||||
@@ -0,0 +1,45 @@
|
||||
const axios = require('axios');
|
||||
const polylineLib = require('@mapbox/polyline');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
|
||||
async function testStepsPolyline() {
|
||||
const apiKey = process.env.API_MAPS;
|
||||
const resToll = await axios.post('https://routes.googleapis.com/directions/v2:computeRoutes', {
|
||||
travelMode: 'DRIVE', routingPreference: 'TRAFFIC_UNAWARE',
|
||||
origin: { address: "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France" },
|
||||
destination: { address: "Toulouse, France" },
|
||||
}, { headers: { 'Content-Type': 'application/json', 'X-Goog-Api-Key': apiKey, 'X-Goog-FieldMask': 'routes.polyline.encodedPolyline,routes.legs.steps.polyline.encodedPolyline' } });
|
||||
|
||||
const mainPoly = resToll.data.routes[0].polyline.encodedPolyline;
|
||||
const mainCoords = polylineLib.decode(mainPoly, 5);
|
||||
|
||||
const steps = resToll.data.routes[0].legs[0].steps;
|
||||
let stepCoords = [];
|
||||
for(let step of steps) {
|
||||
if(step.polyline && step.polyline.encodedPolyline) {
|
||||
stepCoords = stepCoords.concat(polylineLib.decode(step.polyline.encodedPolyline, 5));
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Main polyline points: ${mainCoords.length}`);
|
||||
console.log(`Steps combined points: ${stepCoords.length}`);
|
||||
|
||||
const combinedPoly = polylineLib.encode(stepCoords, 5);
|
||||
|
||||
const ulysUrl = `https://api-ulys.azure-api.net/placemark/v2/legs?precision=5&includeLayersIds=GaresPeage`;
|
||||
|
||||
try {
|
||||
const res = await axios.post(ulysUrl, JSON.stringify(combinedPoly), {
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
const feats = res.data.features || res.data;
|
||||
console.log(`Found ${feats.length} gates.`);
|
||||
feats.forEach(f => {
|
||||
const pm = f.Placemark || f.placemark || {};
|
||||
console.log(pm.Preview || pm.preview || "Gate");
|
||||
});
|
||||
} catch(e) {
|
||||
console.log("Error:", e.message);
|
||||
}
|
||||
}
|
||||
testStepsPolyline();
|
||||
@@ -0,0 +1,31 @@
|
||||
const axios = require('axios');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
const { googleMapsComputeRoute } = require('./src/travel.js');
|
||||
|
||||
async function testToulouse() {
|
||||
const origin = "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France";
|
||||
const destination = "Toulouse, France";
|
||||
|
||||
const req = {
|
||||
headers: { authorization: 'Bearer MOCK' },
|
||||
body: { origin, destination, vehicleTollCategory: 2 }
|
||||
};
|
||||
let resultBody = null;
|
||||
const res = {
|
||||
set: () => {}, status: () => res,
|
||||
json: (data) => { resultBody = data; return res; },
|
||||
send: (data) => { resultBody = data; return res; }
|
||||
};
|
||||
|
||||
const auth = require('./utils/auth');
|
||||
auth.authenticateUser = async () => {};
|
||||
|
||||
await googleMapsComputeRoute(req, res);
|
||||
|
||||
if (resultBody.error) {
|
||||
console.error(`Error: ${resultBody.error}`);
|
||||
} else {
|
||||
console.log(JSON.stringify(resultBody.routes[0], null, 2));
|
||||
}
|
||||
}
|
||||
testToulouse();
|
||||
@@ -0,0 +1,30 @@
|
||||
const axios = require('axios');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
|
||||
async function testUlysParams() {
|
||||
const apiKey = process.env.API_MAPS;
|
||||
const resToll = await axios.post('https://routes.googleapis.com/directions/v2:computeRoutes', {
|
||||
travelMode: 'DRIVE', routingPreference: 'TRAFFIC_UNAWARE',
|
||||
origin: { address: "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France" },
|
||||
destination: { address: "Toulouse, France" },
|
||||
}, { headers: { 'Content-Type': 'application/json', 'X-Goog-Api-Key': apiKey, 'X-Goog-FieldMask': 'routes.polyline.encodedPolyline' } });
|
||||
|
||||
const poly = resToll.data.routes[0].polyline.encodedPolyline;
|
||||
|
||||
const urls = [
|
||||
`https://api-ulys.azure-api.net/placemark/v2/legs?precision=5&includeLayersIds=GaresPeage&radius=100`,
|
||||
`https://api-ulys.azure-api.net/placemark/v2/legs?precision=5&includeLayersIds=GaresPeage&tolerance=100`,
|
||||
`https://api-ulys.azure-api.net/placemark/v2/legs?precision=5&includeLayersIds=GaresPeage&distance=100`
|
||||
];
|
||||
|
||||
for(let url of urls) {
|
||||
try {
|
||||
const res = await axios.post(url, JSON.stringify(poly), { headers: { 'Content-Type': 'application/json' } });
|
||||
console.log(`URL: ${url}`);
|
||||
console.log(`Found ${res.data.length || (res.data.features && res.data.features.length) || 0} gates`);
|
||||
} catch(e) {
|
||||
console.log(`Error on ${url}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
testUlysParams();
|
||||
@@ -0,0 +1,41 @@
|
||||
const axios = require('axios');
|
||||
const polylineLib = require('@mapbox/polyline');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
|
||||
async function directTestToulouse() {
|
||||
const origin = "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France";
|
||||
const destination = "Toulouse, France";
|
||||
const apiKey = process.env.API_MAPS;
|
||||
|
||||
const routesUrl = 'https://routes.googleapis.com/directions/v2:computeRoutes';
|
||||
const fieldMask = 'routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline,routes.travelAdvisory.tollInfo';
|
||||
|
||||
const resToll = await axios.post(routesUrl, {
|
||||
travelMode: 'DRIVE',
|
||||
routingPreference: 'TRAFFIC_UNAWARE',
|
||||
origin: { address: origin },
|
||||
destination: { address: destination },
|
||||
routeModifiers: { avoidTolls: false }
|
||||
}, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Goog-Api-Key': apiKey,
|
||||
'X-Goog-FieldMask': fieldMask,
|
||||
}
|
||||
});
|
||||
|
||||
const poly = resToll.data.routes[0].polyline.encodedPolyline;
|
||||
const ulysUrl = `https://api-ulys.azure-api.net/placemark/v2/legs?precision=5&includeLayersIds=GaresPeage`;
|
||||
|
||||
try {
|
||||
const res = await axios.post(ulysUrl, JSON.stringify(poly), {
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
console.log("Ulys Response:");
|
||||
console.log(res.data);
|
||||
} catch(e) {
|
||||
console.log("Ulys Error:", e.message);
|
||||
if(e.response && e.response.data) console.log(e.response.data);
|
||||
}
|
||||
}
|
||||
directTestToulouse();
|
||||
@@ -15,8 +15,13 @@ List<LatLng> safeDecodePolyline(String encoded) {
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
|
||||
|
||||
// Dart Web bitwise operations (~ and >>) can cause 32-bit unsigned wrap-around
|
||||
// Using arithmetic avoids the issue where lat becomes 42995.xxxx (offset by 2^32)
|
||||
int dlat = (result & 1) != 0 ? -((result >> 1) + 1) : (result >> 1);
|
||||
lat += dlat;
|
||||
// Correction manuelle au cas où un wrap unsigned 32-bit s'est produit
|
||||
if (lat > 2147483647) lat -= 4294967296;
|
||||
|
||||
shift = 0;
|
||||
result = 0;
|
||||
@@ -26,15 +31,23 @@ List<LatLng> safeDecodePolyline(String encoded) {
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
|
||||
|
||||
int dlng = (result & 1) != 0 ? -((result >> 1) + 1) : (result >> 1);
|
||||
lng += dlng;
|
||||
if (lng > 2147483647) lng -= 4294967296;
|
||||
|
||||
double finalLat = lat / 1e5;
|
||||
double finalLng = lng / 1e5;
|
||||
|
||||
double finalLat = (lat / 1e5).clamp(-90.0, 90.0);
|
||||
double finalLng = (lng / 1e5).clamp(-180.0, 180.0);
|
||||
poly.add(LatLng(finalLat, finalLng));
|
||||
}
|
||||
|
||||
return poly;
|
||||
} catch (e) {
|
||||
// ignore: avoid_print
|
||||
print('[POLYLINE] Erreur décodage: $e');
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,15 @@ class RouteMapWidget extends StatelessWidget {
|
||||
});
|
||||
|
||||
List<LatLng> _decode(String encoded) {
|
||||
return safeDecodePolyline(encoded);
|
||||
final pts = safeDecodePolyline(encoded);
|
||||
// DEBUG: afficher dans la console du navigateur
|
||||
// ignore: avoid_print
|
||||
print('[MAP DEBUG] encoded length=${encoded.length}, decoded ${pts.length} points');
|
||||
if (pts.isNotEmpty) {
|
||||
// ignore: avoid_print
|
||||
print('[MAP DEBUG] first=${pts.first.latitude},${pts.first.longitude} last=${pts.last.latitude},${pts.last.longitude}');
|
||||
}
|
||||
return pts;
|
||||
}
|
||||
|
||||
LatLngBounds? _computeBounds(List<List<LatLng>> allPoints) {
|
||||
|
||||
@@ -92,15 +92,9 @@ class _AddressAutocompleteFieldState extends State<AddressAutocompleteField> {
|
||||
separatorBuilder: (_, __) =>
|
||||
const Divider(height: 1, indent: 16),
|
||||
itemBuilder: (ctx, i) {
|
||||
return ListTile(
|
||||
dense: true,
|
||||
leading: const Icon(Icons.location_on_outlined, size: 18),
|
||||
title: Text(
|
||||
_suggestions[i],
|
||||
style: const TextStyle(fontSize: 13),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
onTap: () {
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onPanDown: (_) {
|
||||
widget.controller.text = _suggestions[i];
|
||||
widget.controller.selection = TextSelection.fromPosition(
|
||||
TextPosition(offset: _suggestions[i].length),
|
||||
@@ -109,6 +103,15 @@ class _AddressAutocompleteFieldState extends State<AddressAutocompleteField> {
|
||||
_removeOverlay();
|
||||
_focusNode.unfocus();
|
||||
},
|
||||
child: ListTile(
|
||||
dense: true,
|
||||
leading: const Icon(Icons.location_on_outlined, size: 18),
|
||||
title: Text(
|
||||
_suggestions[i],
|
||||
style: const TextStyle(fontSize: 13),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,45 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import '../lib/utils/polyline_utils.dart';
|
||||
|
||||
void main() async {
|
||||
final origin = "401 route du camping, 69850 Saint Martin en haut";
|
||||
final destination = "Salle des fêtes, Orliénas";
|
||||
|
||||
final requestBody = jsonEncode({
|
||||
"data": {
|
||||
"origin": origin,
|
||||
"destination": destination,
|
||||
"vehicleTollCategory": 2
|
||||
}
|
||||
});
|
||||
|
||||
print("Fetching route...");
|
||||
final request = await HttpClient().postUrl(Uri.parse('https://googlemapscomputeroute-iarazmuuzq-od.a.run.app'));
|
||||
request.headers.set('Content-Type', 'application/json');
|
||||
request.write(requestBody);
|
||||
|
||||
final response = await request.close();
|
||||
final responseBody = await response.transform(utf8.decoder).join();
|
||||
|
||||
print("Status: ${response.statusCode}");
|
||||
|
||||
try {
|
||||
final json = jsonDecode(responseBody);
|
||||
final routes = json['routes'] as List;
|
||||
for (int i = 0; i < routes.length; i++) {
|
||||
final polyStr = routes[i]['encodedPolyline'];
|
||||
print("Route $i polyline length: ${polyStr.length}");
|
||||
final pts = safeDecodePolyline(polyStr);
|
||||
print("Route $i points decoded: ${pts.length}");
|
||||
if (pts.isNotEmpty) {
|
||||
print(" Start: ${pts.first.latitude}, ${pts.first.longitude}");
|
||||
print(" End: ${pts.last.latitude}, ${pts.last.longitude}");
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
print("Error parsing: $e");
|
||||
print(responseBody);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
void main() async {
|
||||
final envFile = File('functions/.env');
|
||||
final lines = await envFile.readAsLines();
|
||||
String apiKey = '';
|
||||
for (var line in lines) {
|
||||
if (line.startsWith('API_MAPS=')) {
|
||||
apiKey = line.split('=')[1].replaceAll('"', '');
|
||||
}
|
||||
}
|
||||
|
||||
final url = 'https://routes.googleapis.com/directions/v2:computeRoutes';
|
||||
final client = HttpClient();
|
||||
|
||||
final request = await client.postUrl(Uri.parse(url));
|
||||
request.headers.set('Content-Type', 'application/json');
|
||||
request.headers.set('X-Goog-Api-Key', apiKey);
|
||||
request.headers.set('X-Goog-FieldMask', 'routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline');
|
||||
|
||||
final payload = jsonEncode({
|
||||
"travelMode": "DRIVE",
|
||||
"routingPreference": "TRAFFIC_AWARE",
|
||||
"origin": { "address": "Mon depot" },
|
||||
"destination": { "address": "25 Imp. du Puits du Suc, Saint-Martin-en-Haut, France" }
|
||||
});
|
||||
|
||||
request.write(payload);
|
||||
final response = await request.close();
|
||||
final responseBody = await response.transform(utf8.decoder).join();
|
||||
|
||||
print(responseBody.length > 200 ? responseBody.substring(0, 200) : responseBody);
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
// Test la route Saint-Martin -> Paris (autoroute avec péage)
|
||||
// Pour vérifier que la polyline longue se décode correctement en Dart
|
||||
void main() async {
|
||||
final envFile = File('functions/.env');
|
||||
final lines = await envFile.readAsLines();
|
||||
String apiKey = '';
|
||||
for (var line in lines) {
|
||||
if (line.startsWith('API_MAPS=')) {
|
||||
apiKey = line.split('=')[1].replaceAll('"', '').trim();
|
||||
}
|
||||
}
|
||||
|
||||
final url = 'https://routes.googleapis.com/directions/v2:computeRoutes';
|
||||
final client = HttpClient();
|
||||
|
||||
final request = await client.postUrl(Uri.parse(url));
|
||||
request.headers.set('Content-Type', 'application/json');
|
||||
request.headers.set('X-Goog-Api-Key', apiKey);
|
||||
request.headers.set('X-Goog-FieldMask', 'routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline');
|
||||
|
||||
final payload = jsonEncode({
|
||||
"travelMode": "DRIVE",
|
||||
"routingPreference": "TRAFFIC_AWARE",
|
||||
"routeModifiers": { "avoidTolls": false },
|
||||
"origin": { "address": "401 route du camping, 69850 Saint Martin en haut" },
|
||||
"destination": { "address": "Paris, France" }
|
||||
});
|
||||
|
||||
request.write(payload);
|
||||
final response = await request.close();
|
||||
final responseBody = await response.transform(utf8.decoder).join();
|
||||
|
||||
final json = jsonDecode(responseBody);
|
||||
final routes = json['routes'] as List;
|
||||
final polyStr = routes[0]['polyline']['encodedPolyline'] as String;
|
||||
final dist = routes[0]['distanceMeters'];
|
||||
|
||||
print('Distance: ${(dist/1000).round()} km');
|
||||
print('Polyline longueur: ${polyStr.length} chars');
|
||||
print('Polyline (50 premiers): ${polyStr.substring(0, 50)}');
|
||||
|
||||
// Décoder
|
||||
final pts = _decodePolyline(polyStr);
|
||||
print('Points décodés: ${pts.length}');
|
||||
|
||||
// Chercher les points invalides
|
||||
var invalides = 0;
|
||||
for (final pt in pts) {
|
||||
if (pt[0].abs() > 90 || pt[1].abs() > 180) {
|
||||
invalides++;
|
||||
if (invalides <= 3) print(' *** INVALIDE: ${pt[0]}, ${pt[1]}');
|
||||
}
|
||||
}
|
||||
|
||||
if (invalides == 0) {
|
||||
print('✅ Tous les ${pts.length} points sont valides WGS84');
|
||||
print('Premier: ${pts[0][0].toStringAsFixed(5)}, ${pts[0][1].toStringAsFixed(5)}');
|
||||
print('Dernier: ${pts.last[0].toStringAsFixed(5)}, ${pts.last[1].toStringAsFixed(5)}');
|
||||
} else {
|
||||
print('❌ $invalides points invalides détectés');
|
||||
}
|
||||
|
||||
client.close();
|
||||
}
|
||||
|
||||
List<List<double>> _decodePolyline(String encoded) {
|
||||
List<List<double>> poly = [];
|
||||
int index = 0, len = encoded.length;
|
||||
int lat = 0, lng = 0;
|
||||
|
||||
while (index < len) {
|
||||
int b, shift = 0, result = 0;
|
||||
do {
|
||||
if (index >= len) break;
|
||||
b = encoded.codeUnitAt(index++) - 63;
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
|
||||
lat += dlat;
|
||||
|
||||
shift = 0;
|
||||
result = 0;
|
||||
do {
|
||||
if (index >= len) break;
|
||||
b = encoded.codeUnitAt(index++) - 63;
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
|
||||
lng += dlng;
|
||||
|
||||
double finalLat = lat / 1e5;
|
||||
double finalLng = lng / 1e5;
|
||||
poly.add([finalLat, finalLng]);
|
||||
}
|
||||
return poly;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
List<List<double>> decodePolyline(String encoded) {
|
||||
List<List<double>> poly = [];
|
||||
int index = 0, len = encoded.length;
|
||||
int lat = 0, lng = 0;
|
||||
|
||||
while (index < len) {
|
||||
int b, shift = 0, result = 0;
|
||||
do {
|
||||
if (index >= len) break;
|
||||
b = encoded.codeUnitAt(index++) - 63;
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
|
||||
lat += dlat;
|
||||
|
||||
shift = 0;
|
||||
result = 0;
|
||||
do {
|
||||
if (index >= len) break;
|
||||
b = encoded.codeUnitAt(index++) - 63;
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
|
||||
lng += dlng;
|
||||
|
||||
poly.add([lat / 1e5, lng / 1e5]);
|
||||
}
|
||||
return poly;
|
||||
}
|
||||
|
||||
void main() async {
|
||||
final origin = "401 route du camping, 69850 Saint Martin en haut";
|
||||
final destination = "Salle des fêtes, Orliénas";
|
||||
|
||||
final requestBody = jsonEncode({
|
||||
"data": {
|
||||
"origin": origin,
|
||||
"destination": destination,
|
||||
"vehicleTollCategory": 2
|
||||
}
|
||||
});
|
||||
|
||||
// Since we don't have the auth token, let's bypass auth if possible, or just call Google Maps directly!
|
||||
// Wait, I can't call Google Maps directly without API_MAPS key.
|
||||
// I will read .env file.
|
||||
final envFile = File('functions/.env');
|
||||
final lines = await envFile.readAsLines();
|
||||
String apiKey = '';
|
||||
for (var line in lines) {
|
||||
if (line.startsWith('API_MAPS=')) {
|
||||
apiKey = line.split('=')[1].replaceAll('"', '');
|
||||
}
|
||||
}
|
||||
|
||||
if (apiKey.isEmpty) {
|
||||
print("API_MAPS not found");
|
||||
return;
|
||||
}
|
||||
|
||||
final url = 'https://routes.googleapis.com/directions/v2:computeRoutes';
|
||||
final client = HttpClient();
|
||||
final request = await client.postUrl(Uri.parse(url));
|
||||
request.headers.set('Content-Type', 'application/json');
|
||||
request.headers.set('X-Goog-Api-Key', apiKey);
|
||||
request.headers.set('X-Goog-FieldMask', 'routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline');
|
||||
|
||||
final payload = jsonEncode({
|
||||
"travelMode": "DRIVE",
|
||||
"routingPreference": "TRAFFIC_AWARE",
|
||||
"origin": { "address": origin },
|
||||
"destination": { "address": destination }
|
||||
});
|
||||
|
||||
request.write(payload);
|
||||
final response = await request.close();
|
||||
final responseBody = await response.transform(utf8.decoder).join();
|
||||
|
||||
try {
|
||||
final json = jsonDecode(responseBody);
|
||||
final routes = json['routes'] as List;
|
||||
final polyStr = routes[0]['polyline']['encodedPolyline'];
|
||||
print("POLYLINE_START");
|
||||
print(polyStr);
|
||||
print("POLYLINE_END");
|
||||
} catch (e) {
|
||||
print("Error: $e\n$responseBody");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
const encoded = "qospGlrrB";
|
||||
|
||||
function safeDecodePolyline(encoded) {
|
||||
let index = 0, len = encoded.length;
|
||||
let lat = 0, lng = 0;
|
||||
const poly = [];
|
||||
|
||||
while (index < len) {
|
||||
let b, shift = 0, result = 0;
|
||||
do {
|
||||
if (index >= len) break;
|
||||
b = encoded.charCodeAt(index++) - 63;
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
let dlat = ((result & 1) !== 0 ? ~(result >> 1) : (result >> 1));
|
||||
lat += dlat;
|
||||
|
||||
shift = 0;
|
||||
result = 0;
|
||||
do {
|
||||
if (index >= len) break;
|
||||
b = encoded.charCodeAt(index++) - 63;
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
let dlng = ((result & 1) !== 0 ? ~(result >> 1) : (result >> 1));
|
||||
lng += dlng;
|
||||
|
||||
poly.push([lat / 1e5, lng / 1e5]);
|
||||
}
|
||||
return poly;
|
||||
}
|
||||
|
||||
const pts = safeDecodePolyline(encoded);
|
||||
console.log("Decoded", pts.length, "points.");
|
||||
for(let i=0; i<5 && i<pts.length; i++) {
|
||||
console.log(pts[i]);
|
||||
}
|
||||
if(pts.length > 5) {
|
||||
console.log("...");
|
||||
for(let i=pts.length-5; i<pts.length; i++) {
|
||||
console.log(pts[i]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
const fs = require('fs');
|
||||
const https = require('https');
|
||||
|
||||
async function main() {
|
||||
const env = fs.readFileSync('functions/.env', 'utf8');
|
||||
const apiKey = env.split('\n').find(l => l.startsWith('API_MAPS=')).split('=')[1].replace(/"/g, '').trim();
|
||||
|
||||
const data = JSON.stringify({
|
||||
"travelMode": "DRIVE",
|
||||
"routingPreference": "TRAFFIC_AWARE",
|
||||
"origin": { "address": "401 route du camping, 69850 Saint Martin en haut" },
|
||||
"destination": { "address": "Salle des fêtes, Orliénas" }
|
||||
});
|
||||
|
||||
const options = {
|
||||
hostname: 'routes.googleapis.com',
|
||||
path: '/directions/v2:computeRoutes',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Goog-Api-Key': apiKey,
|
||||
'X-Goog-FieldMask': 'routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline',
|
||||
'Content-Length': data.length
|
||||
}
|
||||
};
|
||||
|
||||
const req = https.request(options, res => {
|
||||
let body = '';
|
||||
res.on('data', d => body += d);
|
||||
res.on('end', () => {
|
||||
const json = JSON.parse(body);
|
||||
const encoded = json.routes[0].polyline.encodedPolyline;
|
||||
console.log("Encoded string length:", encoded.length);
|
||||
|
||||
// decode
|
||||
let index = 0, len = encoded.length;
|
||||
let lat = 0, lng = 0;
|
||||
const poly = [];
|
||||
while (index < len) {
|
||||
let b, shift = 0, result = 0;
|
||||
do {
|
||||
b = encoded.charCodeAt(index++) - 63;
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
let dlat = ((result & 1) !== 0 ? ~(result >> 1) : (result >> 1));
|
||||
lat += dlat;
|
||||
|
||||
shift = 0;
|
||||
result = 0;
|
||||
do {
|
||||
b = encoded.charCodeAt(index++) - 63;
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
let dlng = ((result & 1) !== 0 ? ~(result >> 1) : (result >> 1));
|
||||
lng += dlng;
|
||||
|
||||
poly.push([lat / 1e5, lng / 1e5]);
|
||||
}
|
||||
|
||||
console.log("Decoded points:", poly.length);
|
||||
for(let i=0; i<5; i++) console.log(poly[i]);
|
||||
|
||||
// Search for exploding coordinates
|
||||
for(let i=0; i<poly.length; i++) {
|
||||
if (Math.abs(poly[i][0]) > 90 || Math.abs(poly[i][1]) > 180) {
|
||||
console.log("EXPLODED AT INDEX", i, "POINT:", poly[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
req.write(data);
|
||||
req.end();
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -0,0 +1,36 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
void main() async {
|
||||
final origin = "401 route du camping, 69850 Saint Martin en haut";
|
||||
final destination = "652431, 6853241"; // Lambert 93 example
|
||||
|
||||
final envFile = File('functions/.env');
|
||||
final lines = await envFile.readAsLines();
|
||||
String apiKey = '';
|
||||
for (var line in lines) {
|
||||
if (line.startsWith('API_MAPS=')) {
|
||||
apiKey = line.split('=')[1].replaceAll('"', '');
|
||||
}
|
||||
}
|
||||
|
||||
final url = 'https://routes.googleapis.com/directions/v2:computeRoutes';
|
||||
final client = HttpClient();
|
||||
final request = await client.postUrl(Uri.parse(url));
|
||||
request.headers.set('Content-Type', 'application/json');
|
||||
request.headers.set('X-Goog-Api-Key', apiKey);
|
||||
request.headers.set('X-Goog-FieldMask', 'routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline');
|
||||
|
||||
final payload = jsonEncode({
|
||||
"travelMode": "DRIVE",
|
||||
"routingPreference": "TRAFFIC_AWARE",
|
||||
"origin": { "address": origin },
|
||||
"destination": { "address": destination }
|
||||
});
|
||||
|
||||
request.write(payload);
|
||||
final response = await request.close();
|
||||
final responseBody = await response.transform(utf8.decoder).join();
|
||||
print(response.statusCode);
|
||||
print(responseBody);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
void main() async {
|
||||
final envFile = File('functions/.env');
|
||||
final lines = await envFile.readAsLines();
|
||||
String apiKey = '';
|
||||
for (var line in lines) {
|
||||
if (line.startsWith('API_MAPS=')) {
|
||||
apiKey = line.split('=')[1].replaceAll('"', '');
|
||||
}
|
||||
}
|
||||
|
||||
final url = 'https://routes.googleapis.com/directions/v2:computeRoutes';
|
||||
final client = HttpClient();
|
||||
|
||||
// Test with origin = Lambert 93 coordinates
|
||||
final request = await client.postUrl(Uri.parse(url));
|
||||
request.headers.set('Content-Type', 'application/json');
|
||||
request.headers.set('X-Goog-Api-Key', apiKey);
|
||||
request.headers.set('X-Goog-FieldMask', 'routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline');
|
||||
|
||||
final payload = jsonEncode({
|
||||
"travelMode": "DRIVE",
|
||||
"routingPreference": "TRAFFIC_AWARE",
|
||||
"origin": { "address": "652431, 6853241" },
|
||||
"destination": { "address": "Salle des fêtes, Orliénas" }
|
||||
});
|
||||
|
||||
request.write(payload);
|
||||
final response = await request.close();
|
||||
final responseBody = await response.transform(utf8.decoder).join();
|
||||
print(response.statusCode);
|
||||
print(responseBody);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
void main() async {
|
||||
final envFile = File('functions/.env');
|
||||
final lines = await envFile.readAsLines();
|
||||
String apiKey = '';
|
||||
for (var line in lines) {
|
||||
if (line.startsWith('API_MAPS=')) {
|
||||
apiKey = line.split('=')[1].replaceAll('"', '');
|
||||
}
|
||||
}
|
||||
|
||||
final url = 'https://routes.googleapis.com/directions/v2:computeRoutes';
|
||||
final client = HttpClient();
|
||||
|
||||
final request = await client.postUrl(Uri.parse(url));
|
||||
request.headers.set('Content-Type', 'application/json');
|
||||
request.headers.set('X-Goog-Api-Key', apiKey);
|
||||
request.headers.set('X-Goog-FieldMask', 'routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline');
|
||||
|
||||
final payload = jsonEncode({
|
||||
"travelMode": "DRIVE",
|
||||
"routingPreference": "TRAFFIC_AWARE",
|
||||
"origin": { "address": "401 route du camping, 69850 Saint Martin en haut" },
|
||||
"destination": { "address": "652431, 6853241" }
|
||||
});
|
||||
|
||||
request.write(payload);
|
||||
final response = await request.close();
|
||||
final responseBody = await response.transform(utf8.decoder).join();
|
||||
|
||||
print(responseBody);
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
/**
|
||||
* Test final :
|
||||
* 1. 03003 → 03087 (tarif ?)
|
||||
* 2. Google travelAdvisory.tollInfo pour Saint-Martin → Grenoble
|
||||
* 3. Identifier pourquoi VOREPPE n'est pas détecté par Ulys
|
||||
*/
|
||||
const axios = require('axios');
|
||||
const polylineLib = require('@mapbox/polyline');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
let API_MAPS = '';
|
||||
const envContent = fs.readFileSync(path.join(__dirname, '.env'), 'utf-8');
|
||||
for (const line of envContent.split('\n')) {
|
||||
const m = line.match(/^API_MAPS=(.+)/);
|
||||
if (m) API_MAPS = m[1].trim().replace(/"/g, '');
|
||||
}
|
||||
|
||||
async function testRate(vehicleCategory, tollPassages, label) {
|
||||
try {
|
||||
const res = await axios.post(
|
||||
'https://api-ulys.azure-api.net/tollstation/v1/rate',
|
||||
{ vehicleCategory: String(vehicleCategory), paymentOption: 2, tollPassages },
|
||||
{ headers: { 'Content-Type': 'application/json' }, timeout: 8000 }
|
||||
);
|
||||
const data = res.data;
|
||||
const total = Array.isArray(data) ? data.reduce((s, d) => s + (d.price || 0), 0) : 0;
|
||||
const comment = Array.isArray(data) && data[0] ? (data[0].comments || []).join(', ') : '';
|
||||
console.log(` [cl${vehicleCategory}] ${label}: ${total}€ ${comment ? '('+comment+')' : ''}`);
|
||||
return total;
|
||||
} catch (e) {
|
||||
console.log(` ERROR: ${e.message}`);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
const now = new Date().toISOString();
|
||||
|
||||
async function main() {
|
||||
console.log('=== TEST 1: Combinations de gares A43+A48 pour Saint-Martin → Grenoble ===\n');
|
||||
|
||||
// 03003 → 03087 (Isle d'Abeau → Voreppe) - système fermé?
|
||||
await testRate(1, [
|
||||
{ toll: { operatorId: '03', tollId: '003' }, passageDate: now },
|
||||
{ toll: { operatorId: '03', tollId: '087' }, passageDate: now }
|
||||
], '03003→03087 (Isle d\'Abeau→Voreppe)');
|
||||
await testRate(2, [
|
||||
{ toll: { operatorId: '03', tollId: '003' }, passageDate: now },
|
||||
{ toll: { operatorId: '03', tollId: '087' }, passageDate: now }
|
||||
], '03003→03087');
|
||||
|
||||
// Essayer toutes les paires gares sur A48
|
||||
const a48gates = [
|
||||
{ op: '03', toll: '083', name: 'MOIRANS NORD' },
|
||||
{ op: '03', toll: '084', name: 'MOIRANS' },
|
||||
{ op: '03', toll: '085', name: 'RIVES' },
|
||||
{ op: '03', toll: '086', name: 'VOIRON' },
|
||||
{ op: '03', toll: '087', name: 'VOREPPE' },
|
||||
{ op: '03', toll: '091', name: 'CHATUZANGE' },
|
||||
{ op: '03', toll: '092', name: 'BAUME HOSTUN' },
|
||||
{ op: '03', toll: '093', name: 'ST MARCELLIN' },
|
||||
{ op: '03', toll: '094', name: 'VINAY' },
|
||||
{ op: '03', toll: '095', name: 'TULLINS' },
|
||||
];
|
||||
|
||||
console.log('\n03003 (Isle d\'Abeau) → toutes les gares A48:');
|
||||
for (const g of a48gates) {
|
||||
await testRate(2, [
|
||||
{ toll: { operatorId: '03', tollId: '003' }, passageDate: now },
|
||||
{ toll: { operatorId: g.op, tollId: g.toll }, passageDate: now }
|
||||
], `03003→${g.toll} ${g.name}`);
|
||||
}
|
||||
|
||||
console.log('\n=== TEST 2: Google Routes API - travelAdvisory.tollInfo ===\n');
|
||||
|
||||
const res = await axios.post('https://routes.googleapis.com/directions/v2:computeRoutes', {
|
||||
travelMode: 'DRIVE',
|
||||
routingPreference: 'TRAFFIC_AWARE',
|
||||
routeModifiers: { avoidTolls: false },
|
||||
origin: { address: '25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France' },
|
||||
destination: { address: 'Grenoble, France' },
|
||||
}, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Goog-Api-Key': API_MAPS,
|
||||
'X-Goog-FieldMask': 'routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline,routes.travelAdvisory.tollInfo',
|
||||
},
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
const r = res.data.routes[0];
|
||||
console.log(`Distance: ${Math.round(r.distanceMeters/1000)}km`);
|
||||
console.log(`travelAdvisory:`, JSON.stringify(r.travelAdvisory, null, 2));
|
||||
|
||||
console.log('\n=== TEST 3: Diagnostiquer pourquoi VOREPPE n\'est pas dans Ulys ===\n');
|
||||
|
||||
// Récupérer la polyline complète et identifier les points proches de VOREPPE
|
||||
const poly = r.polyline.encodedPolyline;
|
||||
const coords = polylineLib.decode(poly, 5);
|
||||
|
||||
// VOREPPE BARRIERE: 45.28323°N, 5.622°E
|
||||
const VOREPPE = [45.28323, 5.622];
|
||||
|
||||
let minDist = Infinity;
|
||||
let closestIdx = -1;
|
||||
for (let i = 0; i < coords.length; i++) {
|
||||
const [lat, lng] = coords[i];
|
||||
const dist = Math.sqrt(Math.pow(lat - VOREPPE[0], 2) + Math.pow(lng - VOREPPE[1], 2));
|
||||
if (dist < minDist) {
|
||||
minDist = dist;
|
||||
closestIdx = i;
|
||||
}
|
||||
}
|
||||
|
||||
const minDistKm = minDist * 111; // approximation 1° ≈ 111km
|
||||
console.log(`Point le plus proche de VOREPPE (45.283, 5.622):`);
|
||||
console.log(` Index ${closestIdx}/${coords.length-1}: ${JSON.stringify(coords[closestIdx])}`);
|
||||
console.log(` Distance: ${minDistKm.toFixed(2)} km`);
|
||||
|
||||
if (minDistKm > 2) {
|
||||
console.log(` -> Le tracé NE PASSE PAS par VOREPPE (trop loin: ${minDistKm.toFixed(1)}km)`);
|
||||
console.log(' -> Google route par une autre voie que A48 vers Grenoble!');
|
||||
} else {
|
||||
console.log(` -> Le tracé passe PRÈS de VOREPPE (${minDistKm.toFixed(2)}km)`);
|
||||
}
|
||||
|
||||
// Vérifier aussi ST QUENTIN (03001): 45.641°N, 5.119°E (d'après le CSV)
|
||||
const STQUENTIN001 = [45.641, 5.119];
|
||||
let minDist2 = Infinity;
|
||||
for (const [lat, lng] of coords) {
|
||||
const d = Math.sqrt(Math.pow(lat - STQUENTIN001[0], 2) + Math.pow(lng - STQUENTIN001[1], 2));
|
||||
if (d < minDist2) minDist2 = d;
|
||||
}
|
||||
console.log(`\nDistance du tracé à ST QUENTIN 03001 (45.641, 5.119): ${(minDist2*111).toFixed(2)} km`);
|
||||
|
||||
// Regarder la zone géographique couverte par la route
|
||||
const lats = coords.map(c => c[0]);
|
||||
const lngs = coords.map(c => c[1]);
|
||||
console.log(`\nBounding box de la route:`);
|
||||
console.log(` Lat: ${Math.min(...lats).toFixed(4)} → ${Math.max(...lats).toFixed(4)}`);
|
||||
console.log(` Lng: ${Math.min(...lngs).toFixed(4)} → ${Math.max(...lngs).toFixed(4)}`);
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
@@ -0,0 +1,81 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
void main() async {
|
||||
final envFile = File('functions/.env');
|
||||
final lines = await envFile.readAsLines();
|
||||
String apiKey = '';
|
||||
for (var line in lines) {
|
||||
if (line.startsWith('API_MAPS=')) {
|
||||
apiKey = line.split('=')[1].replaceAll('"', '');
|
||||
}
|
||||
}
|
||||
|
||||
final url = 'https://routes.googleapis.com/directions/v2:computeRoutes';
|
||||
final client = HttpClient();
|
||||
|
||||
final request = await client.postUrl(Uri.parse(url));
|
||||
request.headers.set('Content-Type', 'application/json');
|
||||
request.headers.set('X-Goog-Api-Key', apiKey);
|
||||
request.headers.set('X-Goog-FieldMask', 'routes.distanceMeters,routes.duration,routes.polyline.encodedPolyline');
|
||||
|
||||
final payload = jsonEncode({
|
||||
"travelMode": "DRIVE",
|
||||
"routingPreference": "TRAFFIC_AWARE",
|
||||
"routeModifiers": { "avoidTolls": true },
|
||||
"origin": { "address": "401 route du camping, 69850 Saint Martin en haut" },
|
||||
"destination": { "address": "25 Imp. du Puits du Suc, Saint-Martin-en-Haut, France" }
|
||||
});
|
||||
|
||||
request.write(payload);
|
||||
final response = await request.close();
|
||||
final responseBody = await response.transform(utf8.decoder).join();
|
||||
|
||||
try {
|
||||
final json = jsonDecode(responseBody);
|
||||
final routes = json['routes'] as List;
|
||||
final polyStr = routes[0]['polyline']['encodedPolyline'] as String;
|
||||
|
||||
print("Polyline found. Length: ${polyStr.length}");
|
||||
print("String: $polyStr");
|
||||
|
||||
int index = 0, len = polyStr.length;
|
||||
int lat = 0, lng = 0;
|
||||
List poly = [];
|
||||
while (index < len) {
|
||||
int b, shift = 0, result = 0;
|
||||
do {
|
||||
b = polyStr.codeUnitAt(index++) - 63;
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
|
||||
lat += dlat;
|
||||
|
||||
shift = 0;
|
||||
result = 0;
|
||||
do {
|
||||
b = polyStr.codeUnitAt(index++) - 63;
|
||||
result |= (b & 0x1f) << shift;
|
||||
shift += 5;
|
||||
} while (b >= 0x20);
|
||||
int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
|
||||
lng += dlng;
|
||||
|
||||
double finalLat = lat / 1e5;
|
||||
double finalLng = lng / 1e5;
|
||||
|
||||
if (finalLat.abs() > 90.0 || finalLng.abs() > 180.0) {
|
||||
print("EXPLODED at index $index: $finalLat, $finalLng");
|
||||
break;
|
||||
}
|
||||
poly.add([finalLat, finalLng]);
|
||||
}
|
||||
print("Decode complete. Points:");
|
||||
for (var pt in poly) {
|
||||
print(pt);
|
||||
}
|
||||
} catch (e) {
|
||||
print("Error: $e");
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,215 @@
|
||||
file:///C:/Users/paulf/flutter/bin/cache/dart-sdk/lib/_internal/dart2js_platform.dill
|
||||
file:///C:/Users/paulf/flutter/bin/cache/dart-sdk/lib/libraries.json
|
||||
file:///C:/src/EM2RP/em2rp/.dart_tool/package_config.json
|
||||
file:///C:/src/EM2RP/em2rp/scratch/test_user_route.dart
|
||||
org-dartlang-sdk:///lib/_http/crypto.dart
|
||||
org-dartlang-sdk:///lib/_http/embedder_config.dart
|
||||
org-dartlang-sdk:///lib/_http/http.dart
|
||||
org-dartlang-sdk:///lib/_http/http_date.dart
|
||||
org-dartlang-sdk:///lib/_http/http_headers.dart
|
||||
org-dartlang-sdk:///lib/_http/http_impl.dart
|
||||
org-dartlang-sdk:///lib/_http/http_parser.dart
|
||||
org-dartlang-sdk:///lib/_http/http_session.dart
|
||||
org-dartlang-sdk:///lib/_http/http_testing.dart
|
||||
org-dartlang-sdk:///lib/_http/overrides.dart
|
||||
org-dartlang-sdk:///lib/_http/websocket.dart
|
||||
org-dartlang-sdk:///lib/_http/websocket_impl.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/annotations.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/async_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/bigint_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/collection_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/constant_map.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/convert_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/core_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/dart2js_only.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/dart2js_runtime_metrics.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/developer_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/foreign_helper.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/instantiation.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/interceptors.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/internal_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/io_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/isolate_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_allow_interop_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_array.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_helper.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_names.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_number.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_primitives.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_string.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/late_helper.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/linked_hash_map.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/math_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/native_helper.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/native_typed_data.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/records.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/regexp_helper.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/string_helper.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/synced/array_flags.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/synced/embedded_names.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/synced/invocation_mirror_constants.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_runtime/lib/typed_data_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_shared/lib/convert_utf_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_shared/lib/date_time_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_shared/lib/js_interop_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_shared/lib/js_interop_unsafe_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_shared/lib/js_types.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_shared/lib/js_util_patch.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_shared/lib/rti.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_shared/lib/synced/async_status_codes.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_shared/lib/synced/embedded_names.dart
|
||||
org-dartlang-sdk:///lib/_internal/js_shared/lib/synced/recipe_syntax.dart
|
||||
org-dartlang-sdk:///lib/async/async.dart
|
||||
org-dartlang-sdk:///lib/async/async_error.dart
|
||||
org-dartlang-sdk:///lib/async/broadcast_stream_controller.dart
|
||||
org-dartlang-sdk:///lib/async/deferred_load.dart
|
||||
org-dartlang-sdk:///lib/async/future.dart
|
||||
org-dartlang-sdk:///lib/async/future_extensions.dart
|
||||
org-dartlang-sdk:///lib/async/future_impl.dart
|
||||
org-dartlang-sdk:///lib/async/schedule_microtask.dart
|
||||
org-dartlang-sdk:///lib/async/stream.dart
|
||||
org-dartlang-sdk:///lib/async/stream_controller.dart
|
||||
org-dartlang-sdk:///lib/async/stream_impl.dart
|
||||
org-dartlang-sdk:///lib/async/stream_pipe.dart
|
||||
org-dartlang-sdk:///lib/async/stream_transformers.dart
|
||||
org-dartlang-sdk:///lib/async/timer.dart
|
||||
org-dartlang-sdk:///lib/async/zone.dart
|
||||
org-dartlang-sdk:///lib/collection/collection.dart
|
||||
org-dartlang-sdk:///lib/collection/collections.dart
|
||||
org-dartlang-sdk:///lib/collection/hash_map.dart
|
||||
org-dartlang-sdk:///lib/collection/hash_set.dart
|
||||
org-dartlang-sdk:///lib/collection/iterable.dart
|
||||
org-dartlang-sdk:///lib/collection/iterator.dart
|
||||
org-dartlang-sdk:///lib/collection/linked_hash_map.dart
|
||||
org-dartlang-sdk:///lib/collection/linked_hash_set.dart
|
||||
org-dartlang-sdk:///lib/collection/linked_list.dart
|
||||
org-dartlang-sdk:///lib/collection/list.dart
|
||||
org-dartlang-sdk:///lib/collection/maps.dart
|
||||
org-dartlang-sdk:///lib/collection/queue.dart
|
||||
org-dartlang-sdk:///lib/collection/set.dart
|
||||
org-dartlang-sdk:///lib/collection/splay_tree.dart
|
||||
org-dartlang-sdk:///lib/convert/ascii.dart
|
||||
org-dartlang-sdk:///lib/convert/base64.dart
|
||||
org-dartlang-sdk:///lib/convert/byte_conversion.dart
|
||||
org-dartlang-sdk:///lib/convert/chunked_conversion.dart
|
||||
org-dartlang-sdk:///lib/convert/codec.dart
|
||||
org-dartlang-sdk:///lib/convert/convert.dart
|
||||
org-dartlang-sdk:///lib/convert/converter.dart
|
||||
org-dartlang-sdk:///lib/convert/encoding.dart
|
||||
org-dartlang-sdk:///lib/convert/html_escape.dart
|
||||
org-dartlang-sdk:///lib/convert/json.dart
|
||||
org-dartlang-sdk:///lib/convert/latin1.dart
|
||||
org-dartlang-sdk:///lib/convert/line_splitter.dart
|
||||
org-dartlang-sdk:///lib/convert/string_conversion.dart
|
||||
org-dartlang-sdk:///lib/convert/utf.dart
|
||||
org-dartlang-sdk:///lib/core/annotations.dart
|
||||
org-dartlang-sdk:///lib/core/bigint.dart
|
||||
org-dartlang-sdk:///lib/core/bool.dart
|
||||
org-dartlang-sdk:///lib/core/comparable.dart
|
||||
org-dartlang-sdk:///lib/core/core.dart
|
||||
org-dartlang-sdk:///lib/core/date_time.dart
|
||||
org-dartlang-sdk:///lib/core/double.dart
|
||||
org-dartlang-sdk:///lib/core/duration.dart
|
||||
org-dartlang-sdk:///lib/core/enum.dart
|
||||
org-dartlang-sdk:///lib/core/errors.dart
|
||||
org-dartlang-sdk:///lib/core/exceptions.dart
|
||||
org-dartlang-sdk:///lib/core/function.dart
|
||||
org-dartlang-sdk:///lib/core/identical.dart
|
||||
org-dartlang-sdk:///lib/core/int.dart
|
||||
org-dartlang-sdk:///lib/core/invocation.dart
|
||||
org-dartlang-sdk:///lib/core/iterable.dart
|
||||
org-dartlang-sdk:///lib/core/iterator.dart
|
||||
org-dartlang-sdk:///lib/core/list.dart
|
||||
org-dartlang-sdk:///lib/core/map.dart
|
||||
org-dartlang-sdk:///lib/core/null.dart
|
||||
org-dartlang-sdk:///lib/core/num.dart
|
||||
org-dartlang-sdk:///lib/core/object.dart
|
||||
org-dartlang-sdk:///lib/core/pattern.dart
|
||||
org-dartlang-sdk:///lib/core/print.dart
|
||||
org-dartlang-sdk:///lib/core/record.dart
|
||||
org-dartlang-sdk:///lib/core/regexp.dart
|
||||
org-dartlang-sdk:///lib/core/set.dart
|
||||
org-dartlang-sdk:///lib/core/sink.dart
|
||||
org-dartlang-sdk:///lib/core/stacktrace.dart
|
||||
org-dartlang-sdk:///lib/core/stopwatch.dart
|
||||
org-dartlang-sdk:///lib/core/string.dart
|
||||
org-dartlang-sdk:///lib/core/string_buffer.dart
|
||||
org-dartlang-sdk:///lib/core/string_sink.dart
|
||||
org-dartlang-sdk:///lib/core/symbol.dart
|
||||
org-dartlang-sdk:///lib/core/type.dart
|
||||
org-dartlang-sdk:///lib/core/uri.dart
|
||||
org-dartlang-sdk:///lib/core/weak.dart
|
||||
org-dartlang-sdk:///lib/developer/developer.dart
|
||||
org-dartlang-sdk:///lib/developer/extension.dart
|
||||
org-dartlang-sdk:///lib/developer/http_profiling.dart
|
||||
org-dartlang-sdk:///lib/developer/profiler.dart
|
||||
org-dartlang-sdk:///lib/developer/service.dart
|
||||
org-dartlang-sdk:///lib/developer/timeline.dart
|
||||
org-dartlang-sdk:///lib/html/dart2js/html_dart2js.dart
|
||||
org-dartlang-sdk:///lib/html/html_common/conversions.dart
|
||||
org-dartlang-sdk:///lib/html/html_common/conversions_dart2js.dart
|
||||
org-dartlang-sdk:///lib/html/html_common/css_class_set.dart
|
||||
org-dartlang-sdk:///lib/html/html_common/device.dart
|
||||
org-dartlang-sdk:///lib/html/html_common/filtered_element_list.dart
|
||||
org-dartlang-sdk:///lib/html/html_common/html_common_dart2js.dart
|
||||
org-dartlang-sdk:///lib/html/html_common/lists.dart
|
||||
org-dartlang-sdk:///lib/html/html_common/metadata.dart
|
||||
org-dartlang-sdk:///lib/indexed_db/dart2js/indexed_db_dart2js.dart
|
||||
org-dartlang-sdk:///lib/internal/async_cast.dart
|
||||
org-dartlang-sdk:///lib/internal/bytes_builder.dart
|
||||
org-dartlang-sdk:///lib/internal/cast.dart
|
||||
org-dartlang-sdk:///lib/internal/errors.dart
|
||||
org-dartlang-sdk:///lib/internal/internal.dart
|
||||
org-dartlang-sdk:///lib/internal/iterable.dart
|
||||
org-dartlang-sdk:///lib/internal/linked_list.dart
|
||||
org-dartlang-sdk:///lib/internal/list.dart
|
||||
org-dartlang-sdk:///lib/internal/patch.dart
|
||||
org-dartlang-sdk:///lib/internal/print.dart
|
||||
org-dartlang-sdk:///lib/internal/sort.dart
|
||||
org-dartlang-sdk:///lib/internal/symbol.dart
|
||||
org-dartlang-sdk:///lib/io/common.dart
|
||||
org-dartlang-sdk:///lib/io/data_transformer.dart
|
||||
org-dartlang-sdk:///lib/io/directory.dart
|
||||
org-dartlang-sdk:///lib/io/directory_impl.dart
|
||||
org-dartlang-sdk:///lib/io/embedder_config.dart
|
||||
org-dartlang-sdk:///lib/io/eventhandler.dart
|
||||
org-dartlang-sdk:///lib/io/file.dart
|
||||
org-dartlang-sdk:///lib/io/file_impl.dart
|
||||
org-dartlang-sdk:///lib/io/file_system_entity.dart
|
||||
org-dartlang-sdk:///lib/io/io.dart
|
||||
org-dartlang-sdk:///lib/io/io_resource_info.dart
|
||||
org-dartlang-sdk:///lib/io/io_service.dart
|
||||
org-dartlang-sdk:///lib/io/io_sink.dart
|
||||
org-dartlang-sdk:///lib/io/link.dart
|
||||
org-dartlang-sdk:///lib/io/namespace_impl.dart
|
||||
org-dartlang-sdk:///lib/io/network_profiling.dart
|
||||
org-dartlang-sdk:///lib/io/overrides.dart
|
||||
org-dartlang-sdk:///lib/io/platform.dart
|
||||
org-dartlang-sdk:///lib/io/platform_impl.dart
|
||||
org-dartlang-sdk:///lib/io/process.dart
|
||||
org-dartlang-sdk:///lib/io/secure_server_socket.dart
|
||||
org-dartlang-sdk:///lib/io/secure_socket.dart
|
||||
org-dartlang-sdk:///lib/io/security_context.dart
|
||||
org-dartlang-sdk:///lib/io/service_object.dart
|
||||
org-dartlang-sdk:///lib/io/socket.dart
|
||||
org-dartlang-sdk:///lib/io/stdio.dart
|
||||
org-dartlang-sdk:///lib/io/string_transformer.dart
|
||||
org-dartlang-sdk:///lib/io/sync_socket.dart
|
||||
org-dartlang-sdk:///lib/isolate/capability.dart
|
||||
org-dartlang-sdk:///lib/isolate/isolate.dart
|
||||
org-dartlang-sdk:///lib/js/_js.dart
|
||||
org-dartlang-sdk:///lib/js/_js_annotations.dart
|
||||
org-dartlang-sdk:///lib/js/_js_client.dart
|
||||
org-dartlang-sdk:///lib/js/js.dart
|
||||
org-dartlang-sdk:///lib/js_interop/js_interop.dart
|
||||
org-dartlang-sdk:///lib/js_interop_unsafe/js_interop_unsafe.dart
|
||||
org-dartlang-sdk:///lib/js_util/js_util.dart
|
||||
org-dartlang-sdk:///lib/math/math.dart
|
||||
org-dartlang-sdk:///lib/math/point.dart
|
||||
org-dartlang-sdk:///lib/math/random.dart
|
||||
org-dartlang-sdk:///lib/math/rectangle.dart
|
||||
org-dartlang-sdk:///lib/svg/dart2js/svg_dart2js.dart
|
||||
org-dartlang-sdk:///lib/typed_data/typed_data.dart
|
||||
org-dartlang-sdk:///lib/web_audio/dart2js/web_audio_dart2js.dart
|
||||
org-dartlang-sdk:///lib/web_gl/dart2js/web_gl_dart2js.dart
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Reference in New Issue
Block a user