From: maxious Date: Thu, 24 Mar 2011 11:07:37 +0000 Subject: Use cloudmade tiles for static maps X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=9d86a59dde0f806ef431efc41f77524a12d98987 --- Use cloudmade tiles for static maps --- --- a/aws/awsStartup.sh +++ b/aws/awsStartup.sh @@ -5,6 +5,7 @@ #http://www.how2forge.org/installing-lighttpd-with-php5-and-mysql-support-on-fedora-12 cp /root/aws.php /tmp/ +mkdir /var/www/lib/staticmaplite/cache chcon -h system_u:object_r:httpd_sys_content_t /var/www chcon -R -h root:object_r:httpd_sys_content_t /var/www/* chcon -R -t httpd_sys_content_rw_t /var/www/lib/staticmaplite/cache --- a/include/common-geo.inc.php +++ b/include/common-geo.inc.php @@ -47,7 +47,7 @@ } $output = ""; if ($collapsible) $output.= '

Open Map...

'; - $output.= '
'; if ($collapsible) $output.= '
'; return $output; --- a/lib/staticmaplite/staticmap.php +++ b/lib/staticmaplite/staticmap.php @@ -32,11 +32,9 @@ 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', - 'cycle' => 'http://c.andy.sandbox.cloudmade.com/tiles/cycle/{Z}/{X}/{Y}.png' - ); - - protected $tileDefaultSrc = 'mapnik'; + 'cloudmade' => 'http://b.tile.cloudmade.com/daa03470bb8740298d4b10e3f03d63e6/1/256/{Z}/{X}/{Y}.png',); + + protected $tileDefaultSrc = 'cloudmade'; protected $markerBaseDir = 'images/markers'; protected $osmLogo = 'images/osm_logo.png'; @@ -258,8 +256,10 @@ } else { // no cache, make map, send headers and deliver png $this->makeMap(); - $this->sendHeader(); - return imagepng($this->image); + // $this->sendHeader(); + // do some extra compression + imagetruecolortopalette($this->image, false, 256); + return imagepng($this->image, 9, PNG_ALL_FILTERS); } }