feat: Implement dynamic line coloring based on module IDs Enhanced the map visualization by implementing dynamic line coloring, assigning unique colors to polyline elements based on their corresponding module IDs. This update fetches color settings from the linesColorAPI and applies them to the line drawings on the map. The change aims to improve the visual distinction between different lines, facilitating easier identification and analysis for users.
30 lines
586 B
JavaScript
30 lines
586 B
JavaScript
// /pages/api/linesColorApi.js
|
|
// http://10.10.0.13/talas5/ClientData/WebServiceMap.asmx/GisStationsStatusDistrict
|
|
|
|
export default function handler(req, res) {
|
|
const linesColor = {
|
|
Statis: [
|
|
{
|
|
IdModul: 1,
|
|
Na: "system",
|
|
Le: 4,
|
|
Co: "#000FFF",
|
|
Me: "Eingang DE04 kommend",
|
|
Feld: 3,
|
|
Icon: 0,
|
|
},
|
|
{
|
|
IdModul: 3,
|
|
Na: "system",
|
|
Le: 4,
|
|
Co: "#FF0000",
|
|
Me: "Eingang DE05 kommend",
|
|
Feld: 3,
|
|
Icon: 0,
|
|
},
|
|
],
|
|
};
|
|
|
|
res.status(200).json({ linesColor });
|
|
}
|