Commits

Dave Gööck  committed e43a216

Erstes Refactoring des Google Maps Addons. Es ist wahrscheinlich nicht lauffähig und muss im nächsten Projekt optimiert werden.

  • Participants
  • Parent commits 46752f7

Comments (0)

Files changed (12)

File classes/class.wv15gmapper.php

-<?php
-/*
- * Copyright (c) 2009, webvariants GbR, http://www.webvariants.de
- * 
- * Diese Datei steht unter der MIT-Lizenz. Der Lizenztext befindet sich in der 
- * beiliegenden LICENSE Datei und unter:
- * 
- * http://www.opensource.org/licenses/mit-license.php
- * http://de.wikipedia.org/wiki/MIT-Lizenz 
- */
-/**
- * @defgroup external Externe, öffentliche API
- */
-
-/**
- * Google Mapper
- * 
- * Diese Klasse stellt die öffentliche API für den Google Mapper zur Verfügung Sie 
- * wird genutzt um Module zu erstellen.
- * 
- * @author     Dave Gööck
- * @copyright  webvariants GbR, www.webvariants.de
- * 
- * @ingroup    external
- */
-class WV15_GMapper {
-	
-	private static $apiKey = '';
-	
-	private $mapData;
-	private $width          = '300px';
-	private $height         = '300px';
-	
-	public static function setApiKey($apiKey) {
-		self::$apiKey = $apiKey;
-	}
-	
-	public function getControls() {
-		return $this->mapData->controls;
-	}
-	
-	public function getMapTypes() {
-		return $this->mapData->mapTypes;
-	}
-	
-	public static function getApiKey() {
-		return self::$apiKey;
-	}
-	
-	public function __construct($lat = '', $long = '', $zoomLevel = '') {
-		
-		$this->mapData = new WV15_MapData(
-			new WV15_Coordinate($lat, $long),
-			$zoomLevel
-		);
-		$this->setLongitude($long);
-		$this->setLatitude($lat);
-		$this->setZoomLevel($zoomLevel);
-	}
-	
-	public function addKmlOverlay($filename) {
-		$this->mapData->kmlFiles[] = $filename;
-	}
-	
-	public function setLongitude($long) {
-		if (!empty($long)) $this->mapData->mapCenter->lng = $long;
-	}
-
-	public function getLongitude() {
-		return $this->mapData->mapCenter->lng;
-	}
-	
-	public function setLatitude($lat) {
-		if (!empty($lat)) $this->mapData->mapCenter->lat = $lat;
-	}
-
-	public function getLatitude() {
-		return $this->mapData->mapCenter->lng;
-	}
-
-	public function setZoomLevel($zoomLevel) {
-		if (!empty($zoomLevel)) $this->mapData->mapZoom = $zoomLevel;
-	}
-
-	public function getZoomLevel() {
-		return $this->mapData->mapZoom;
-	}
-
-	public function setWidth($width) {
-		if (!empty($width)) $this->width = $width;
-	}
-
-	public function getWidth() {
-		return $this->width;
-	}
-	
-	public function setHeight($height) {
-		if (!empty($height)) $this->height = $height;
-	}
-
-	public function getHeight() {
-		return $this->height;
-	}
-
-	public function setBounds($topRightLat, $topRightLong, $bottomLeftLat, $bottomLeftLong) {
-		if (empty($topRightLat) || empty($topRightLong) || empty($bottomLeftLat) || empty($bottomLeftLong)) return;
-		
-		$this->mapData->setBounds(
-			new WV15_Coordinate($bottomLeftLat, $bottomLeftLong),
-			new WV15_Coordinate($topRightLat, $topRightLong)
-		);
-	}
-
-	public function getBounds() {
-		if (empty($this->topRightLat) || empty($this->topRightLong) || empty($this->bottomLeftLat) || empty($this->bottomLeftLong)) return null;
-		return array('TRLat' => $this->mapData->mapBounds[1]->lat, 'TRLong' => $this->mapData->mapBounds[1]->lng, 
-			'BLLat' =>  $this->mapData->mapBounds[0]->lat, 'BLLong' =>  $this->mapData->mapBounds[0]->lng);
-	}
-
-	/**
-	 * Setzt die möglichen Kartentypen.
-	 * 
-	 * Welche Parameter möglich sind, findet man unter:
-	 * http://code.google.com/intl/de/apis/maps/documentation/reference.html#GMapType
-	 * 
-	 * Der erste Typ des Arrays wird zur Initialisierung der Karte angezeigt.
-	 * 
-	 * @param  $types  Array  Array mit Strings der Kartentypen. 
-	 */
-	public function setMapTypes($types) {
-		if (is_array($types)) $this->mapData->mapTypes = $types;
-	}
-
-	public function addStandardMarker($lat, $long, $title = '') {
-//		$this->markers[] = array('lat' => $lat, 'long' => $long, 'title' => $title);
-	}
-
-	public function addMarker(WV15_Marker $marker) {
-		$this->mapData->addMarker($marker);
-		//$this->markers[] = $marker;
-	}
-	
-	public function getMarkers() {
-		return $this->mapData->marker;
-	}
-	
-	public function printMap($id = '') {
-		if (empty($id)) $id = 'googleMap';
-		print '<div id="'.$id.'" style="width: '.$this->getWidth().'; height: '.$this->getHeight().';"></div>';
-		print '<script type="text/javascript">
-		/* <![CDATA[ */
-			var data = '.json_encode($this->mapData).';
-			var wv15_map = new WV15_GMapper(data);
-			wv15_map.run();
-		/* ]]> */
-		</script>
-		';
-	}
-}
-
-// EOF

File classes/class.wv15maps.php

+<?php
+/*
+ * Copyright (c) 2009, webvariants GbR, http://www.webvariants.de
+ * 
+ * Diese Datei steht unter der MIT-Lizenz. Der Lizenztext befindet sich in der 
+ * beiliegenden LICENSE Datei und unter:
+ * 
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://de.wikipedia.org/wiki/MIT-Lizenz 
+ */
+/**
+ * @defgroup external Externe, öffentliche API
+ */
+
+/**
+ * Google Map
+ * 
+ * Diese Klasse stellt die öffentliche API für das Google Maps Addon zur 
+ * Verfügung. Sie wird genutzt um Module zu erstellen.
+ * 
+ * @author     Dave Gööck
+ * @copyright  webvariants GbR, www.webvariants.de
+ * 
+ * @ingroup    external
+ */
+class WV15_Map {
+	
+	private static $apiKey = '';
+	
+	private $mapData;
+	private $width          = '300px';
+	private $height         = '300px';
+	
+	public static function setApiKey($apiKey) {
+		self::$apiKey = $apiKey;
+	}
+	
+	public function getControls() {
+		return $this->mapData->controls;
+	}
+	
+	public function getMapTypes() {
+		return $this->mapData->mapTypes;
+	}
+	
+	public static function getApiKey() {
+		return self::$apiKey;
+	}
+	
+	public function __construct($lat = '', $long = '', $zoomLevel = '') {
+		
+		$this->mapData = new WV15_MapData(
+			new WV15_Coordinate($lat, $long),
+			$zoomLevel
+		);
+		$this->setLongitude($long);
+		$this->setLatitude($lat);
+		$this->setZoomLevel($zoomLevel);
+	}
+	
+	public function addKmlOverlay($filename) {
+		$this->mapData->kmlFiles[] = $filename;
+	}
+	
+	public function setLongitude($long) {
+		if (!empty($long)) $this->mapData->mapCenter->lng = $long;
+	}
+
+	public function getLongitude() {
+		return $this->mapData->mapCenter->lng;
+	}
+	
+	public function setLatitude($lat) {
+		if (!empty($lat)) $this->mapData->mapCenter->lat = $lat;
+	}
+
+	public function getLatitude() {
+		return $this->mapData->mapCenter->lng;
+	}
+
+	public function setZoomLevel($zoomLevel) {
+		if (!empty($zoomLevel)) $this->mapData->mapZoom = $zoomLevel;
+	}
+
+	public function getZoomLevel() {
+		return $this->mapData->mapZoom;
+	}
+
+	public function setWidth($width) {
+		if (!empty($width)) $this->width = $width;
+	}
+
+	public function getWidth() {
+		return $this->width;
+	}
+	
+	public function setHeight($height) {
+		if (!empty($height)) $this->height = $height;
+	}
+
+	public function getHeight() {
+		return $this->height;
+	}
+
+	public function setBounds($topRightLat, $topRightLong, $bottomLeftLat, $bottomLeftLong) {
+		if (empty($topRightLat) || empty($topRightLong) || empty($bottomLeftLat) || empty($bottomLeftLong)) return;
+		
+		$this->mapData->setBounds(
+			new WV15_Coordinate($bottomLeftLat, $bottomLeftLong),
+			new WV15_Coordinate($topRightLat, $topRightLong)
+		);
+	}
+
+	public function getBounds() {
+		if (empty($this->topRightLat) || empty($this->topRightLong) || empty($this->bottomLeftLat) || empty($this->bottomLeftLong)) return null;
+		return array('TRLat' => $this->mapData->mapBounds[1]->lat, 'TRLong' => $this->mapData->mapBounds[1]->lng, 
+			'BLLat' =>  $this->mapData->mapBounds[0]->lat, 'BLLong' =>  $this->mapData->mapBounds[0]->lng);
+	}
+
+	/**
+	 * Setzt die möglichen Kartentypen.
+	 * 
+	 * Welche Parameter möglich sind, findet man unter:
+	 * http://code.google.com/intl/de/apis/maps/documentation/reference.html#GMapType
+	 * 
+	 * Der erste Typ des Arrays wird zur Initialisierung der Karte angezeigt.
+	 * 
+	 * @param  $types  Array  Array mit Strings der Kartentypen. 
+	 */
+	public function setMapTypes($types) {
+		if (is_array($types)) $this->mapData->mapTypes = $types;
+	}
+
+	public function addStandardMarker($lat, $long, $title = '') {
+//		$this->markers[] = array('lat' => $lat, 'long' => $long, 'title' => $title);
+	}
+
+	public function addMarker(WV15_Marker $marker) {
+		$this->mapData->addMarker($marker);
+		//$this->markers[] = $marker;
+	}
+	
+	public function getMarkers() {
+		return $this->mapData->marker;
+	}
+	
+	public function printMap($id = '') {
+		if (empty($id)) $id = 'googleMap';
+		print '<div id="'.$id.'" style="width: '.$this->getWidth().'; height: '.$this->getHeight().';"></div>';
+		print '<script type="text/javascript">
+		/* <![CDATA[ */
+			var data = '.json_encode($this->mapData).';
+			var wv15_map = new WV15_Map(data);
+			wv15_map.run();
+		/* ]]> */
+		</script>
+		';
+	}
+}
+
+// EOF

File classes/internal/class.wv15.php

  */
 
 /**
- * Hilfsklasse für das Google Mapper Addon.
+ * Hilfsklasse für das Google Maps Addon.
  *
- * Diese Klasse stellt die interne API des GMapper Addons bereit. Die hier
- * definierten Methoden werden vom Addon benötigt um die GMapper
+ * Diese Klasse stellt die interne API des WVMaps Addons bereit. Die hier
+ * definierten Methoden werden vom Addon benötigt um die WVMaps
  * Funktionalitäten zur Verfügung zu stellen.
  *
  * @author     Dave Gööck
 	 * Liste aller JavaScript-Dateien des AddOns.
 	 */
 	private static $jsFiles = array(
-//		'mapfile/gmapperjs' => 'wymeditor/bodyjs.js'
+		'mapfile/wvmapsjs' => 'wvmaps/wv15maps.js'
 	);
 
 	/**
 	 * Points geladen werden, etc.
 	 */
 	public static function init() {
-//		include_once self::getBaseDir().'/class.gmapper.php';
 		$self = __CLASS__;
 		rex_register_extension('PAGE_HEADER', array($self, 'pageHeader'));
 		self::sendFiles();
 	
 	public static function insertApiKey($params) {
 		if (empty($params['subject'])) return;
-		$apiKey = WV15_GMapper::getApiKey();
+		$apiKey = WV15_Map::getApiKey();
 		if (empty($apiKey)) return;
 		return str_replace('</head>', '<script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key='.$apiKey.'&amp;h1=de" type="text/javascript"></script></head>',$params['subject']);
 	}
 	
 	public static function extractArchive($file, $msg = '', $path=null) {
 		global $REX;
-		include_once $REX['INCLUDE_PATH'].'/addons/gmapper/classes/class.pclzip.inc.php';
-		if(!$path) $path = '../files/'. $REX['TEMP_PREFIX'].'/gmapper';
+		include_once $REX['INCLUDE_PATH'].'/addons/wvmaps/classes/class.pclzip.inc.php';
+		if(!$path) $path = '../files/'. $REX['TEMP_PREFIX'].'/wvmaps';
 
 		$archive = new PclZip($file);
 		if ($archive->extract(PCLZIP_OPT_PATH, $path) == 0) die("Error : ".$archive->errorInfo(true));
 
 	public static function getBaseDir() {
 		global $REX;
-		return $REX['MEDIAFOLDER'].'/'. $REX['TEMP_PREFIX'].'/gmapper';
+		return $REX['MEDIAFOLDER'].'/'. $REX['TEMP_PREFIX'].'/wvmaps';
 	}
 
 	public static function getBaseURI() {
 		global $REX;
-		return $REX['HTDOCS_PATH'].'files/'. $REX['TEMP_PREFIX'].'/gmapper';
+		return $REX['HTDOCS_PATH'].'files/'. $REX['TEMP_PREFIX'].'/wvmaps';
 	}
 
 	private static function startsWith($string, $start) {

File config.inc.php

 error_reporting(E_ALL); // Redaxo mag E_STRICT nicht
 ini_set('display_errors', true);
 
-$REX['ADDON']['page']['gmapper']        = 'gmapper';
-$REX['ADDON']['name']['gmapper']        = 'Google Mapper';
-$REX['ADDON']['perm']['gmapper']        = 'gmapper[]';
-$REX['ADDON']['version']['gmapper']     = '0.2';
-$REX['ADDON']['author']['gmapper']      = 'Dave Gööck';
-$REX['ADDON']['supportpage']['gmapper'] = 'www.webvariants.de';
+$REX['ADDON']['page']['wvmaps']        = 'wvmaps';
+$REX['ADDON']['name']['wvmaps']        = 'Google Maps';
+$REX['ADDON']['perm']['wvmaps']        = 'wvmaps[]';
+$REX['ADDON']['version']['wvmaps']     = '0.3';
+$REX['ADDON']['author']['wvmaps']      = 'Dave Gööck, Gregor Aisch';
+$REX['ADDON']['supportpage']['wvmaps'] = 'www.webvariants.de';
 
-$REX['PERM'][] = 'gmapper[]';
+$REX['PERM'][] = 'wvmaps[]';
 
-define('WV15_PATH', $REX['INCLUDE_PATH'].'/addons/gmapper/');
+define('WV15_PATH', $REX['INCLUDE_PATH'].'/addons/wvmaps/');
 
 include_once('classes/internal/class.wv15.php');
 _WV15::init();
-include_once('classes/class.wv15gmapper.php');
+include_once('classes/class.wv15maps.php');
 include_once('classes/class.wv15data.php');
 //include_once('classes/class.wv15marker.php');

File install.inc.php

 <?php
-/**
- * GMapper Addon
+/*
+ * Copyright (c) 2009, webvariants GbR, http://www.webvariants.de
  * 
- * @author dave[at]webvariants[dot]de Dave Gööck
- * @author <a href="http://www.webvariants.de">www.webvariants.de</a>s
+ * Diese Datei steht unter der MIT-Lizenz. Der Lizenztext befindet sich in der 
+ * beiliegenden LICENSE Datei und unter:
+ * 
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://de.wikipedia.org/wiki/MIT-Lizenz 
  */
 
-require_once $REX['INCLUDE_PATH'] . '/addons/gmapper/classes/internal/class.wv15.php';
-
-$error = '';
-
-// check folder write permissions
-$tmpDir = $REX['MEDIAFOLDER'].'/'.$REX['TEMP_PREFIX'];
-if (!is_dir($tmpDir) && !mkdir($tmpDir)) $error = 'Could not create temp-dir "'.$tmpDir.'"!';
-if ($error == '' && !is_writable($tmpDir)) $error = 'temp-dir "'.$tmpDir.'" not writable!';
-
-$targetDir = _WV15::getBaseDir();
-if ($error == '' && !is_dir($targetDir) && !mkdir($targetDir)) $error = 'Could not create gmapper-dir "'.$targetDir.'"!';
-if ($error == '' && !is_writable($targetDir)) $error = 'gmapper-dir "'.$targetDir.'" not writable!';
-
-// Copy files
-if ($error == '') _WV15::extractArchive('include/addons/gmapper/archives/gmapper1_2.zip', 'GMapper wird installiert');
-if ($error != '') $REX['ADDON']['installmsg']['gmapper'] = $error;
-else $REX['ADDON']['install']['gmapper'] = true;
+$REX['ADDON']['install']['wvmaps'] = true;
 
 // EOF

File js/wv15maps.js

+/*
+ * Copyright (c) 2009, webvariants GbR, http://www.webvariants.de
+ * 
+ * Diese Datei steht unter der MIT-Lizenz. Der Lizenztext befindet sich in der 
+ * beiliegenden LICENSE Datei und unter:
+ * 
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://de.wikipedia.org/wiki/MIT-Lizenz 
+ * 
+ */
+
+/**
+ * Google Mapper (JS)
+ * 
+ * Die Klasse WV15_GMapper erzeugt eine Google Map anhand einer speziellen, 
+ * objektorientierten Datenstruktur, welche per PHP erzeugt und als JSON
+ * an diese Klasse gesendet wird. Ziel ist es, die komplizierte API von 
+ * Google zu abstrahieren und dabei den dynamisch generierten JavaScript-Output
+ * zu minimieren.
+ * 
+ * @author     Gregor Aisch
+ * @copyright  webvariants GbR, www.webvariants.de
+ * 
+ */
+
+function WV15_GMapper(data) { 
+	this._data = data;
+	this._map = null;
+	this._bounds = null;
+}
+
+WV15_GMapper.prototype.run = function() {
+	var data = this._data;
+	
+	if (GBrowserIsCompatible()) {
+		this._map = new GMap2(document.getElementById(data.mapId));
+		var map = this._map;
+		if (data.mapTypes) {
+			if (data.mapTypes.selectedMapType) map.setMapType(eval(data.mapTypes.selectedMapType));
+		}
+		
+		if (data.kmlFiles) {
+			for (var i=0;i<data.kmlFiles.length;i++) {
+				var geoXml = new GGeoXml(data.kmlFiles[i]);
+				map.addOverlay(geoXml);
+			}
+		}
+		
+		map.setCenter(new GLatLng(parseFloat(data.mapCenter.lat), parseFloat(data.mapCenter.lng)), parseInt(data.mapZoom));
+		
+		if (data.mapBounds) {
+			_bounds = new GLatLngBounds();
+			_bounds.extend(new GLatLng(data.mapBounds[0].lat, data.mapBounds[0].lng));
+			_bounds.extend(new GLatLng(data.mapBounds[1].lat, data.mapBounds[1].lng));
+			map.setZoom(map.getBoundsZoomLevel(_bounds));
+			map.setCenter(_bounds.getCenter());
+		}
+		
+		if (data.marker) {
+			for (i=0;i<data.marker.length;i++) {
+				var mo = {};
+				mo.icon = new GIcon();
+				
+				if (data.marker[i].icon) {
+						if (data.marker[i].icon.image) {
+						mo.icon.image = data.marker[i].icon.image;
+					}
+					mo.icon.iconAnchor = new GPoint(data.marker[i].icon.anchor.x, data.marker[i].icon.anchor.y);
+				}
+				if (data.marker[i].shadow) {
+					mo.icon.shadow = data.marker[i].shadow.image;
+					mo.icon.infoShadowAnchor = new GPoint(data.marker[i].shadow.anchor.x, data.marker[i].shadow.anchor.y);
+				} 
+				if (data.marker[i].window) {
+					mo.icon.infoWindowAnchor = new GPoint(data.marker[i].window.anchor.x, data.marker[i].window.anchor.y);						
+				}
+				var m = new GMarker(new GLatLng(data.marker[i].coordinates.lat, data.marker[i].coordinates.lng), mo);
+				m.wv_content = data.marker[i].window.content;
+				if (data.marker[i].window) {
+					if (data.marker[i].window.type == 'html') {
+						GEvent.bind(m, "click", m, this.markerClick);
+					 }
+				}
+				map.addOverlay(m);
+			}
+		}
+		if (data.controls && map.setUI) {
+			map.removeControl(new GMapTypeControl());
+			map.removeControl(new GHierarchicalMapTypeControl());
+			
+			var customUI = map.getDefaultUI();
+			customUI.controls.largemapcontrol3d = data.controls.largeMapControl3D;
+			customUI.controls.smallzoomcontrol3d = data.controls.smallZoomControl3D;
+			customUI.controls.maptypecontrol = data.controls.mapTypeControl;
+			customUI.controls.menumaptypecontrol = data.controls.menuMapTypeControl;
+			customUI.controls.scalecontrol = data.controls.scaleControl;
+			
+			if (data.controls.largeMapControl) map.addControl(new GLargeMapControl());
+			if (data.controls.smallMapControl) map.addControl(new GSmallMapControl ());
+			if (data.controls.smallZoomControl) map.addControl(new GSmallZoomControl());
+			if (data.controls.hierarchicalMapTypeControl) map.addControl(new GHierarchicalMapTypeControl());
+			if (data.controls.overviewMapControl) map.addControl(new GOverviewMapControl ());
+
+			if (data.mapTypes) {
+				customUI.maptypes.normal = data.mapTypes.normal;
+				customUI.maptypes.satellite = data.mapTypes.satellite;
+				customUI.maptypes.hybrid = data.mapTypes.hybrid;
+				customUI.maptypes.physical = data.mapTypes.physical;
+			}
+			
+			map.setUI(customUI);
+		}
+
+	}
+}
+
+WV15_GMapper.prototype.markerClick = function(point) {
+	this.openInfoWindowHtml(this.wv_content);
+}
+
+WV15_GMapper.prototype.showRoute = function(fromAddress, toAddress, detailsContainer, statusContainer, onComplete) {
+	if (!this._gdir) {
+		this._routeDetails = detailsContainer;
+		this._routeStatus = statusContainer;
+		this._routeComplete = onComplete;
+		this._gdir = new GDirections(this._map, detailsContainer);
+		GEvent.bind(this._gdir, "load", this, this.showRouteComplete);
+		GEvent.bind(this._gdir, "error", this, this.showRouteError);
+	}
+	this._gdir.load("from: " + fromAddress + " to: " + toAddress, { "locale": 'de' });
+}
+
+WV15_GMapper.prototype.showRouteComplete = function() {
+	if (this._gdir) {
+		this._routeStatus.update('<p>Der Anfahrtsweg wurde berechnet und wird in einem neuen Fenster geöffnet.</p>');
+		// prototype depency
+		this._routeDetails.show();
+		window.setTimeout(this._routeComplete, 500);
+	}
+}
+
+WV15_GMapper.prototype.showRouteError = function() {
+	this._routeDetails.hide();
+	var gdir = this._gdir; 
+	if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
+		this._routeStatus.update("<p>Für die eingegebene Adresse wurde keine geografische Position gefunden. Die Ursache könnte darin liegen, dass die Adresse noch sehr neu ist oder einfach ein Tippfehler vorliegt. Sie könnten versuchen die Adresse genauer zu definieren (z.B. indem Sie die Postleitzahl hinzufügen o.ä.).</p>") ;
+	else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
+		this._routeStatus.update("<p>A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.</p>") ;
+	else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
+		this._routeStatus.update("<p>The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.</p>");
+//  else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS)  <--- Doc bug... this is either not defined, or Doc is wrong
+//     alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code);
+	else if (gdir.getStatus().code == G_GEO_BAD_KEY)
+		this._routeStatus.update("<p>The given key is either invalid or does not match the domain for which it was given.</p>") ;
+	else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
+	   this._routeStatus.update("<p>A directions request could not be successfully parsed.</p>");
+	else     
+	this._routeStatus.update("<p>Ein unbekannter Fehler ist aufgetreten.</p>");
+
+}

File js/wvmaps.js

Empty file removed.

File pages/index.inc.php

 /*
  * Copyright (c) 2009, webvariants GbR, http://www.webvariants.de
  * 
- * inspiriert von:
- *   TinyMCE 2.0.6.1 Redaxo Mods by Dave Holloway @ GN2-Netwerk.de
- *   WYMeditor Anpassung von axel wehner | aw@68media.de
- * 
  * Diese Datei steht unter der MIT-Lizenz. Der Lizenztext befindet sich in der 
  * beiliegenden LICENSE Datei und unter:
  * 
 	<tr><th>Anleitung für WYM-Editor-Modul</th></tr>
 	<tr><th>Input</th></tr>
 	<tr><td>
-		<div class="wymmodule"><code>';
-			highlight_file(dirname(__FILE__).'/../templates/template.wymmodule1.inc.php');
+		<div class="mapsmodule"><code>Es ist keine Eingabe nötig.';
 print '</code></div>
 	</td></tr>
 	<tr><th>Output</th></tr>
 	<tr><td>
-		<div class="wymmodule"><code>';
-			highlight_file(dirname(__FILE__).'/../templates/template.wymmodule2.inc.php');
+		<div class="mapsmodule"><code>';
+			highlight_file(dirname(__FILE__).'/../templates/template.mapsmodule1.inc.php');
 print '</code></div>
 	</td></tr>
 </table>';
 
-if (false) {
-?>
-<style type="text/css">
-pre {padding:10px;font-size:12px;overflow:hidden;border:1px solid #CCCCCC;margin:5px;background-color:#FFFFFF;}
-</style>
-<table border="0" cellpadding="5" cellspacing="1" width="770">
-  <tbody>
-  <tr>
-    <th colspan="2" align="left"><?=$FL['title'];?></th>
-  </tr>
-  
-  <tr>
-<td class="grey">
-<h1>WYMeditor Beispielmodule</h1>
-<br />
-<h2>Moduleingabe Einfach</h2>
-<pre>
-&lt;?php
-//---MODULE BY----------------------
-//-- blumbeet - web.studio
-//-- Thomas Blum
-//-- www.blumbeet.com
-//----------------------------------
-//-- angespasst an WYMeditor
-//-- axel wehner | aw@68media.de
-//-- www.68media.de
-?&gt;
-
-&lt;link rel="stylesheet" type="text/css" media="screen" href="&lt;?=$REX['HTDOCS_PATH']?&gt;files/wymeditor/skins/default/screen.css" /&gt;
-&lt;script type="text/javascript" src="&lt;?=$REX['HTDOCS_PATH']?&gt;files/wymeditor/jquery.js"&gt;&lt;/script&gt;
-&lt;script type="text/javascript" src="&lt;?=$REX['HTDOCS_PATH']?&gt;files/wymeditor/jquery.wymeditor.js"&gt;&lt;/script&gt;
-&lt;script type="text/javascript"&gt;
-
-var $j = jQuery.noConflict();
-
-$j(function() {
-	// "Block speichern bzw. �bernehmen" Button
-	$("td.lblue &gt; form &gt; input").addClass("wymupdate");
-
-    //textarea initialisieren
-	$j(".wymeditor").wymeditor();
-});
-&lt;/script&gt;
-
-&lt;strong&gt;Fliesstext:&lt;/strong&gt;:&lt;br /&gt;&lt;br /&gt;
-&lt;textarea name="VALUE[1]" class="wymeditor"&gt;REX_HTML_VALUE[1]&lt;/textarea&gt;
-&lt;br /&gt;&lt;br /&gt;
-
-
-&lt;strong&gt;Artikelfoto:&lt;/strong&gt;:&lt;br /&gt;
-REX_MEDIA_BUTTON[1]
-&lt;?
-if ("REX_FILE[1]" != "") {
-    echo "&lt;br/&gt;&lt;strong&gt;Vorschau&lt;/strong&gt;:&lt;br/&gt;";
-	echo "&lt;img src=".$REX[HTDOCS_PATH]."/files/REX_FILE[1]&gt;&lt;br /&gt;";
-}
-?&gt;
-
-&lt;br/&gt;
-&lt;strong&gt;Title des Fotos:&lt;/strong&gt;:&lt;br /&gt;
-&lt;input type="text" name="VALUE[2]" value="REX_VALUE[2]" size="80" class="inp100" /&gt;
-&lt;br /&gt;&lt;br /&gt;
-
-&lt;strong&gt;Bildunterschrift:&lt;/strong&gt;:&lt;br /&gt;
-&lt;input type="text" name="VALUE[3]" value="REX_VALUE[3]" size="80" class="inp100" /&gt;
-&lt;br /&gt;&lt;br /&gt;
-
-&lt;strong&gt;Ausrichtung des Artikelfotos&lt;/strong&gt;:&lt;br /&gt;
-&lt;select name="VALUE[9]" class="inp100"&gt;
-	&lt;option value='l' &lt;? if ("REX_VALUE[9]" == 'l') echo 'selected'; ?&gt;&gt;links vom Text&lt;/option&gt;
-	&lt;option value='r' &lt;? if ("REX_VALUE[9]" == 'r') echo 'selected'; ?&gt;&gt;rechts vom Text&lt;/option&gt;
-&lt;/select&gt;&lt;br /&gt;
-&lt;br /&gt;
-</pre>
-
-<h2>Moduleingabe Erweitert</h2>
-<pre>
-&lt;?php
-//---MODULE BY----------------------
-//-- blumbeet - web.studio
-//-- Thomas Blum
-//-- www.blumbeet.com
-//----------------------------------
-//-- angespasst an WYMeditor
-//-- axel wehner | aw@68media.de
-//-- www.68media.de
-?&gt;
-
-&lt;link rel="stylesheet" type="text/css" media="screen" href="&lt;?=$REX['HTDOCS_PATH']?&gt;files/wymeditor/skins/default/screen.css" /&gt;
-&lt;script type="text/javascript" src="&lt;?=$REX['HTDOCS_PATH']?&gt;files/wymeditor/jquery.js"&gt;&lt;/script&gt;
-&lt;script type="text/javascript" src="&lt;?=$REX['HTDOCS_PATH']?&gt;files/wymeditor/jquery.wymeditor.js"&gt;&lt;/script&gt;
-&lt;script type="text/javascript" src="&lt;?=$REX['HTDOCS_PATH']?&gt;files/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js"&gt;&lt;/script&gt;
-&lt;script type="text/javascript" src="&lt;?=$REX['HTDOCS_PATH']?&gt;files/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js"&gt;&lt;/script&gt;
-
-&lt;script type="text/javascript"&gt;
-
-var $j = jQuery.noConflict();
-
-$j(function() {
-
-	// "Block speichern bzw. �bernehmen" Button
-	$("td.lblue &gt; form &gt; input").addClass("wymupdate");
-
-	$j('.wymeditor').wymeditor({
-
-      //classes panel
-      classesItems: [
-        {'name': 'date', 'title': 'PARA: Date', 'expr': 'p'},
-        {'name': 'hidden-note', 'title': 'PARA: Hidden note',
-         'expr': 'p[@class!="important"]'},
-        {'name': 'important', 'title': 'PARA: Important',
-         'expr': 'p[@class!="hidden-note"]'},
-        {'name': 'border', 'title': 'IMG: Border', 'expr': 'img'},
-        {'name': 'special', 'title': 'LIST: Special', 'expr': 'ul, ol'}
-      ],
-
-      //editor css values for visual feedback
-      editorStyles: [
-        {'name': '.hidden-note',
-         'css': 'color: #999; border: 2px solid #ccc;'},
-        {'name': '.border', 'css': 'border: 4px solid #ccc;'},
-        {'name': '.date',
-         'css': 'background-color: #ff9; border: 2px solid #ee9;'},
-        {'name': '.important',
-         'css': 'color: red; font-weight: bold; border: 2px solid red;'},
-        {'name': '.special',
-         'css': 'background-color: #fc9; border: 2px solid red;'}
-      ],
-
-      //dialogs css values
-      dialogStyles: [
-        {'name': '.hidden-note',
-         'css': 'display: none;'},
-        {'name': '.border', 'css': 'border: 1px solid #ccc;'},
-        {'name': '.date',
-         'css': 'color: #ccf;'},
-        {'name': '.important',
-         'css': 'color: red; font-weight: bold;'},
-        {'name': '.special',
-         'css': 'color: green;'}
-      ],
-
-      //function called when WYMeditor instance is ready
-      //wym is the WYMeditor instance
-      postInit: function(wym) {
-
-        //set the status bar value
-        wym.status('&nbsp;');
-
-        //activate 'tidy' plugin
-        //which cleans up the HTML
-
-		/* bei bedarf aktivieren
-		var wymtidy = wym.tidy({
-
-          sUrl:          "&lt;?=$REX['HTDOCS_PATH']?&gt;files/wymeditor/plugins/tidy/tidy.php",
-          sButtonHtml:   "&lt;li class='wym_tools_tidy'&gt;"
-                       + "&lt;a name='CleanUp' href='#'"
-                       + " style='background-image:"
-                       + " url(&lt;?=$REX['HTDOCS_PATH']?&gt;files/wymeditor/plugins/tidy/wand.png)'&gt;"
-                       + "Clean up HTML"
-                       + "&lt;\/a&gt;&lt;\/li&gt;"
-        });
-        wymtidy.init();
-		*/
-
-        //activate 'hovertools' plugin
-        //which gives more feedback to the user
-        wym.hovertools();
-
-      },
-
-      //function called when dialog is ready
-      //wym is the WYMeditor instance
-      //wdw is the dialog's window
-      postInitDialog: function(wym,wdw) {
-
-        var body = wdw.document.body;
-
-        //add a select box populated with predefined values to the dialog
-
-        var sSelectLink = "&lt;div class='row row-indent'&gt;"
-        + "&lt;select class='wym_select_link'&gt;"
-        + "&lt;option selected value='REDAXO http://www.redaxo.de/'&gt;"
-        + "REDAXO&lt;\/option&gt;"
-        + "&lt;option value='PHP http://www.php.net/'&gt;"
-        + "PHP&lt;\/option&gt;"
-        + "&lt;option value='GNU http://www.mysql.de/'&gt;"
-        + "MySQL&lt;\/option&gt;"
-        + "&lt;\/select&gt;"
-        + "&lt;input class='wym_choose' type='button'"
-        + " value='{Choose}' /&gt;"
-        + "&lt;\/div&gt;";
-
-        $j(body)
-          .filter('.wym_dialog_link').find('fieldset').eq(0)
-          .prepend(wym.replaceStrings(sSelectLink));
-
-        $j(body)
-          .find('.wym_choose')
-          .click(function() {
-
-            var sVal = $j(body).find('.wym_select_link').val();
-
-            $j(body)
-              .find('.wym_href')
-              .val(sVal.substring(sVal.lastIndexOf(' ') + 1));
-            $j(body)
-              .find('.wym_title')
-              .val(sVal.substr(0, sVal.lastIndexOf(' ')));
-          });
-      }
-    });
-
-    $j('.wymsubmit').click(function() {
-      alert($j(this).siblings('.wymeditor').val());
-    });
-});
-&lt;/script&gt;
-
-&lt;strong&gt;Fliesstext:&lt;/strong&gt;:&lt;br /&gt;&lt;br /&gt;
-&lt;textarea name="VALUE[1]" class="wymeditor"&gt;REX_HTML_VALUE[1]&lt;/textarea&gt;
-&lt;br /&gt;&lt;br /&gt;
-
-
-&lt;strong&gt;Artikelfoto:&lt;/strong&gt;:&lt;br /&gt;
-REX_MEDIA_BUTTON[1]
-&lt;?
-if ("REX_FILE[1]" != "") {
-    echo "&lt;br/&gt;&lt;strong&gt;Vorschau&lt;/strong&gt;:&lt;br/&gt;";
-	echo "&lt;img src=".$REX[HTDOCS_PATH]."/files/REX_FILE[1]&gt;&lt;br /&gt;";
-}
-?&gt;
-
-&lt;br/&gt;
-&lt;strong&gt;Title des Fotos:&lt;/strong&gt;:&lt;br /&gt;
-&lt;input type="text" name="VALUE[2]" value="REX_VALUE[2]" size="80" class="inp100" /&gt;
-&lt;br /&gt;&lt;br /&gt;
-
-&lt;strong&gt;Bildunterschrift:&lt;/strong&gt;:&lt;br /&gt;
-&lt;input type="text" name="VALUE[3]" value="REX_VALUE[3]" size="80" class="inp100" /&gt;
-&lt;br /&gt;&lt;br /&gt;
-
-&lt;strong&gt;Ausrichtung des Artikelfotos&lt;/strong&gt;:&lt;br /&gt;
-&lt;select name="VALUE[9]" class="inp100"&gt;
-	&lt;option value='l' &lt;? if ("REX_VALUE[9]" == 'l') echo 'selected'; ?&gt;&gt;links vom Text&lt;/option&gt;
-	&lt;option value='r' &lt;? if ("REX_VALUE[9]" == 'r') echo 'selected'; ?&gt;&gt;rechts vom Text&lt;/option&gt;
-&lt;/select&gt;&lt;br /&gt;
-&lt;br /&gt;
-</pre>
-
-<h2>Modulausgabe (Alle)</h2>
-<pre>
-&lt;?
-// Ausrichtung des Bildes
-if ("REX_VALUE[9]" == "l") $float = "flLeft";
-if ("REX_VALUE[9]" == "r") $float = "flRight";
-
-// Wenn Bild eingefuegt wurde, Code schreiben
-$file = "";
-if ("REX_FILE[1]" != "") $file = '&lt;div class="image '.$float.'"&gt;&lt;img src="'.$REX['HTDOCS_PATH'].'files/REX_FILE[1]" title="'."REX_VALUE[2]".'" alt="'."REX_VALUE[2]".'" /&gt;&lt;p&gt;'."REX_VALUE[3]".'&lt;/p&gt;&lt;/div&gt;';
-
-
-// Fliesstext
-$input = "";
-$input =&lt;&lt;&lt; EOT
-REX_HTML_VALUE[1]
-EOT;
-
-print $file.$input;
-
-?&gt;
-</pre>
-
-<p style="margin: 15px;"><a href="http://www.68media.de">68media</a> | <a href="http://www.gn2-netwerk.de">GN2-Netwerk</a> | <a href="http://www.blumbeet.com">blumbeet web.studio</a><br /><a href="http://www.jquery.com">jQuery</a> | <a href="http://www.wymeditor.org">WYMeditor</a></p>
-</td>
-  </tr>
-</tbody>
-</table>
-
-<?php
-
-}
-
 include $REX['INCLUDE_PATH']."/layout/bottom.php";
 //ob_end_flush();

File templates/template.mapsmodule1.inc.php

+<?php
+
+//Google Maps API Key
+$key = "";
+
+WV15_Map::setApiKey($key);
+
+$map = new WV15_Map('52.120917', '11.628023', '5');
+$map->setWidth('263px');
+$map->setHeight('320px');
+
+$map->getControls()->largeMapControl3D = true;
+$map->getMapTypes()->selectedMapType = WV15_MapTypes::PHYSICAL;
+$map->getMapTypes()->normal = false;
+$map->getMapTypes()->physical = true;
+
+$marker = new WV15_Marker();
+$marker->setCoords('52.120917', '11.628023');
+$marker->setInfoWindowHTML('<strong>Unser tolles Büro</strong><br />webvariants GbR - Breiter Weg 232a<br />39104 Magdeburg');
+$marker->setInfoWindowAnchor(3, 6);
+$map->addMarker($marker);
+
+$map->printMap();
+
+?>

File templates/template.wymmodule1.inc.php

-<?php
-
-WV14_WYMEditor::getSimpleEditor()->embedd();
-
-?>
-<strong>Fliesstext:</strong>:<br /><br />
-<textarea name="VALUE[1]" class="wymeditor">REX_HTML_VALUE[1]</textarea>
-<br /><br />

File templates/template.wymmodule2.inc.php

-<?
-
-if ("REX_IS_VALUE[1]") {
-	
-// Diese 3 Zeilen dürfen keine führenden Leerzeichen besitzen!
-$content =<<< WEBVARIANTS_TEXT
-REX_HTML_VALUE[1]
-WEBVARIANTS_TEXT;
-	
-	print $content;
-}
-
-?>

File uninstall.inc.php

  * http://de.wikipedia.org/wiki/MIT-Lizenz 
  */
 
-$REX['ADDON']['install']['gmapper'] = 0;
+$REX['ADDON']['install']['wvmaps'] = 0;
 
 ?>