调整时空导航,在IE7/FF3下测试通过,IE6下无法使用
This commit is contained in:
parent
147a047562
commit
8acf29a8c3
|
@ -190,7 +190,7 @@ class WaterController extends DataController
|
|||
|
||||
function timemapAction()
|
||||
{
|
||||
$sql="select id,uuid,west,south,north,east,title,timebegin,timeend from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and timebegin is not null";
|
||||
$sql="select id,uuid,west,south,north,east,title,timebegin,timeend from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and timebegin is not null and timebegin::date>date('2007-01-01')";
|
||||
$this->view->rows=$this->db->fetchAll($sql);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ $this->breadcrumb('<a href="/water/">黑河综合遥感联合试验</a>');
|
|||
$this->breadcrumb('时空联合导航');
|
||||
$this->breadcrumb()->setSeparator(' > ');
|
||||
$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg');
|
||||
//$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=3&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA');
|
||||
$this->headScript()->appendFile('/js/timeline_var.js');
|
||||
$this->headScript()->appendFile('/js/timeline_js/timeline-api.js');
|
||||
$this->headScript()->appendFile('/js/timemap/timemap.js');
|
||||
|
@ -18,22 +19,22 @@ $this->headScript()->captureStart();
|
|||
var tm;
|
||||
window.onload=function() {
|
||||
tm = TimeMap.init({
|
||||
mapId: "map", // Id of map div element (required)
|
||||
mapId: "watermap", // Id of map div element (required)
|
||||
timelineId: "timeline", // Id of timeline div element (required)
|
||||
scrollTo: "earliest",
|
||||
options: {
|
||||
eventIconPath: "../images/"
|
||||
eventIconPath: "../images/",
|
||||
mapType:G_SATELLITE_MAP,
|
||||
mapCenter: new GLatLng(39,100),
|
||||
},
|
||||
datasets: [
|
||||
{
|
||||
id: "artists",
|
||||
title: "Artists",
|
||||
data:{
|
||||
theme: "orange",
|
||||
// note that the lines below are now the preferred syntax
|
||||
type: "basic",
|
||||
options: {
|
||||
items: [
|
||||
<?php
|
||||
foreach($this->rows as $row) : ?>
|
||||
value: [
|
||||
<?php foreach($this->rows as $row) : ?>
|
||||
{
|
||||
"start" : "<?php echo $row['timebegin']; ?>",
|
||||
<?php if ($row['timeend']!='') : ?>
|
||||
|
@ -44,27 +45,31 @@ window.onload=function() {
|
|||
"lat" : <?php echo ($row['south']+$row['north'])/2; ?>,
|
||||
"lon" : <?php echo ($row['west']+$row['east'])/2; ?>
|
||||
},
|
||||
"title" : "<?php echo $row['title']; ?>",
|
||||
"title" : "<?php echo htmlspecialchars(mb_substr($row['title'],11,mb_strlen($row['title'],'UTF-8')-10,'UTF-8')); ?>",
|
||||
"options" : {
|
||||
// set the full HTML for the info window
|
||||
"infoHtml": "<a href=/water/<?php echo $row['uuid']; ?>><?php echo $row['title']; ?></a><hr /><img src=/data/thumb/id/<?php echo $row['id']; ?> />"
|
||||
"infoHtml": "<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 width='50' src=/data/thumb/id/<?php echo $row['id']; ?> />",
|
||||
"theme":"orange"
|
||||
}
|
||||
},
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
bandIntervals: [
|
||||
Timeline.DateTime.WEEK,
|
||||
Timeline.DateTime.YEAR
|
||||
Timeline.DateTime.DAY,
|
||||
Timeline.DateTime.MONTH
|
||||
]
|
||||
});
|
||||
// manipulate the timemap further here if you like
|
||||
var map=tm.map;
|
||||
map.setCenter(new GLatLng(39,100),7);
|
||||
}
|
||||
window.onunload=GUnload();
|
||||
<?php $this->headScript()->captureEnd(); ?>
|
||||
<div id="timemap" style="clear:both;">
|
||||
<div id="timeline" style="height:300px;width:100%;"></div>
|
||||
<div id="map" style="height:300px;"></div>
|
||||
</div>
|
||||
<div id="watermap" style="height:500px;width:40%;float:right;"></div>
|
||||
<div id="timeline" style="height:500px;border-right:1px solid #abc;"></div>
|
||||
|
||||
</div>
|
|
@ -9,6 +9,10 @@
|
|||
$this->breadcrumb('<a href="/water/">黑河综合遥感联合试验</a>');
|
||||
$this->breadcrumb('查看试验元数据');
|
||||
$this->breadcrumb()->setSeparator(' > ');
|
||||
//http://westdc.westgis.ac.cn
|
||||
//$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg');
|
||||
$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA');
|
||||
|
||||
$this->headScript()->appendFile('/js/prototype.js');
|
||||
$this->headScript()->appendFile('/js/OpenLayers.js');
|
||||
$this->headScript()->appendFile('/js/window.js');
|
||||
|
@ -102,7 +106,7 @@ else
|
|||
</div>
|
||||
<hr />
|
||||
<h2>位置图</h2>
|
||||
<div id='map'></div>
|
||||
<div id='watermap'></div>
|
||||
<hr />
|
||||
<h2>联系信息</h2>
|
||||
<div id="authors">
|
||||
|
@ -236,13 +240,8 @@ function reportError(request)
|
|||
</div>
|
||||
|
||||
|
||||
<!--westdc.westgis.ac.cn-->
|
||||
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg" charset="utf-8"></script>
|
||||
<!--test.westgis.ac.cn
|
||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA'></script>
|
||||
-->
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
var map = new GMap2(document.getElementById("map"));
|
||||
var map = new GMap2(document.getElementById("watermap"));
|
||||
var plotbounds=new GLatLngBounds(new GLatLng(<?= $md->south; ?>,<?= $md->west; ?>),new GLatLng(<?= $md->north; ?>,<?= $md->east; ?>));
|
||||
var zoomlevel=map.getBoundsZoomLevel(plotbounds);
|
||||
zoomlevel--;
|
||||
|
|
Loading…
Reference in New Issue