]> git.nbdom.net Git - nb.git/commitdiff
/opt/nb/lib/php/maps.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 7 Jan 2018 04:52:51 +0000 (04:52 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 7 Jan 2018 04:52:51 +0000 (04:52 +0000)
lib/php/maps.php

index 1d1871e557e580e6b2b00ae6be0b62da1b2985a2..764a6f4ac011f3dbeda62a51cc2e9b8f43218dec 100644 (file)
@@ -4,10 +4,11 @@ class Maps {
        public static function img($longitude,$latitude,$o=[]) {
                if (empty($o['width'])) $o['width'] = 72;
                if (empty($o['height'])) $o['height'] = 36;
+               if (empty($o['zoom'])) $o['zoom'] = 10;
                $o['sensor'] = empty($o['sensor']) ? 'false' : 'true';
 
                return 'http://maps.google.com/maps/api/staticmap?center='.$longitude.','.$latitude
-                       .'&zoom=10'
+                       .( empty($o['zoom']) ? '' : '&zoom='.$o['zoom'])
                        .'&size='.$o['width'].'x'.$o['height']
                        .'&sensor='.$o['sensor']
                ;