Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

+6 -7
View File
@@ -42,11 +42,12 @@ class _Google
/**
* Render
*
* @param int $width Width
* @param int $heigth Height
* @param int $width Width
* @param int $height Height
* @param float|NULL $zoom The zoom amount (a value between 0 being totally zoomed out view of the world, and 1 being as fully zoomed in as possible) or NULL to zoom automatically based on how much data is available
* @return string
*/
public function render( $width, $height, $zoom=5 )
public function render( $width, $height, $zoom=NULL )
{
if ( $this->geolocation->lat and $this->geolocation->long )
{
@@ -54,13 +55,11 @@ class _Google
}
else
{
$zoom = 1;
$location = array();
foreach ( array( 'country', 'region', 'city', 'addressLines' ) as $k )
{
if ( $this->geolocation->$k )
{
$zoom++;
if ( is_array( $this->geolocation->$k ) )
{
foreach ( array_reverse( $this->geolocation->$k ) as $v )
@@ -78,10 +77,10 @@ class _Google
}
$linkUrl = \IPS\Http\Url::external( '//maps.google.com/' )->setQueryString( 'q', $location );
$imageUrl = \IPS\Http\Url::external( '//maps.googleapis.com/maps/api/staticmap' )->setQueryString( array(
'center' => $location,
'zoom' => $zoom,
'zoom' => $zoom === NULL ? NULL : ceil( $zoom * 8 ),
'size' => "{$width}x{$height}",
'sensor' => 'false',
'markers' => $location