'; ?> 30 10 31 11 [70, 68], 20 => [70, 44], 30 => [70, 20], 11 => [405, 68], 12 => [370, 68], 13 => [335, 68], 14 => [300, 68], 15 => [265, 68], 16 => [230, 68], 17 => [195, 68], 18 => [160, 68], 19 => [125, 68], 21 => [405, 44], 22 => [370, 44], 23 => [335, 44], 24 => [300, 44], 25 => [265, 44], 26 => [220, 44], 27 => [185, 44], 28 => [150, 44], 29 => [115, 44], 31 => [405, 20], 32 => [370, 20], 33 => [335, 20], 34 => [300, 20], 35 => [265, 20], 36 => [230, 20], 37 => [195, 20], 38 => [160, 20], 39 => [125, 20], ]; foreach ($pin_coordinates as $coordinates) { echo ''; } if (empty($_GET['data'])) { print ""; die(); } $inputArray = json_decode($_GET['data'], true); // JSON in ein PHP-Array umwandeln // Neues Array mit übersetzten Koordinaten $translatedArray = array_map(function ($pair) use ($pin_coordinates) { return [ $pin_coordinates[$pair[0]], // Übersetze den ersten Wert $pin_coordinates[$pair[1]], // Übersetze den zweiten Wert ]; }, $inputArray); $colors = ["#1a5fb4", "#26a269", "#e5a50a", "#c64600", "#a51d2d", "#613583", "#63452c", "#3d3846"]; // Schleife durch das übersetzte Array $colorNumber = 0; foreach ($translatedArray as $line) { $point1 = $line[0]; // Erster Punkt [x, y] $point2 = $line[1]; // Zweiter Punkt [x, y] $point1x = $point1[0] + 10; $point1y = $point1[1] + 5; $point2x = $point2[0] + 10; $point2y = $point2[1] + 5; // Ausgabe eines Pfades (Linie zwischen zwei Punkten) echo ''; $colorNumber++; if ($colorNumber > 7) { $colorNumber = 0; } } ?>