- Created mock API route for fetching GIS lines data (/api/talas_v5_DB/gisLines/readGisLinesMock) - Created mock API route for fetching station names data (/api/talas_v5_DB/station/getAllStationsNamesMock) - Replaced original API calls in useLineData hook with mock routes for development and testing
304 lines
5.2 KiB
JavaScript
304 lines
5.2 KiB
JavaScript
// /pages/api/talas_v5_DB/gisLines/readGisLines.js
|
|
|
|
export default function handler(req, res) {
|
|
// JSON-Daten hier
|
|
const data = [
|
|
{
|
|
idLD: 50035,
|
|
idModul: 1,
|
|
points: [
|
|
{
|
|
x: 53.246185,
|
|
y: 8.162953,
|
|
},
|
|
{
|
|
x: 53.264596890603144,
|
|
y: 8.176574707031252,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50035,
|
|
idModul: 2,
|
|
points: [
|
|
{
|
|
x: 53.246185,
|
|
y: 8.162953,
|
|
},
|
|
{
|
|
x: 53.258949437816085,
|
|
y: 8.157176971435549,
|
|
},
|
|
{
|
|
x: 53.27568426437073,
|
|
y: 8.163356781005861,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50035,
|
|
idModul: 3,
|
|
points: [
|
|
{
|
|
x: 53.246185,
|
|
y: 8.162953,
|
|
},
|
|
{
|
|
x: 53.25735774823773,
|
|
y: 8.213653564453127,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50035,
|
|
idModul: 4,
|
|
points: [
|
|
{
|
|
x: 53.246185,
|
|
y: 8.162953,
|
|
},
|
|
{
|
|
x: 53.241488959365725,
|
|
y: 8.184814453125002,
|
|
},
|
|
{
|
|
x: 53.232550546124244,
|
|
y: 8.200263977050783,
|
|
},
|
|
{
|
|
x: 53.23049547461783,
|
|
y: 8.230476379394533,
|
|
},
|
|
{
|
|
x: 53.23666039320915,
|
|
y: 8.264122009277346,
|
|
},
|
|
{
|
|
x: 53.242413516276585,
|
|
y: 8.217430114746096,
|
|
},
|
|
{
|
|
x: 53.247138717452785,
|
|
y: 8.21880340576172,
|
|
},
|
|
{
|
|
x: 53.253917442602265,
|
|
y: 8.233737945556642,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50035,
|
|
idModul: 5,
|
|
points: [
|
|
{
|
|
x: 53.246185,
|
|
y: 8.162953,
|
|
},
|
|
{
|
|
x: 53.257922548093866,
|
|
y: 8.179321289062502,
|
|
},
|
|
{
|
|
x: 53.27075689767353,
|
|
y: 8.199234008789064,
|
|
},
|
|
{
|
|
x: 53.269730291457705,
|
|
y: 8.237171173095705,
|
|
},
|
|
{
|
|
x: 53.26665032490112,
|
|
y: 8.288583755493166,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50035,
|
|
idModul: 6,
|
|
points: [
|
|
{
|
|
x: 53.246185,
|
|
y: 8.162953,
|
|
},
|
|
{
|
|
x: 53.243594865485605,
|
|
y: 8.169021606445314,
|
|
},
|
|
{
|
|
x: 53.24015345301049,
|
|
y: 8.171596527099611,
|
|
},
|
|
{
|
|
x: 53.236352168364164,
|
|
y: 8.18035125732422,
|
|
},
|
|
{
|
|
x: 53.23049547461783,
|
|
y: 8.185672760009767,
|
|
},
|
|
{
|
|
x: 53.229159625240165,
|
|
y: 8.192882537841799,
|
|
},
|
|
{
|
|
x: 53.22576843579022,
|
|
y: 8.19957733154297,
|
|
},
|
|
{
|
|
x: 53.21898525115505,
|
|
y: 8.201808929443361,
|
|
},
|
|
{
|
|
x: 53.20891126768285,
|
|
y: 8.205413818359377,
|
|
},
|
|
{
|
|
x: 53.19739524287978,
|
|
y: 8.217945098876955,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50035,
|
|
idModul: 7,
|
|
points: [
|
|
{
|
|
x: 53.246185,
|
|
y: 8.162953,
|
|
},
|
|
{
|
|
x: 53.25063092211432,
|
|
y: 8.205242156982424,
|
|
},
|
|
{
|
|
x: 53.255149822694534,
|
|
y: 8.223438262939455,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50035,
|
|
idModul: 8,
|
|
points: [
|
|
{
|
|
x: 53.246185,
|
|
y: 8.162953,
|
|
},
|
|
{
|
|
x: 53.26048972617302,
|
|
y: 8.199234008789064,
|
|
},
|
|
{
|
|
x: 53.2577171671909,
|
|
y: 8.203182220458986,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50036,
|
|
idModul: 1,
|
|
points: [
|
|
{
|
|
x: 53.39605,
|
|
y: 8.10297,
|
|
},
|
|
{
|
|
x: 53.40605,
|
|
y: 8.11297,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50036,
|
|
idModul: 2,
|
|
points: [
|
|
{
|
|
x: 53.39605,
|
|
y: 8.10297,
|
|
},
|
|
{
|
|
x: 53.40605,
|
|
y: 8.12297,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50036,
|
|
idModul: 8,
|
|
points: [
|
|
{
|
|
x: 53.39605,
|
|
y: 8.10297,
|
|
},
|
|
{
|
|
x: 53.405233950076024,
|
|
y: 8.136577606201174,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50071,
|
|
idModul: 1,
|
|
points: [
|
|
{
|
|
x: 53.45257,
|
|
y: 7.91525,
|
|
},
|
|
{
|
|
x: 53.46257,
|
|
y: 7.92525,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50071,
|
|
idModul: 2,
|
|
points: [
|
|
{
|
|
x: 53.45257,
|
|
y: 7.91525,
|
|
},
|
|
{
|
|
x: 53.46257,
|
|
y: 7.93525,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50071,
|
|
idModul: 3,
|
|
points: [
|
|
{
|
|
x: 53.45257,
|
|
y: 7.91525,
|
|
},
|
|
{
|
|
x: 53.46257,
|
|
y: 7.94525,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
idLD: 50071,
|
|
idModul: 4,
|
|
points: [
|
|
{
|
|
x: 53.45257,
|
|
y: 7.91525,
|
|
},
|
|
{
|
|
x: 53.4516692168179,
|
|
y: 7.936935424804688,
|
|
},
|
|
{
|
|
x: 53.45718897904939,
|
|
y: 7.958908081054688,
|
|
},
|
|
],
|
|
},
|
|
];
|
|
// Sende die JSON-Daten als Antwort
|
|
res.status(200).json(data);
|
|
}
|