library/Haste/Maps/GoogleMap.php
public static function addAssets($strBuffer)
    {
        if (!class_exists('\delahaye\googlemaps\Googlemap') || \Config::get('loadGoogleMapsAssetsOnDemand')) {
            return $strBuffer;
        }

        \delahaye\googlemaps\Googlemap::CssInjection();

        if (!isset($GLOBALS['TL_JAVASCRIPT']['googlemaps'])) {

            $strUrl = '//maps.google.com/maps/api/js';
            $strUrl = Url::addQueryString('language=' . $GLOBALS['TL_LANGUAGE'], $strUrl);

            global $objPage;

            if (($objRootPage = \PageModel::findPublishedById($objPage->rootId)) !== null && $objRootPage->dlh_googlemaps_apikey) {
                $strUrl = Url::addQueryString('key=' . $objRootPage->dlh_googlemaps_apikey, $strUrl);
            }

            $GLOBALS['TL_JAVASCRIPT']['googlemaps']            = $strUrl;

        }

        if (!isset($GLOBALS['TL_JAVASCRIPT']['googlemaps_clustering'])) {
            $GLOBALS['TL_JAVASCRIPT']['googlemaps_clustering'] = 'system/modules/haste_plus/assets/js/vendor/marker-clustering/markerclusterer.min.js|static';
        }

        return $strBuffer;
    }
public static function addAssets($strBuffer)
    {
        if (!class_exists('\delahaye\googlemaps\Googlemap') || \Config::get('loadGoogleMapsAssetsOnDemand')) {
            return $strBuffer;
        }

        \delahaye\googlemaps\Googlemap::CssInjection();

        if (!isset($GLOBALS['TL_JAVASCRIPT']['googlemaps'])) {

            $strUrl = '//maps.google.com/maps/api/js';
            $strUrl = Url::addQueryString('language=' . $GLOBALS['TL_LANGUAGE'], $strUrl);

            global $objPage;

            if (($objRootPage = \PageModel::findPublishedById($objPage->rootId)) !== null && $objRootPage->dlh_googlemaps_apikey) {
                $strUrl = Url::addQueryString('key=' . $objRootPage->dlh_googlemaps_apikey, $strUrl);
            }

            $GLOBALS['TL_JAVASCRIPT']['googlemaps']            = $strUrl;

        }

        if (!isset($GLOBALS['TL_JAVASCRIPT']['googlemaps_clustering'])) {
            $GLOBALS['TL_JAVASCRIPT']['googlemaps_clustering'] = 'system/modules/haste_plus/assets/js/vendor/marker-clustering/markerclusterer.min.js|static';
        }

        return $strBuffer;
    }
public static function addAssets ( $ strBuffer ) { if ( ! class_exists ( '\delahaye\googlemaps\Googlemap' ) || \ Config :: get ( 'loadGoogleMapsAssetsOnDemand' ) ) { return $ strBuffer ; } \ delahaye \ googlemaps \ Googlemap :: CssInjection ( ) ; if ( ! isset ( $ GLOBALS [ 'TL_JAVASCRIPT' ] [ 'googlemaps' ] ) ) { $ strUrl = '//maps.google.com/maps/api/js' ; $ strUrl = Url :: addQueryString ( 'language=' . $ GLOBALS [ 'TL_LANGUAGE' ] , $ strUrl ) ; global $ objPage ; if ( ( $ objRootPage = \ PageModel :: findPublishedById ( $ objPage -> rootId ) ) !== null && $ objRootPage -> dlh_googlemaps_apikey ) { $ strUrl = Url :: addQueryString ( 'key=' . $ objRootPage -> dlh_googlemaps_apikey , $ strUrl ) ; } $ GLOBALS [ 'TL_JAVASCRIPT' ] [ 'googlemaps' ] = $ strUrl ; } if ( ! isset ( $ GLOBALS [ 'TL_JAVASCRIPT' ] [ 'googlemaps_clustering' ] ) ) { $ GLOBALS [ 'TL_JAVASCRIPT' ] [ 'googlemaps_clustering' ] = 'system/modules/haste_plus/assets/js/vendor/marker-clustering/markerclusterer.min.js|static' ; } return $ strBuffer ; }
Add google maps assets

@param string $strBuffer Current frontend template buffer (replaceDynamicScriptTags HOOK)
@return string $strBuffer Modified frontend template buffer (replaceDynamicScriptTags HOOK)
Add google maps assets