From 5d0e21fb5e0f8f0843b91763d7fb5be940b9f417 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Fri, 12 Oct 2018 15:08:20 -0400 Subject: [PATCH] HOR-4903 --- workflow/engine/src/ProcessMaker/Core/System.php | 4 +++- .../engine/src/ProcessMaker/Services/Api/Light.php | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/Core/System.php b/workflow/engine/src/ProcessMaker/Core/System.php index 890264c0c..1a5f7aea3 100644 --- a/workflow/engine/src/ProcessMaker/Core/System.php +++ b/workflow/engine/src/ProcessMaker/Core/System.php @@ -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' => '' ); /** diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Light.php b/workflow/engine/src/ProcessMaker/Services/Api/Light.php index ed668f370..914c9dc0b 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Light.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Light.php @@ -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);