That is expected. I don't think we allow custom color in some places currently.
Doesn't that make combined reports very hard to read? Trying with some vehicles that share even small paths makes you unable to figure out who went were after the split
Probably. It's just not implement currently. Feel free to send a PR or submit a feature request.
Ill try to code this up, at least have a pool of different colors then just give each device each color. Which file is responsible for generating the report preview so I can look at it?
Search for "Combined" in the filename.
Thanks for that.
I changed CombinedReportPage.jsx to pass a color variable into MapRoutePath.js, and then use this in the properties of LineString, but it seems to completely ignore it.
I changed :
<MapRoutePath
key={item.deviceId}
name={devices[item.deviceId].name}
positions={item.positions}
coordinates={item.route}
color='#00FFF' // Pass the color here
/>
);
and in MapRoutePath:
useEffect(() => {
if (!coordinates) {
coordinates = positions.map((item) => [item.longitude, item.latitude]);
}
map.getSource(id)?.setData({
type: 'Feature',
geometry: {
type: 'LineString',
coordinates,
},
properties: {
name,
color: '#00FFF'
},
});
}, [positions, coordinates, reportColor]);
return null;
};
but its completely ignored still :(
michalis95 you can take it from there by checking the code.
https://github.com/traccar/traccar-web/blob/master/src/map/MapRoutePath.js#L45
and if you look at that line, it assigns a value to the variable color in MapRoutePath.js
https://github.com/traccar/traccar-web/blob/29e3d2fd11a84842d14e472dff9c77fca9d9e5d5/src/map/MapRoutePath.js#L16
Cristian, i made a temp solution that works very well for myself. see https://github.com/traccar/traccar-web/issues/1238
Hello, I have set the Web: Report color attribute of different devices to a hex value. The lines from live route seem to have changed, but in the reports (combined) selecting 2 different devices just shows the route line as the default blue one. Is there something I am missing?