Requirements

Google Maps API Key

Since KReporter 4.0 you need a GoogleMaps API Key to use GoogleMaps API. Generate the key by following instructions at https://developers.google.com/maps/documentation/javascript/ => Button get a key

Once you have it, open config.php file of you CRM Installation, go to the bottom of the page an add following line: $sugar_config['KReports]['googlemapskey'] = "YouGeneratedKey";

Fields containing latitude and longitude values

Let say you want to see your Accounts on a map. Extend accounts table with 2 new fields and populate the values. The way you populate geo coordinates is left to your discretion.

In our example we added custom/Extension/modules/Accounts/Vardefs/kreports_googlemap.php

<?php

$dictionary["Account"]["fields"]['spice_geo_latitude'] = array(

'name' => 'spice_geo_latitude',

'vname' => 'LBL_SPICE_GEO_LATITUDE',

'type' => 'double',

'massupdate' => false

);

$dictionary["Account"]["fields"]['spice_geo_longitude'] = array(

'name' => 'spice_geo_longitude',

'vname' => 'LBL_SPICE_GEO_LONGITUDE',

'type' => 'double',

'massupdate' => false

);

and custom/Extension/modules/Accounts/Language/en_us.lang.php

<?php

$mod_strings['LBL_SPICE_GEO_LATITUDE'] = 'Latitude';

$mod_strings['LBL_SPICE_GEO_LONGITUDE'] = 'Longitude';

Manipulate Tab

In our example we want to pin point accounts by account type.

Fields containing Latitude and Longitude values have to be dragged to manipulate tab.

Type will be used for the legend, name for title and Billing City for popup in Visualization tab.

results matching ""

    No results matching ""