From ea66f0e265a08d6f74d8b51a3accebf1e8ec5691 Mon Sep 17 00:00:00 2001
From: Michael <michael.danielczok@gmail.com>
Date: Fri, 13 Nov 2015 16:11:04 +0100
Subject: [PATCH] Google Maps verbessert

---
 bricks.xml                                    | 4 ++++
 lib/QUI/Bricks/Controls/SimpleGoogleMaps.css  | 1 +
 lib/QUI/Bricks/Controls/SimpleGoogleMaps.html | 2 +-
 lib/QUI/Bricks/Controls/SimpleGoogleMaps.php  | 5 +++--
 locale.xml                                    | 4 ++++
 5 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/bricks.xml b/bricks.xml
index 0278bd2..766b331 100644
--- a/bricks.xml
+++ b/bricks.xml
@@ -182,6 +182,10 @@
                 <setting name="city">
                     <locale group="quiqqer/bricks" var="brick.control.simplegooglemaps.settings.city"/>
                 </setting>
+                <setting name="zoom" type="number">
+                    <locale group="quiqqer/bricks" var="brick.control.simplegooglemaps.settings.zoom"/>
+                </setting>
+
                 <setting name="api">
                     <locale group="quiqqer/bricks" var="brick.control.simplegooglemaps.settings.api"/>
                 </setting>
diff --git a/lib/QUI/Bricks/Controls/SimpleGoogleMaps.css b/lib/QUI/Bricks/Controls/SimpleGoogleMaps.css
index 79f9cf0..fe7229d 100644
--- a/lib/QUI/Bricks/Controls/SimpleGoogleMaps.css
+++ b/lib/QUI/Bricks/Controls/SimpleGoogleMaps.css
@@ -1,6 +1,7 @@
 #SimpleGoogleMaps {
     background: none;
     border: none;
+    display: block;
     height: 300px;
     width: 100%;
 }
\ No newline at end of file
diff --git a/lib/QUI/Bricks/Controls/SimpleGoogleMaps.html b/lib/QUI/Bricks/Controls/SimpleGoogleMaps.html
index 3753f42..50c13b5 100644
--- a/lib/QUI/Bricks/Controls/SimpleGoogleMaps.html
+++ b/lib/QUI/Bricks/Controls/SimpleGoogleMaps.html
@@ -1 +1 @@
-<iframe id="SimpleGoogleMaps" src="{$url}"></iframe>
+<iframe id="SimpleGoogleMaps" src="{$url}"></iframe>
\ No newline at end of file
diff --git a/lib/QUI/Bricks/Controls/SimpleGoogleMaps.php b/lib/QUI/Bricks/Controls/SimpleGoogleMaps.php
index 9b168d6..82eab0c 100644
--- a/lib/QUI/Bricks/Controls/SimpleGoogleMaps.php
+++ b/lib/QUI/Bricks/Controls/SimpleGoogleMaps.php
@@ -46,16 +46,17 @@ public function getBody()
         $brickStreet = $this->getAttribute('street');
         $brickZip    = $this->getAttribute('zip');
         $brickCity   = $this->getAttribute('city');
+        $zoom        = $this->getAttribute('zoom');
 
         $query = http_build_query(array(
             'key' => trim($this->getAttribute('api')),
             'q'   => "{$brickTitle},{$brickZip},{$brickStreet},{$brickCity}"
         ));
 
-        $url = 'https://www.google.com/maps/embed/v1/place?' . $query;
+        $url = 'https://www.google.com/maps/embed/v1/place?' . $query . "&zoom=" . $zoom . "&";
 
         $Engine->assign(array(
-            'url' => $url
+            'url'  => $url
         ));
 
         return $Engine->fetch(dirname(__FILE__) . '/SimpleGoogleMaps.html');
diff --git a/locale.xml b/locale.xml
index d67398b..9e4802e 100644
--- a/locale.xml
+++ b/locale.xml
@@ -490,6 +490,10 @@ M&ouml;chten Sie die Bausteine aus der Bausteinzone entfernen?</p>]]></de>
             <de><![CDATA[Stadt]]></de>
             <en><![CDATA[City]]></en>
         </locale>
+        <locale name="brick.control.simplegooglemaps.settings.zoom">
+            <de><![CDATA[Zoom]]></de>
+            <en><![CDATA[Zoom]]></en>
+        </locale>
         <locale name="brick.control.simplegooglemaps.settings.api">
             <de><![CDATA[API Key]]></de>
             <en><![CDATA[API Key]]></en>
-- 
GitLab