westdc-zf1/application/default/views/scripts/water/timemap.phtml

74 lines
3.2 KiB
PHTML
Raw Normal View History

2010-06-23 15:13:26 +00:00
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$this->headTitle('时空导航');
$this->headTitle()->setSeparator(' - ');
2010-07-02 08:23:38 +00:00
$this->headLink()->appendStylesheet('/css/water.css');
2010-06-23 15:13:26 +00:00
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
2010-06-29 03:41:06 +00:00
$this->breadcrumb('<a href="/water/">黑河综合遥感联合试验</a>');
$this->breadcrumb('时空联合导航');
2010-06-23 15:13:26 +00:00
$this->breadcrumb()->setSeparator(' > ');
2011-10-26 09:31:37 +00:00
$this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
2010-06-23 15:13:26 +00:00
$this->headScript()->appendFile('/js/timeline_var.js');
$this->headScript()->appendFile('/js/timeline_js/timeline-api.js');
$this->headScript()->appendFile('/js/timemap/timemap.js');
$this->headScript()->captureStart();
?>
var tm;
window.onload=function() {
tm = TimeMap.init({
mapId: "watermap", // Id of map div element (required)
2010-06-23 15:13:26 +00:00
timelineId: "timeline", // Id of timeline div element (required)
2010-06-29 09:58:59 +00:00
scrollTo: "2008-06-01",
2010-06-23 15:13:26 +00:00
options: {
eventIconPath: "../images/",
mapType:G_SATELLITE_MAP,
2010-06-29 09:55:46 +00:00
mapCenter: new GLatLng(39,100)
2010-06-23 15:13:26 +00:00
},
datasets: [
{
data:{
2010-06-23 15:13:26 +00:00
theme: "orange",
// note that the lines below are now the preferred syntax
type: "basic",
value: [
<?php foreach($this->rows as $row) : ?>
2010-06-23 15:13:26 +00:00
{
"start" : "<?php echo $row['timebegin']; ?>",
<?php if ($row['timeend']!='') : ?>
"end" : "<?php echo $row['timeend']; ?>",
<?php endif; ?>
2010-06-29 05:13:40 +00:00
"point" :
2010-06-23 15:13:26 +00:00
{
2010-06-29 05:13:40 +00:00
"lat" : <?php echo ($row['south']+$row['north'])/2; ?>,
"lon" : <?php echo ($row['west']+$row['east'])/2; ?>
},
"title" : "<?php echo htmlspecialchars(mb_substr($row['title'],11,mb_strlen($row['title'],'UTF-8')-10,'UTF-8')); ?>",
2010-06-23 15:13:26 +00:00
"options" : {
// set the full HTML for the info window
2011-10-26 09:31:37 +00:00
"infoHtml": "<div class='info'><a href=/water/<?php echo $row['uuid']; ?>><?php echo htmlspecialchars(mb_substr($row['title'],11,mb_strlen($row['title'],'UTF-8')-10,'UTF-8')); ?></a><hr /><img src=/service/thumb/id/<?php echo $row['id']; ?> /></div>",
"theme":"orange"
}
2010-06-23 15:13:26 +00:00
},
<?php endforeach; ?>
]
2010-06-23 15:13:26 +00:00
}
}
],
bandIntervals: [
Timeline.DateTime.DAY,
Timeline.DateTime.MONTH
2010-06-23 15:13:26 +00:00
]
});
// manipulate the timemap further here if you like
var map=tm.map;
map.setCenter(new GLatLng(39,100),7);
2010-06-23 15:13:26 +00:00
}
window.onunload=GUnload();
<?php $this->headScript()->captureEnd(); ?>
<div id="timemap" style="clear:both;">
<div id="watermap" style="height:500px;width:40%;float:right;"></div>
<div id="timeline" style="height:500px;border-right:1px solid #abc;"></div>
</div>