feat: refs #7882 Added osrmservice #3281
|
@ -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':
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}));
|
||||
|
||||
|
|
Loading…
Reference in New Issue