feat: refs #7882 Added osrmservice #3281

Merged
guillermo merged 16 commits from 7882-locationiq into dev 2024-12-16 06:58:54 +00:00
3 changed files with 5 additions and 8 deletions
Showing only changes of commit 05ba85219b - Show all commits

View File

@ -91,13 +91,7 @@ module.exports = Self => {
return posA - posB;
});
const coordsString = coords
.map(item => `point=${item.latitude},${item.longitude}`)
.join('&');
return {
coords,
view: `https://graphhopper.com/maps/?${coordsString}&profile=small_truck`
};
return coords;
} catch (err) {
switch (err.response?.data?.code) {
case 'NoTrips':

View File

@ -4035,3 +4035,6 @@ INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel)
INSERT INTO vn.workerIrpf (workerFk,spouseNif, geographicMobilityDate)
VALUES (1106,'26493101E','2019-09-20');
INSERT INTO vn.osrmConfig (id,url,tolerance)
VALUES (1,'https://router.project-osrm.org', 0.002);

View File

@ -82,7 +82,7 @@ module.exports = Self => {
// Revisamos las coincidencias y actualizamos la prioridad en el array
const addressPositions = await models.OsrmConfig.optimize(addressIds, firstAddress, lastAddress, myOptions);
await Promise.all(ticketAddress.map(async i => {
const foundPosition = addressPositions.coords.find(item => item.addressId === i.addressId);
const foundPosition = addressPositions.find(item => item.addressId === i.addressId);
if (foundPosition) i.priority = foundPosition.position + (maxPosition + 1);
}));