调整时空导航,在IE7/FF3下测试通过,IE6下无法使用

This commit is contained in:
wlx 2010-06-29 08:55:46 +00:00
parent 147a047562
commit 8acf29a8c3
3 changed files with 30 additions and 26 deletions

View File

@ -190,7 +190,7 @@ class WaterController extends DataController
function timemapAction() 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); $this->view->rows=$this->db->fetchAll($sql);
} }

View File

@ -10,6 +10,7 @@ $this->breadcrumb('<a href="/water/">黑河综合遥感联合试验</a>');
$this->breadcrumb('时空联合导航'); $this->breadcrumb('时空联合导航');
$this->breadcrumb()->setSeparator(' > '); $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=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_var.js');
$this->headScript()->appendFile('/js/timeline_js/timeline-api.js'); $this->headScript()->appendFile('/js/timeline_js/timeline-api.js');
$this->headScript()->appendFile('/js/timemap/timemap.js'); $this->headScript()->appendFile('/js/timemap/timemap.js');
@ -18,22 +19,22 @@ $this->headScript()->captureStart();
var tm; var tm;
window.onload=function() { window.onload=function() {
tm = TimeMap.init({ 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) timelineId: "timeline", // Id of timeline div element (required)
scrollTo: "earliest",
options: { options: {
eventIconPath: "../images/" eventIconPath: "../images/",
mapType:G_SATELLITE_MAP,
mapCenter: new GLatLng(39,100),
}, },
datasets: [ datasets: [
{ {
id: "artists", data:{
title: "Artists",
theme: "orange", theme: "orange",
// note that the lines below are now the preferred syntax // note that the lines below are now the preferred syntax
type: "basic", type: "basic",
options: { value: [
items: [ <?php foreach($this->rows as $row) : ?>
<?php
foreach($this->rows as $row) : ?>
{ {
"start" : "<?php echo $row['timebegin']; ?>", "start" : "<?php echo $row['timebegin']; ?>",
<?php if ($row['timeend']!='') : ?> <?php if ($row['timeend']!='') : ?>
@ -44,10 +45,11 @@ window.onload=function() {
"lat" : <?php echo ($row['south']+$row['north'])/2; ?>, "lat" : <?php echo ($row['south']+$row['north'])/2; ?>,
"lon" : <?php echo ($row['west']+$row['east'])/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" : { "options" : {
// set the full HTML for the info window // 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; ?>
@ -56,15 +58,18 @@ window.onload=function() {
} }
], ],
bandIntervals: [ bandIntervals: [
Timeline.DateTime.WEEK, Timeline.DateTime.DAY,
Timeline.DateTime.YEAR Timeline.DateTime.MONTH
] ]
}); });
// manipulate the timemap further here if you like // manipulate the timemap further here if you like
var map=tm.map;
map.setCenter(new GLatLng(39,100),7);
} }
window.onunload=GUnload(); window.onunload=GUnload();
<?php $this->headScript()->captureEnd(); ?> <?php $this->headScript()->captureEnd(); ?>
<div id="timemap" style="clear:both;"> <div id="timemap" style="clear:both;">
<div id="timeline" style="height:300px;width:100%;"></div> <div id="watermap" style="height:500px;width:40%;float:right;"></div>
<div id="map" style="height:300px;"></div> <div id="timeline" style="height:500px;border-right:1px solid #abc;"></div>
</div> </div>

View File

@ -9,6 +9,10 @@
$this->breadcrumb('<a href="/water/">黑河综合遥感联合试验</a>'); $this->breadcrumb('<a href="/water/">黑河综合遥感联合试验</a>');
$this->breadcrumb('查看试验元数据'); $this->breadcrumb('查看试验元数据');
$this->breadcrumb()->setSeparator(' > '); $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/prototype.js');
$this->headScript()->appendFile('/js/OpenLayers.js'); $this->headScript()->appendFile('/js/OpenLayers.js');
$this->headScript()->appendFile('/js/window.js'); $this->headScript()->appendFile('/js/window.js');
@ -102,7 +106,7 @@ else
</div> </div>
<hr /> <hr />
<h2>位置图</h2> <h2>位置图</h2>
<div id='map'></div> <div id='watermap'></div>
<hr /> <hr />
<h2>联系信息</h2> <h2>联系信息</h2>
<div id="authors"> <div id="authors">
@ -236,13 +240,8 @@ function reportError(request)
</div> </div>
<!--westdc.westgis.ac.cn-->
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg" charset="utf-8"></script>
<!--test.westgis.ac.cn
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA'></script>
-->
<script type="text/javascript" charset="utf-8"> <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 plotbounds=new GLatLngBounds(new GLatLng(<?= $md->south; ?>,<?= $md->west; ?>),new GLatLng(<?= $md->north; ?>,<?= $md->east; ?>));
var zoomlevel=map.getBoundsZoomLevel(plotbounds); var zoomlevel=map.getBoundsZoomLevel(plotbounds);
zoomlevel--; zoomlevel--;