diff --git a/images/markers/bullseye.png b/images/markers/bullseye.png new file mode 100644 index 0000000..1ff1c23 Binary files /dev/null and b/images/markers/bullseye.png differ diff --git a/staticmap.php b/staticmap.php index 720452f..232594f 100644 --- a/staticmap.php +++ b/staticmap.php @@ -65,8 +65,12 @@ Class staticMapLite 'shadow' => '../marker_shadow.png', 'offsetImage' => '-10,-32', 'offsetShadow' => '-1,-13' + ), + // http://svn.openstreetmap.org/sites/other/StaticMap/symbols/0.png + 'ojw' => array('regex' => '/^bullseye$/', + 'extension' => '.png', + 'shadow' => false ) - ); @@ -97,6 +101,16 @@ Class staticMapLite { global $_GET; + if (!empty($_GET['show'])) { + $this->parseOjwParams(); + } + else { + $this->parseLiteParams(); + } + } + + public function parseLiteParams() + { // get zoom from GET paramter $this->zoom = $_GET['zoom'] ? intval($_GET['zoom']) : 0; if ($this->zoom > 18) $this->zoom = 18; @@ -130,6 +144,24 @@ Class staticMapLite } } + public function parseOjwParams() + { + $this->lat = floatval($_GET['lat']); + $this->lon = floatval($_GET['lon']); + $this->zoom = intval($_GET['z']); + + $this->width = intval($_GET['w']); + $this->height = intval($_GET['h']); + + if (!empty($_GET['mlat0'])) { + $markerLat = floatval($_GET['mlat0']); + if (!empty($_GET['mlon0'])) { + $markerLon = floatval($_GET['mlon0']); + $this->markers[] = array('lat' => $markerLat, 'lon' => $markerLon, 'type' => "bullseye"); + } + } + } + public function lonToTile($long, $zoom) { return (($long + 180) / 360) * pow(2, $zoom); @@ -369,4 +401,4 @@ Class staticMapLite } $map = new staticMapLite(); -print $map->showMap(); \ No newline at end of file +print $map->showMap();