From eda405aafeb95f2d4c42fe14cdf983b71b93be39 Mon Sep 17 00:00:00 2001 From: rac98 Date: Tue, 13 Oct 2009 13:48:13 +0000 Subject: [PATCH] max geometry (width + height) git-svn-id: http://svn.code.sf.net/p/staticmaplite/code@4 3c7674d3-d6c2-4d0e-87b7-95661b9333b9 --- staticmap.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/staticmap.php b/staticmap.php index a376fbe..c37f129 100644 --- a/staticmap.php +++ b/staticmap.php @@ -30,6 +30,9 @@ ini_set('display_errors','off'); Class staticMapLite { + protected $maxWidth = 1024; + protected $maxHeight = 1024; + protected $tileSize = 256; protected $tileSrcUrl = array( 'mapnik' => 'http://tile.openstreetmap.org/{Z}/{X}/{Y}.png', 'osmarenderer' => 'http://c.tah.openstreetmap.org/Tiles/tile/{Z}/{X}/{Y}.png', @@ -78,7 +81,9 @@ Class staticMapLite { if($_GET['size']){ list($this->width, $this->height) = split('x',$_GET['size']); $this->width = intval($this->width); + if($this->width > $this->maxWidth) $this->width = $this->maxWidth; $this->height = intval($this->height); + if($this->height > $this->maxHeight) $this->height = $this->maxHeight; } if($_GET['markers']){ $markers = split('%7C|\|',$_GET['markers']);