From 495bbbb09514118ba747c098f90bc79afe6aaa17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Hu=CC=88bner?= Date: Fri, 26 May 2017 14:38:00 +0200 Subject: [PATCH] Also collect polyline data from request. --- src/staticMapLite.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/staticMapLite.php b/src/staticMapLite.php index 66e1636..53256f5 100644 --- a/src/staticMapLite.php +++ b/src/staticMapLite.php @@ -58,7 +58,7 @@ class staticMapLite protected $mapCacheFile = ''; protected $mapCacheExtension = 'png'; - protected $zoom, $lat, $lon, $width, $height, $markers, $image, $maptype; + protected $zoom, $lat, $lon, $width, $height, $markers, $polylines, $image, $maptype; protected $centerX, $centerY, $offsetX, $offsetY; public function __construct() @@ -113,6 +113,14 @@ class staticMapLite $this->markers[] = array('lat' => $markerLat, 'lon' => $markerLon, 'type' => $markerType); } + } + if (!empty($_GET['polylines'])) { + $polylines = explode('|', $_GET['polylines']); + foreach ($polylines as $polyline) { + list($polylineString, $colorRed, $colorGreen, $colorBlue) = explode(',', $polyline); + $this->polylines[] = array('polyline' => $polylineString, 'colorRed' => $colorRed, 'colorGreen' => $colorGreen, 'colorBlue' => $colorBlue); + } + } if ($_GET['maptype']) { if (array_key_exists($_GET['maptype'], $this->tileSrcUrl)) $this->maptype = $_GET['maptype']; @@ -257,6 +265,8 @@ class staticMapLite }; } + pu + public function tileUrlToFilename($url) {