Also collect polyline data from request.

This commit is contained in:
Malte Hübner 2017-05-26 14:38:00 +02:00
parent 531a4b10f7
commit 495bbbb095
1 changed files with 11 additions and 1 deletions

View File

@ -58,7 +58,7 @@ class staticMapLite
protected $mapCacheFile = ''; protected $mapCacheFile = '';
protected $mapCacheExtension = 'png'; 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; protected $centerX, $centerY, $offsetX, $offsetY;
public function __construct() public function __construct()
@ -113,6 +113,14 @@ class staticMapLite
$this->markers[] = array('lat' => $markerLat, 'lon' => $markerLon, 'type' => $markerType); $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 ($_GET['maptype']) {
if (array_key_exists($_GET['maptype'], $this->tileSrcUrl)) $this->maptype = $_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) public function tileUrlToFilename($url)
{ {