Your IP : 216.73.216.240


Current Path : /home/juvelize/www/components/com_zhgooglemap/views/zhgooglemap/tmpl/
Upload File :
Current File : /home/juvelize/www/components/com_zhgooglemap/views/zhgooglemap/tmpl/display_script.php

<?php
/*------------------------------------------------------------------------
# com_zhgooglemap - Zh GoogleMap
# ------------------------------------------------------------------------
# author:    Dmitry Zhuk
# copyright: Copyright (C) 2011 zhuk.cc. All Rights Reserved.
# license:   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
# website:   http://zhuk.cc
# Technical Support Forum: http://forum.zhuk.cc/
-------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');



    $document->addScript($current_custom_js_path.'common-min.js');
    if (isset($use_object_manager) && (int)$use_object_manager == 1)
    {
        $document->addScript($current_custom_js_path.'objectmanager-min.js');
    }

    if (isset($compatiblemode) && (int)$compatiblemode == 1)
    {
        $document->addScript($current_custom_js_path.'compatibility-min.js');
    }
    
    if ($apitype != "")
    {
        if ((int)$apitype == 1)
        {
            $apiURL = 'ditu.google.cn';
        }
        else
        {
            $apiURL = 'maps.googleapis.com';
        }
    }
    else
    {
        $apiURL = 'maps.googleapis.com';
    }

    $mainScriptBegin = $urlProtocol.'://'.$apiURL.'/maps/api/js?';
    
    $mainScriptMiddle = "&callback=Function.prototype";
    $scriptParametersExist = 0;

    if ($apiversion != "")
    {
        $scriptParametersExist = 1;
        if ($mainScriptMiddle == "")
        {
            $mainScriptMiddle = 'v='.$apiversion;
        }
        else
        {
            $mainScriptMiddle .= '&v='.$apiversion;
        }
        
    }

    if ($map_region !="")
    {
        $scriptParametersExist = 1;
        if ($mainScriptMiddle == "")
        {
            $mainScriptMiddle = 'region='.$map_region;
        }
        else
        {
            $mainScriptMiddle .= '&region='.$map_region;
        }        
    }

    if ($apikey4map != "")
    {
        $scriptParametersExist = 1;
        if ($mainScriptMiddle == "")
        {
            $mainScriptMiddle = 'key='.$apikey4map;
        }
        else
        {
            $mainScriptMiddle .= '&key='.$apikey4map;
        }        
        
    }


    $mainScriptBegin .= $mainScriptMiddle;
    

    $mainScriptAdd ="";
    $mainScriptLibrary ="";

    $mainLang = "";

    if (isset($main_lang) && $main_lang != "")
    {
        $mainLang = substr($main_lang,0, strpos($main_lang, '-'));

        if ($mainLang != "")
        {
            $scriptParametersExist = 1;
            $mainScriptAdd .= '&language='.$mainLang;
        }
        
    }
     
    if (isset($places) && (int)$places == 1)
    {
        $scriptParametersExist = 1;
        if ($mainScriptLibrary == "")
        {
            $mainScriptLibrary .= '&libraries=places';
        }
        else
        {
            $mainScriptLibrary .= ',places';
        }
    }



    $mainScriptAdd .= $mainScriptLibrary;
        
        if (isset($load_by_script) && $load_by_script != "")
        {
            $mainScriptAdd .= '&callback='.$load_by_script;
            $document->addScript($mainScriptBegin . $mainScriptAdd, "text/javascript", true, true);
        }
        else
        {
            $document->addScript($mainScriptBegin . $mainScriptAdd);
        }
                
    

    if (isset($markercluster) && (int)$markercluster == 1)
    {
        //new version of MarkerClusterer
        $document->addScript($current_custom_js_path.'markerclusterer/2.0.16/markerclusterer_packed.js');
    }

    if ($markermanager == 1)
    {
        $document->addScript($current_custom_js_path.'markermanager/1.2/markermanager_packed.js');
    }

    
    if ($loadVisualisation == 1)
    {
        
        $document->addScript($urlProtocol.'://www.google.com/jsapi');
        
        if ($loadVisualisationKML == 1)
        {
            //echo "\n".' <script type="text/javascript" src="'.$urlProtocol.'://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js"></script>' ."\n";
            //echo "\n".' <script type="text/javascript" src="'.$urlProtocol.'://geoxml3.googlecode.com/svn/trunk/ProjectedOverlay.js"></script>' ."\n";
            $document->addScript($current_custom_js_path.'geoxml3/polys/geoxml3.js');
            $document->addScript($current_custom_js_path.'geoxml3/trunk/ProjectedOverlay.js');
        }
    }

    

    
    if (isset($infobubble) && (int)$infobubble == 1)
    {
        if ($urlProtocol == "https")
        {
            $document->addScript($current_custom_js_path.'infobubble/trunk/infobubble-compiled_https.js');
        }
        else
        {
            $document->addScript($current_custom_js_path.'infobubble/trunk/infobubble-compiled.js');
        }
    }

    if (isset($featureMarkerWithLabel) && (int)$featureMarkerWithLabel == 1)
    {
        $document->addScript($current_custom_js_path.'markerwithlabel/1.1.9/markerwithlabel_packed.js');
    }