切换至天地图

This commit is contained in:
wlx 2014-12-15 03:30:37 +00:00
parent 37bbaa4b7a
commit 3b6e7a022d
1 changed files with 64 additions and 27 deletions

View File

@ -3,26 +3,30 @@
$this->headTitle($this->config->title->data);
$this->headTitle($this->metadata->title);
$this->headTitle()->setSeparator(' - ');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('<a href="/heihe/">'.$this->config->title->heihe.'</a>');
$this->breadcrumb('查看元数据');
$this->breadcrumb()->setSeparator(' > ');
$this->headLink()->appendStylesheet('/css/water.css');
$this->theme->AppendPlus($this,'google_map_v3');
$this->theme->AppendPlus($this,'tianditu');
$this->theme->AppendPlus($this,'colorbox');
if(!empty($this->dataService)) {
$this->theme->AppendModel($this,"dataservice");
}
$this->nav[] = array('link'=>"/glacier/",'title'=>$this->config->title->glacier);
$this->nav[] = array('link'=>"",'title'=>'查看元数据');
?>
<?= $this->render('breadcrumbs.phtml') ?>
<style>
h3.gs_rt{font-size:110%;}
#file-list li:hover {background-color: #f5f5f5;}
#file-list li li:hover {background-color: #dedede;}
#file-list li li li:hover {background-color: #eeeeee;}
#watermap img {max-width:none;}
</style>
<?= $this->render('breadcrumbs.phtml'); ?>
<?php $md=$this->metadata;if ($md):?>
<div class="row">
<div class="span2">
<?= $this->partial('glacier/navi.phtml'); ?>
<?= $this->partial('heihe/navi.phtml'); ?>
</div>
<div class="span10">
<h3><?php echo $this->escape($md->title);
@ -39,7 +43,7 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
</p>
</div>
<div>
<?php if ($this->mcitation) : ?>
<?php if ($this->mcitation && (count($this->mcitation)>1)) : ?>
<hr />
<h4><i class="icon-eye-open text-success"></i>本数据要求的多篇文献引用</h4>
<ol>
@ -53,7 +57,9 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
</ol>
<?php else: ?>
<?php if ($md->citation) : ?>
<?php if (($md->citation) || (count($this->mcitation)==1)) :
if (!$md->citation) $md->citation=$this->mcitation[0]->reference;
?>
<hr />
<h4><i class="icon-quote-left muted"></i>本数据引用方式<a class="btn btn-danger pull-right" href="/archives/help/platform/archive-23.html" ><i class="icon-comment"></i>数据引用帮助</a></h4>
<p><?php if (empty($md->datadoi) || !strpos($md->citation,$md->datadoi)) : ?><span class="label label-info">文章的引用</span>
@ -155,7 +161,7 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
<?php if(!empty($this->fund)) : ?>
<ul>
<?php foreach($this->fund as $k=>$v) : ?>
<li><?= $v['fund_type'] ?><a href="/data/fund/id/<?= $v['id'] ?>"><?= $v['title'] ?></a>(项目编号:<?= $v['fund_id']?>) [<?= $v['fund_type_en'] ?>(No. <?= $v['fund_id']?>)]</li>
<li><?= $v['fund_type'] ?><a href="/heihe/fund/id/<?= $v['id'] ?>"><?= $v['title'] ?></a>(项目编号:<?= $v['fund_id']?>) [<?= $v['fund_type_en'] ?>(No. <?= $v['fund_id']?>)]</li>
<?php endforeach; ?>
</ul>
<?php elseif(!empty($md->suppinfo)) : ?>
@ -191,14 +197,14 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
?>
<div class="tabbable"> <!-- Only required for left/right tabs -->
<ul class="nav nav-tabs">
<li class="active"><a href="#related" data-toggle="tab" id="related_t">相关数据</a></li>
<li><a href="#related" data-toggle="tab" id="related_t">相关数据</a></li>
<li><a href="#literature" data-toggle="tab" id="literature_t">相关文献</a></li>
<li><a href="#gsearch" data-toggle="tab" id="gsearch_t">相关搜索</a></li>
<li><a href="#service" data-toggle="tab">服务记录</a></li>
<li><a href="#recommend" data-toggle="tab" id="recommend_t">给我推荐</a></li>
</ul>
<div class="tab-content">
<div id="related" class="tab-pane active">
<div id="related" class="tab-pane">
</div>
<div id="literature" class="tab-pane">
<div class="">
@ -326,10 +332,10 @@ foreach($this->keys as $cg) :
if ($i==0) {
?>
<ul class="well well-small inline unstyled">
<li><a href="/glaicer/tag/keytype/<?php echo $kt; ?>"><i class="icon-tags text-warning"></i><?php echo $kw[$kt]; ?></a></li>
<li><a href="/data/tag/keytype/<?php echo $kt; ?>"><i class="icon-tags text-warning"></i><?php echo $kw[$kt]; ?></a></li>
<?
}
echo '<li><a href="/glaicer/tag/key/'.urlencode($cg['keyword']).'"><i class="icon-tag"></i>'.$cg['keyword'].'</a></li>';
echo '<li><a href="/data/tag/key/'.urlencode($cg['keyword']).'"><i class="icon-tag"></i>'.$cg['keyword'].'</a></li>';
endforeach;
?></ul>
<?php if ($md->doi) : ?>
@ -482,7 +488,7 @@ endforeach;
<script src="/js/metadata-view.js"></script>
<script type="text/javascript" charset="utf-8">
$(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;?>');});
@ -531,20 +537,51 @@ function ajaxpage(page){
ajaxpage_get(page,'<?= $md->uuid; ?>');
}
var map = null;
var mapElementID = "watermap";
var bounds = null;
var rectangle = null;
var zoomlevel = 1;
var bound = {
lat:<?= ($md->south+$md->north)/2; ?>,
lng:<?= ($md->east+$md->west)/2; ?>,
zoom:<?php if ($md->north==$md->south) { ?> 10 <?php }else {?> 16 <?php }?>,
east:<?= $md->east; ?>,
west:<?= $md->west; ?>,
south:<?= $md->south; ?>,
north:<?= $md->north; ?>
}
<?php if ($this->downhistory) : ?>
$('#recommend_t').parent('li').addClass('active');
$('#recommend').addClass('active');
recommend(0);
<?php else : ?>
$('#related_t').parent('li').addClass('active');
$('#related').addClass('active');
<? endif; ?>
var config = { projection: "EPSG:4326"}
var map=new TMap("watermap",config);
var lat=<?= ($md->south+$md->north)/2; ?>;
var lng=<?= ($md->east+$md->west)/2; ?>;
map.centerAndZoom(new TLngLat(lng,lat),12);
map.setMapType(TMAP_HYBRID_MAP);
<?php if ($md->north==$md->south && $md->east==$md->west) :?>
var marker=new TMarker(new TLngLat(lng,lat));
map.addOverLay(marker);
<?php else :?>
var p1=new TLngLat(<?= $md->west ?>,<?= $md->south ?>);
var p2=new TLngLat(<?= $md->west ?>,<?= $md->north ?>);
var p3=new TLngLat(<?= $md->east ?>,<?= $md->north ?>);
var p4=new TLngLat(<?= $md->east ?>,<?= $md->south ?>);
map.setViewport(new Array(p1,p2,p3,p4));
var bounds = new TBounds(<?= $md->west; ?>,<?= $md->south; ?>,<?= $md->east; ?>,<?= $md->north; ?>);
var config = {
strokeColor:"blue", //折线颜色
fillColor:"#FFFFFF", //填充颜色。当参数为空时,折线覆盖物将没有填充效果
strokeWeight:"3px", //折线的宽度,以像素为单位
opacity:0.4, //折线的透明度取值范围0 - 1
strokeStyle:"dashed" //折线的样式solid或dashed
};
var rect = new TRect(bounds,config);
map.addOverLay(rect);
//map.zoomOut();
<?php endif; ?>
var config = {
type:"TMAP_NAVIGATION_CONTROL_SMALL", //缩放平移的显示类型
anchor:"TMAP_ANCHOR_TOP_LEFT", //缩放平移控件显示的位置
offset:[0,0], //缩放平移控件的偏移值 showZoomInfo:true //是否显示级别提示信息true表示显示false表示隐藏。
};
//创建缩放平移控件对象
control=new TNavigationControl(config);
//添加缩放平移控件
map.addControl(control);
</script>
<?php else: ?>
<p>Cannot find the metadata.</p>