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

110 lines
3.9 KiB
PHTML
Raw Normal View History

2013-04-17 07:40:16 +00:00
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$this->headTitle('时空导航');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/water.css');
$this->theme->AppendPlus($this,'google_map_v3');
$this->theme->AppendPlus($this,'colorbox');
$this->headScript()->appendFile('/js/timeline_var.js');
$this->headScript()->appendFile('/js/timeline_js/timeline-api.js');
$this->headScript()->appendFile('/js/timemap.2.0.1/lib/mxn/mxn.js?(googlev3)');
$this->headScript()->appendFile('/js/timemap.2.0.1/timemap.pack.js');
2013-05-25 03:46:38 +00:00
$this->nav[] = array('link'=>"/hiwater",'title'=>'黑河生态水文遥感试验');
2013-04-17 07:40:16 +00:00
?>
<style>
img{max-width:none}
</style>
2013-05-25 03:46:38 +00:00
<?= $this->render('breadcrumbs.phtml'); ?>
2013-04-17 07:40:16 +00:00
<div class="row">
2013-05-25 03:46:38 +00:00
<div class="span3">
2013-04-17 07:40:16 +00:00
<?= $this->partial('hiwater/navi.phtml'); ?>
</div>
2013-05-25 03:46:38 +00:00
<div class="span9">
2013-05-26 11:23:36 +00:00
<div id="timemap">
<div id="timeline" style="height:500px;border-right:1px solid #abc;width:50%;float:left;"></div>
<div id="map" style="height:500px;"></div>
</div>
2013-04-17 07:40:16 +00:00
</div>
</div>
<script type="text/javascript" charset="utf-8">
$('#map').height($(window).height());
$('#timeline').height($(window).height());
$("html,body").animate({scrollTop:$('#timemap').offset().top},600);
var tm;
$(function() {
// make a custom map style
var styledMapType = new google.maps.StyledMapType([
{
featureType: "water",
elementType: "all",
stylers: [
{ saturation: 0 },
{ lightness: 100 }
]
},
{
featureType: "all",
elementType: "all",
stylers: [
{ saturation: -100 }
]
}
], {
name: "white"
});
tm = TimeMap.init({
mapId: "map", // Id of map div element (required)
2013-05-26 11:23:36 +00:00
timelineId: "timeline", // Id of timeline div element (required)
2013-05-25 03:46:38 +00:00
scrollTo: "2012-05-01",
2013-04-17 07:40:16 +00:00
options: {
eventIconPath: "../images/"
},
datasets: [
{
id: "artists",
title: "Artists",
theme: "orange",
// note that the lines below are now the preferred syntax
type: "basic",
options: {
items: [
<?php
foreach($this->rows as $row) : ?>
{
"start" : "<?php echo $row['timebegin']; ?>",
<?php if ($row['timeend']!='') : ?>
"end" : "<?php echo $row['timeend']; ?>",
<?php endif; ?>
"point" :
{
"lat" : <?php echo ($row['south']+$row['north'])/2; ?>,
"lon" : <?php echo ($row['west']+$row['east'])/2; ?>
},
"title" : "<?php echo htmlspecialchars($row['title']); ?>",
"options" : {
2013-05-26 11:23:36 +00:00
"infoHtml": "<div class='info'><a href=/hiwater/view/uuid/<?php echo $row['uuid']; ?>><?php echo htmlspecialchars($row['title']); ?></a><hr /><img src=/service/thumb/id/<?php echo $row['id']; ?> onclick='$.colorbox({photo:\"true\",href:\"/service/bigthumb/id/<?php echo $row['id']; ?>\"});' /></div>",
2013-04-17 07:40:16 +00:00
"theme":"orange"
}
},
<?php endforeach; ?>
]
}
}
],
bandIntervals: [
Timeline.DateTime.MONTH,
Timeline.DateTime.DECADE
]
});
// set the map to our custom style
var gmap = tm.getNativeMap();
gmap.mapTypes.set("white", styledMapType);
gmap.setMapTypeId("white");
});
</script>