Index: /changelog
===================================================================
--- /changelog	(revision 8091)
+++ /changelog	(revision 8092)
@@ -506,4 +506,5 @@
 - Bugfix: WPML Korrkte Preise in Ãbersetzung in zusammenspiel mit Produktartikeln
 - Bugfix: Keine Rechnungsmail wenn Rechnung automatisch ersellt wird und Option "Mail an BestellbestÃ€tigung anhÃ€ngen" aktiviert ist / #784
+- Bugfix: Statistik: API Key fÃŒr Adressdecodierung hinterlegt / Kundenkarte
 - Feature: Neue Platzhalter fÃŒr Liefer- und Rechnungsadresse 
 - Feature: Staffelpreise kÃ¶nnen jetzt angewendet werden wenn im Backend ein Produkt hinzugefÃŒgt wird #776
Index: /lib/functions.inc.php
===================================================================
--- /lib/functions.inc.php	(revision 8091)
+++ /lib/functions.inc.php	(revision 8092)
@@ -614,7 +614,12 @@
 								
 				break;
+
+			case WPSG_SANITIZE_URL:
+				
+				if (sanitize_url($val) == trim($val)) $bReturn = true; 
+				
+				break;
 				
 			case WPSG_SANITIZE_PATH:
-			case WPSG_SANITIZE_URL:
 			case WPSG_SANITIZE_DOMAIN:
 			case WPSG_SANITIZE_ARRAY_LANG:
Index: /mods/mod_statistics/wpsg_customerMap.class.php
===================================================================
--- /mods/mod_statistics/wpsg_customerMap.class.php	(revision 8091)
+++ /mods/mod_statistics/wpsg_customerMap.class.php	(revision 8092)
@@ -15,15 +15,14 @@
 		
 			$string = str_replace (" ", "+", urlencode($string));
-			$details_url = "http://maps.googleapis.com/maps/api/geocode/json?address=".$string."&sensor=false";
+			$details_url = "https://maps.googleapis.com/maps/api/geocode/json?address=".$string."&sensor=false&key=".wpsg_ShopController::getShop()->get_option('wpsg_mod_statistics_googlekey');
 		
 			$result = $this->shop->get_url_post_content($details_url, []);
-			$response = json_decode($result);
+			$response = json_decode($result, true);
 			 		
 			$lat = $response['results'][0]['geometry']['location']['lat'];
 			$long = $response['results'][0]['geometry']['location']['lng'];
-		
-			$array = array(
-					'lat' => $lat,
-					'long' => $long
+					$array = array(
+				'lat' => $lat,
+				'long' => $long
 			);
 		
@@ -43,5 +42,7 @@
 			{
 				
-				if (!wpsg_isSizedString($c['wpsg_mod_statistics_long']) && !wpsg_isSizedString($c['wpsg_mod_statistics_lat']))
+				// if (intval($c['id']) !== 799) continue;
+				
+				if (!wpsg_isSizedString($c['wpsg_mod_statistics_long']) && !wpsg_isSizedString($c['wpsg_mod_statistics_lat']) && $c['wpsg_mod_statistics_long'] !== '-1' &&  $c['wpsg_mod_statistics_lat'] !== '-1') 
 				{
 					 
@@ -94,3 +95,2 @@
 	} // class wpsg_customerMap extends wpsg_statisticabstract
 
-?>
Index: /mods/wpsg_mod_statistics.class.php
===================================================================
--- /mods/wpsg_mod_statistics.class.php	(revision 8091)
+++ /mods/wpsg_mod_statistics.class.php	(revision 8092)
@@ -687,5 +687,5 @@
 		public function settings_save() {
 			
-			$this->shop->update_option('wpsg_mod_statistics_piwik_url', $_REQUEST['wpsg_mod_statistics_piwik_url'], false, false, WPSG_SANITIZE_URL);
+			$this->shop->update_option('wpsg_mod_statistics_piwik_url', $_REQUEST['wpsg_mod_statistics_piwik_url'], false, false, WPSG_SANITIZE_DOMAIN, ['allowEmpty' => true]);
 			
 			$this->shop->update_option('wpsg_mod_statistics_piwik_generel', $_REQUEST['wpsg_mod_statistics_piwik_generel'], false, false, WPSG_SANITIZE_CHECKBOX);
@@ -743,5 +743,5 @@
 			$this->shop->update_option('wpsg_mod_statistics_googlekey', $_REQUEST['wpsg_mod_statistics_googlekey'], false, false, WPSG_SANITIZE_TEXTFIELD);
 			$this->shop->update_option('wpsg_mod_statistics_productinterval', $_REQUEST['wpsg_mod_statistics_productinterval'], false, false, WPSG_SANITIZE_INT);
-				
+				 
 		}
 		
Index: /views/mods/mod_statistics/customermap/all.phtml
===================================================================
--- /views/mods/mod_statistics/customermap/all.phtml	(revision 8091)
+++ /views/mods/mod_statistics/customermap/all.phtml	(revision 8092)
@@ -4,5 +4,5 @@
 	 * Template fï¿œr die Anzeige der Kundenkarte innerhalb des Statistikmoduls
 	 */
-
+ 
 ?> 
 <script type="text/javascript">/* <![CDATA[ */
@@ -21,5 +21,9 @@
     	var markers = [];
     	
-    	<?php $i = 1; foreach ($this->view['wpsg_mod_statistics']['marker'] as $m) { ?>
+    	<?php $i = 1; foreach ($this->view['wpsg_mod_statistics']['marker'] as $m) { 
+            
+            if (floatval($m['lat']) === 0.0 || floatval($m['long']) === 0.0) continue;
+            
+            ?>
     	var marker<?php echo $i; ?> = new google.maps.Marker({
 			position: new google.maps.LatLng(<?php echo $m['lat']; ?>, <?php echo $m['long']; ?>),
@@ -31,5 +35,5 @@
 			location.href = '<?php
 			
-				echo wpsg_admin_url('Customer', 'edit', ['edit_id' => $m['customer']['id']]);
+				echo wpsg_admin_url('Customer', 'edit', ['edit_id' => $m['customer']['id']], [], true);
 				
 			?>';
@@ -53,5 +57,5 @@
 <div style="" id="wpsg_mod_customermap_layer">
 	<div class="postbox" id="wpsg_modcustomermap">
-		<div style="height:500px;">
+		<div style="height:500px; width:500px;">
 			<div style="width:100%; height:100%" id="wpsg_mod_statistics_map"></div>	
 		</div>
