笔记地球
来源:互联网 发布:哪里的域名不需要备案 编辑:程序博客网 时间:2024/04/28 18:31
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script src="http://www.google.com/jsapi?key=" type="text/javascript"></script>
<script type="text/javascript">
var ge;
var placemark;
var dragInfo = null;
google.load("earth", "1");
function GetRequest() //获取上一页传的值
{
var url = location.search; //获取url中"?"符后的字串
var theRequest = new Object();
if(url.indexOf("?") != -1)
{
var str = url.substr(1);
strs = str.split("&");
for(var i = 0; i < strs.length; i ++)
{
theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}
function init() {
google.earth.createInstance('map3d', initCallback, failureCallback);
}
function initCallback(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
placemark = ge.createPlacemark('');
var Request=new Object();
Request=GetRequest();
var place;
place=Request['place'];
X=Request['X'];
Y=Request['Y'];
var point = ge.createPoint('');
point.setLatitude(X);
point.setLongitude(Y);
placemark.setGeometry(point);
// add the placemark to the earth DOM
ge.getFeatures().appendChild(placemark);
// look at the placemark we created
var la = ge.createLookAt('');
la.set(41.753432, 123.430560,
0, // altitude
ge.ALTITUDE_RELATIVE_TO_GROUND,
0, // heading
0, // straight-down tilt
18000 // range (inverse of zoom)
);
ge.getView().setAbstractView(la);
placemark.setName(place);
// listen for mousedown on the window (look specifically for point placemarks)
google.earth.addEventListener(ge.getWindow(), 'mousedown', function(event) {
if (event.getTarget().getType() == 'KmlPlacemark' &&
event.getTarget().getGeometry().getType() == 'KmlPoint') {
//event.preventDefault();
var placemark = event.getTarget();
dragInfo = {
placemark: event.getTarget(),
dragged: false
};
}
});
// listen for mousemove on the globe
google.earth.addEventListener(ge.getGlobe(), 'mousemove', function(event) {
if (dragInfo) {
event.preventDefault();
var point = dragInfo.placemark.getGeometry();
point.setLatitude(event.getLatitude());
point.setLongitude(event.getLongitude());
dragInfo.dragged = true;
}
});
// listen for mouseup on the window
google.earth.addEventListener(ge.getWindow(), 'mouseup', function(event) {
if (dragInfo) {
if (dragInfo.dragged) {
// if the placemark was dragged, prevent balloons from popping up
event.preventDefault();
}
dragInfo = null;
}
});
}
function failureCallback(errorCode) {
}
</script>
</head>
<body onload="init()" style="font-family: arial, sans-serif; font-size: 13px; border: 0;">
<div id="map3d" style="width: 500px; height: 380px;"></div>
</body>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script src="http://www.google.com/jsapi?key=" type="text/javascript"></script>
<script type="text/javascript">
var ge;
var placemark;
var dragInfo = null;
google.load("earth", "1");
function GetRequest() //获取上一页传的值
{
var url = location.search; //获取url中"?"符后的字串
var theRequest = new Object();
if(url.indexOf("?") != -1)
{
var str = url.substr(1);
strs = str.split("&");
for(var i = 0; i < strs.length; i ++)
{
theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}
function init() {
google.earth.createInstance('map3d', initCallback, failureCallback);
}
function initCallback(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
placemark = ge.createPlacemark('');
var Request=new Object();
Request=GetRequest();
var place;
place=Request['place'];
X=Request['X'];
Y=Request['Y'];
var point = ge.createPoint('');
point.setLatitude(X);
point.setLongitude(Y);
placemark.setGeometry(point);
// add the placemark to the earth DOM
ge.getFeatures().appendChild(placemark);
// look at the placemark we created
var la = ge.createLookAt('');
la.set(41.753432, 123.430560,
0, // altitude
ge.ALTITUDE_RELATIVE_TO_GROUND,
0, // heading
0, // straight-down tilt
18000 // range (inverse of zoom)
);
ge.getView().setAbstractView(la);
placemark.setName(place);
// listen for mousedown on the window (look specifically for point placemarks)
google.earth.addEventListener(ge.getWindow(), 'mousedown', function(event) {
if (event.getTarget().getType() == 'KmlPlacemark' &&
event.getTarget().getGeometry().getType() == 'KmlPoint') {
//event.preventDefault();
var placemark = event.getTarget();
dragInfo = {
placemark: event.getTarget(),
dragged: false
};
}
});
// listen for mousemove on the globe
google.earth.addEventListener(ge.getGlobe(), 'mousemove', function(event) {
if (dragInfo) {
event.preventDefault();
var point = dragInfo.placemark.getGeometry();
point.setLatitude(event.getLatitude());
point.setLongitude(event.getLongitude());
dragInfo.dragged = true;
}
});
// listen for mouseup on the window
google.earth.addEventListener(ge.getWindow(), 'mouseup', function(event) {
if (dragInfo) {
if (dragInfo.dragged) {
// if the placemark was dragged, prevent balloons from popping up
event.preventDefault();
}
dragInfo = null;
}
});
}
function failureCallback(errorCode) {
}
</script>
</head>
<body onload="init()" style="font-family: arial, sans-serif; font-size: 13px; border: 0;">
<div id="map3d" style="width: 500px; height: 380px;"></div>
</body>
</html>
- 笔记地球
- google 地球
- 数字地球
- 数字地球
- 重返地球
- 地球母亲
- 反转地球
- 星空地球
- 未来-地球
- 地球起源
- 地球一小时
- 地球一小时
- 智慧地球
- 地球经纬网
- 修地球
- 数据地球!
- 地球人己阻止不了程序猿们学习cocos2d-x了-学习笔记01
- 地球人己阻止不了程序猿们学习cocos2d-x了-学习笔记02
- python shell
- Libevent(二)
- MFC中定义全局变量和全局函数的方法
- sql的分页函数
- Linux操作系统进程间通信概述
- 笔记地球
- Win7可用的笔记本电池校正软件( 64、32位)
- pinyin4j
- 注解、泛型
- 数据库Sqlite的分页显示。
- 最大程度降低 SQL Server 中的阻塞
- 备忘录:sql函数
- 集群和数据库负载均衡的研究
- 乔布斯的发展理念