Merged in bugfix/HOR-4903 (pull request #6653)

HOR-4903

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Roly
2018-10-12 19:16:17 +00:00
committed by Julio Cesar Laura Avendaño
2 changed files with 15 additions and 1 deletions

View File

@@ -64,7 +64,9 @@ class System
'logs_max_files' => 60,
'logs_location' => '',
'logging_level' => 'INFO',
'smtp_timeout' => 20
'smtp_timeout' => 20,
'google_map_api_key' => '',
'google_map_signature' => ''
);
/**

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\Services\Api;
use Bootstrap;
use G;
use ProcessMaker\Project\Adapter;
use ProcessMaker\Services\Api;
@@ -1273,6 +1274,17 @@ class Light extends Api
$oMobile = new BusinessModelLight();
$url = "http://maps.googleapis.com/maps/api/staticmap?center=" . $latitude . ',' . $longitude . "&format=jpg&size=600x600&zoom=15&markers=color:blue%7Clabel:S%7C" . $latitude . ',' . $longitude;
$config = Bootstrap::getSystemConfiguration();
$googleMapApiKey = $config['google_map_api_key'];
$googleMapSignature = $config['google_map_signature'];
if(!empty($googleMapApiKey)){
$url .= "&key=" . $googleMapApiKey;
}
if(!empty($googleMapSignature)){
$url .= "&signature=" . $googleMapSignature;
}
$imageLocation = imagecreatefromjpeg($url);
$tmpfname = tempnam(sys_get_temp_dir(), "pmm");
imagejpeg($imageLocation, $tmpfname);