CRM-17402: Defer loading Google Maps API
authorFrancis Whittle <francis@agileware.com.au>
Thu, 15 Oct 2015 00:00:32 +0000 (11:00 +1100)
committermonishdeb <monish.deb@webaccessglobal.com>
Wed, 21 Oct 2015 05:29:13 +0000 (10:59 +0530)
----------------------------------------
* CRM-17402: Google Maps API sometimes tries to call initMap callback before it is defined.
  https://issues.civicrm.org/jira/browse/CRM-17402

templates/CRM/Contact/Form/Task/Map/Google.tpl

index 97aa882491cc4032473d71c5ba694cad875e1503..d0322458a9f82accf4a320f1bb01e095e8b1ea90 100644 (file)
@@ -32,7 +32,7 @@
 {/if}
 {assign var=defaultZoom value=16}
 {literal}
-<script src="//maps.googleapis.com/maps/api/js?{/literal}{if $mapKey}key={$mapKey}{/if}{literal}&sensor=false&callback=initMap" 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" defer="defer"></script>
 <script type="text/javascript">
     function initMap() {
         var latlng = new google.maps.LatLng({/literal}{$center.lat},{$center.lng}{literal});