);
$config = CRM_Core_Config::singleton();
- if ($config->mapAPIKey && $config->mapProvider) {
+ //CRM-16552: mapAPIKey is not mandatory as google no longer requires an API Key
+ if ($config->mapProvider && ($config->mapAPIKey || $config->mapProvider == 'Google')) {
self::$_links[CRM_Core_Action::MAP] = array(
'name' => ts('Map'),
'url' => 'civicrm/contact/map',
);
$config = CRM_Core_Config::singleton();
- if ($config->mapAPIKey && $config->mapProvider) {
+ //CRM-16552: mapAPIKey is not mandatory as google no longer requires an API Key
+ if ($config->mapProvider && ($config->mapAPIKey || $config->mapProvider == 'Google')) {
self::$_links[CRM_Core_Action::MAP] = array(
'name' => ts('Map'),
'url' => 'civicrm/contact/map',
{/if}
{assign var=defaultZoom value=16}
{literal}
-<script src="//maps.googleapis.com/maps/api/js?{/literal}{if $mapKey}key={$mapKey}{/if}{literal}&sensor=false" type="text/javascript"></script>
+<script src="//maps.googleapis.com/maps/api/js?{/literal}{if $mapKey}key={$mapKey}{/if}{literal}&sensor=false&callback=initMap" type="text/javascript"></script>
<script type="text/javascript">
function initMap() {
var latlng = new google.maps.LatLng({/literal}{$center.lat},{$center.lng}{literal});
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=780,height=640,left = 202,top = 100');");
}
-
- if (window.addEventListener) {
- window.addEventListener("load", initMap, false);
- } else if (window.attachEvent) {
- document.attachEvent("onreadystatechange", initMap);
- }
</script>
{/literal}
<div id="google_map" style="width: {$width}; height: {$height}"></div>