openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ab125f3575dee2c4b06fd29b1733d8b93ec7c5b1
parent f85765143665b722fb7f95c0aee5c9e0956f9e68
Author: dankert <devnull@localhost>
Date:   Tue,  2 Jun 2009 22:55:55 +0200

Makro for including Google Map and OSM Map

Diffstat:
dynamicClasses/GoogleMaps.class.php | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
dynamicClasses/OpenStreetMap.class.php | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 128 insertions(+), 0 deletions(-)

diff --git a/dynamicClasses/GoogleMaps.class.php b/dynamicClasses/GoogleMaps.class.php @@ -0,0 +1,63 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// --------------------------------------------------------------------------- + + + +/** + * Bindet eine Google-Maps-Karte ein. + * + * @author Jan Dankert + */ +class GoogleMaps extends Dynamic +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'lat' => 'Latitude', + 'long' => 'Longitude', + 'zoom' => 'Zoom' + ); + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Includes a Google Map.'; + + var $long = 10; // Default: Hamburg + var $lat = 53.55; // Default: Hamburg + var $zoom = 10; + var $width = 425; + var $height = 350; + + /** + */ + function execute() + { + $this->output('<iframe width="'.$this->width.'" height="'.$this->height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.de/?ie=UTF8&amp;ll='.$this->lat.','.$this->long.'&amp;z='.$this->zoom.'&amp;output=embed"></iframe>'); + } + +} + +?>+ \ No newline at end of file diff --git a/dynamicClasses/OpenStreetMap.class.php b/dynamicClasses/OpenStreetMap.class.php @@ -0,0 +1,63 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// OpenRat Content Management System +// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// --------------------------------------------------------------------------- + + + +/** + * Bindet die OpenStreetMap ein. + * + * @author Jan Dankert + */ +class OpenStreetMap extends Dynamic +{ + /** + * Bitte immer alle Parameter in dieses Array schreiben, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $parameters = Array( + 'box' => 'coordinates', + 'layer' => 'mapnik', + 'width' => 'Width of iframe', + 'height' => 'Height of iframe', + ); + + /** + * Bitte immer eine Beschreibung benutzen, dies ist fuer den Web-Developer hilfreich. + * @type String + */ + var $description = 'Includes the OpenStreetMap.'; + + var $box = '9.9396,53.4821,10.184,53.643'; // default: Hamburg + var $layer = 'mapnik'; + var $width = 425; + var $height = 350; + + /** + */ + function execute() + { + $this->output('<iframe width="'.$this->width.'" height="'.$this->height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.openstreetmap.org/export/embed.html?bbox='.$this->box.'&layer='.$this->layer.'" style="border: 1px solid black"></iframe>'); + } + +} + +?>+ \ No newline at end of file