修改google地图为异步加载

This commit is contained in:
Li Jianxuan 2014-06-11 02:23:27 +00:00
parent 531e8d9cfb
commit a3adea3a35
1 changed files with 9 additions and 2 deletions

View File

@ -7,7 +7,7 @@
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('查看元数据');
$this->breadcrumb()->setSeparator(' > ');
$this->theme->AppendPlus($this,'google_map_v3');
//$this->theme->AppendPlus($this,'google_map_v3');
$this->theme->AppendPlus($this,'colorbox');
if(!empty($this->dataService)) {
$this->theme->AppendModel($this,"dataservice");
@ -497,8 +497,15 @@ endforeach;
</div>
<script src="/js/metadata-view.js"></script>
<script type="text/javascript" charset="utf-8">
function loadScript() {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=initialize";
document.body.appendChild(script);
}
window.onload = loadScript;
$(function() {
google.maps.event.addDomListener(window, 'load', initialize);
//google.maps.event.addDomListener(window, 'load', initialize);
$(".colorbox").colorbox({photo:"true"});
$('.googlesearch').click(function(){googleSearch('<?php echo $ev;?>');});
$('.bingsearch').click(function(){bingSearch('<?php echo $ev;?>');});