网友投稿 | 设为首页 | 加入收藏
1/1页1 跳转到查看:5954
回复该主题 发新话题
键盘左右键可以进行前后翻页操作
帮助

chenkwok作品--------worldwind电影浏览器

chenkwok作品--------worldwind电影浏览器

编译不算成功,先试用一下,多提宝贵意见,







试用请点击br>




http://bbs.godeyes.cn/members/chenkwok/World Wind Explorerch.htm.

























源代码:



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//CHS">

<HTML lang=fr-fr><HEAD><TITLE>World Wind Explorer</TITLE>

<META content="MSHTML 6.00.2900.2769" name=GENERATOR>

<META http-equiv=Content-Type content="text/html; charset=gb2312">

<META content="chenkwok - http://www.godeyes.cn"; name=author>

<SCRIPT language=JavaScript1.5 type=text/javascript>



<!--



// init ***********************************************************



var area;



var next;



var nav;



var tiles;



var loop;

var tileNames,
 tile, tileCols, previousRow, previousTile;



var x1,
 x2, x3, y1, y2, y3

;

var levelMin;



var levelMax;

var level;

var direction;

var view0 = 12.8;  // level 0 - approx. 768000 metres altitude

var DEFAULTVIEW = 0.2; // default "view" for Point (12 000 m altitude)

var formWW;

var explorer = this.window;

var nasa;

var smooth;

var delaytime;

var speed;

var loop;

var nav;

var xd;

var yd;

var stop;



// object Point ***************************************************



function Point(x,y,view){

// arguments lon, lat, alt - numeric ***
 this.x = x;
 this.y = y;
 if (view > 0) this.view = view; else this.view = DEFAULTVIEW;

};



Point.prototype.toString = function() {

// returns URI as text ***
 var URI = 'worldwind://goto/world=Earth';
 URI += '&lat=' + this.y;
 URI += '&lon=' + this.x;
 URI += '&view=' + this.view;
 return URI;

};



Point.prototype.lineTo = function(arr){

// arr is another Point object ***
 var line = new Line(this, arr);
 return line;

};



Point.prototype.URIinit = function(uri){

// initialise the point to coordinates of a WW URI                        ***

// such as 'worldwind://goto/world=Earth&lat=28.4&lon=121&view=9.74' ***
 var coords = uri.split("&");
 var index;
 for (var i = 0; i < coords.length; i++) {
  index = coords.indexOf("lat=");
  if (index >= 0) this.y = 1 * coords.substring(index + 4);
  index = coords.indexOf("lon=");
  if (index >= 0) this.x = 1 * coords.substring(index + 4);
  index = coords.indexOf("view=");
  if (index >= 0) this.view = 1 * coords.substring(index + 5);
 };

};



// object Line ***********************************************



function Line(dep, arr) {

// dep & arr are Point objects ***
 this.dep = dep;
 this.arr = arr;

};



Line.prototype.toString = function() {

// returns both points URIs ***
 var txt = '';
 txt += 'dep = ' + this.dep + '\n';
 txt += 'arr = ' + this.arr + '\n';
 return txt;  

};



Line.prototype.right = function(pt){

// is true if point pt is to the right of the line, else false ***
 var x1 = this.dep.x;
 var y1 = this.dep.y;
 var x2 = this.arr.x;
 var y2 = this.arr.y;
 var x = pt.x;
 var y = pt.y;
 var yLine = 0;
 if (x2 - x1 == 0) return ((y2 - y1)*(x - x1) >= 0);
 yLine = y1 + (x - x1) * (y2 - y1) / (x2 - x1);
 if (x2 - x1 > 0) return (y - yLine <= 0);
 return (y - yLine >= 0);

};





// object Polygon *********************************************



function Polygon(points) {

// points is a Point objects array ***
 this.points = points;

};



Polygon.prototype.legs = function() {

// returns an array of the lines defining the closed polygon ***
 var legs = new Array();
 var points = this.points;
 for (var i=1; i < points.length; i++) {
  legs[i-1] = new Line(points[i-1], points);
 };
 legs[i-1] = new Line(points[i-1], points[0]);
 return legs;

};



Polygon.prototype.right = function(pt){

// true if point 'pt' is to the right of all polygons legs ***
 var legs = this.legs();
 for (var i = 0; i < legs.length; i++) {
  if (!legs.right(pt)) return false;
 };
 return true;

};



Polygon.prototype.toString = function() {

// returns the list of legs ***
 var txt = '';
 var line;
 line = this.legs();
 for (var i = 0; i < this.points.length; i++) {
  txt += line + '\n';
 };
 return txt + '\n';

};



Polygon.prototype.corners = function() {

// returns the 2 points, top left and bottom right ***
 var highLeft = new Point(this.points[0].x,this.points[0].y);
 var lowRight = new Point(this.points[0].x,this.points[0].y);
 for (var i=1; i < this.points.length; i++) {
  if(this.points.x > lowRight.x) lowRight.x = this.points.x;  
  if(this.points.y < lowRight.y) lowRight.y = this.points.y;  
  if(this.points.x < highLeft.x) highLeft.x = this.points.x;  
  if(this.points.y > highLeft.y) highLeft.y = this.points.y;  
 } ;
 return [highLeft, lowRight];

};



// functions ***********************************



function wwe() {



// begin exploration ***



stop = false;

delaytime = 10000;

direction = 1;

tilesNumber = 0;

tilesSize = 0;

TILESIZE = 0.125;  // size of one file in Mbites

formWW = document.forms['polygon'];

formWW.tilesNumber.value = 0;

formWW.tilesSize.value = 0;

formWW.tilesNames.value = "";

smooth = 1 * formWW.smooth.value;        // number of supplementary points between each 2 main points (default 10)

speed = 1 * formWW.speed.value ;        // adjust speed : > 1 faster - < 1 slower (default = 1)

if (smooth < 1) smooth = 1;

if (speed <= 0.001) speed = 1;

loop = formWW.loop.checked;

nav = formWW.nav.checked;

nav ? delaytime = delaytime/smooth/speed : delaytime = 1;  

tiles = true;

var latspan = 1 * formWW.latspan.value;

var lonspan = 1 * formWW.lonspan.value;

if (latspan < 0.1) latspan = 0.1;

if (lonspan < 0.1) lonspan = 0.1;
 xd = 0.3 * lonspan; // adjust longitude scanned during delaytime (default = 0.3)
 yd = 0.3 * latspan; // adjust latitude between two exploring ranges (default = 0.3)

if (nav) {
  nasa = open("", "nasa", "menubar=no, toolbar=no, width=300, height=300");
   explorer.focus();
   document.getElementById("WWstatus").innerHTML = '扫描正在进行中..... 查看你的 WorldWind 窗口.<br> 按"停止" 钮中止扫描';
  } else {
    if (tiles) {
       document.getElementById("WWstatus").innerHTML = '图片名称正在处理中.... <br> 按"停止" 钮中止处理';
   } else {
     document.getElementById("WWstatus").innerHTML = 'Check  "Show tiles names" and/or "Show navigation in WorldWind" <br /> checkboxes below';
     return;
   };
  };  
 var pts = new Array();
 var j = 0;
 for (var i = 0; i < formWW.elements.length; i++) {
  if (formWW.elements.value.indexOf("worldwind") >= 0) {
   pts[j] = new Point(0,0);
   pts[j].URIinit(formWW.elements.value);
   j++;
  };
 };
 
 tileNames = "";
 area = new Polygon(pts);
 x1 = area.corners()[0].x; // left longitude
 x2 = area.corners()[1].x; // right longitude
 y1 = area.corners()[0].y; // top latitude
 y2 = area.corners()[1].y; // bottom latitude
 x3=x1;
 y3=y1;
 levelMin = 1 * formWW.levelMin.options[formWW.levelMin.options.selectedIndex].value;
 levelMax = 1 * formWW.levelMax.options[formWW.levelMax.options.selectedIndex].value;
 level = levelMin;
 direction = 1;
 worldwind();

};



function worldwind() {



//show a spot in WW and set a timer for next spot ***
 
 var view = view0 / Math.pow(2,level);
 var xdifference = view * xd / smooth;
 var dx = (x2-x1) * 2;

dx = dx / Math.ceil(dx / xdifference);
 var ydifference = view * yd;
 var dy = (y1-y2) * 2;

dy = dy / Math.ceil(dy / ydifference);
 var pt = new Point(x3,y3,view);
 var URI;
 



// displays the point and set timer if inside the area ***



if (stop) {
  stopExploration();
  return;
  };

if (area.right(pt)) {    
  URI = "" + pt;
 if (nav) {
   nasa.location = URI;
   };
  if (tileRow(pt) != previousRow) {
     previousRow = tileRow(pt);
      tileCols = new Array();
    previousTile = -1;
 };
 if ( tileCol(pt) != previousTile ) {
    previousTile = tileCol(pt);
    if (!tileCols[previousTile]) {
     tileCols[previousTile] = true;
    tileNames = tileName(pt) + '\n' + tileNames;
    tilesNumber++;
    tilesSize += TILESIZE;
    formWW.tilesNumber.value = tilesNumber;
    formWW.tilesSize.value = tilesSize;
      if (tiles) {
      formWW.tilesNames.value = tileNames;
    };
     };
 };
 next = window.setTimeout("worldwind();",delaytime);

} else {
 next = window.setTimeout("worldwind();",1);

};



// next point ***


 var change = false;
 x3 = x3 + dx * direction;
 if (x3 > x2 + 0.00001) {
  x3 = x2;
  direction = -1;
 change = true;
 };
 if (x3 < x1 - 0.00001) {
  x3 = x1;
  direction = 1;
  change = true;
 };
 if (change) {
   y3 = y3 - dy;
   if (y3 < y2 - 0.00001) {
      y3 = y1 ;
      level = level + 1;
      if (level > levelMax) {
      if (loop) level = levelMin;  
     else stop = true;
    };
    };
 };
 return;

};



function tileRow(pt) {
 return Math.floor((pt.y + 90)/Math.pow(2, 1 - level));

}



function tileCol(pt) {
 return Math.floor((pt.x + 180)/Math.pow(2, 1 - level));

}



function tileName(pt) {



// tiles Landsat numbering br>
// lat = row * ( 2 ^ (1 - level) ) - 90

// lon = col * (2 ^ (1 - level) ) - 180

// row = (lat + 90)/2^(1-level)

// col = (lon + 180)/2^(1-level)


 var tileName = level + "\\";
 tileName += tileRow(pt) + "_";
 tileName += tileCol(pt) + ".dds";
 return tileName;

}





function stopExploration() {

// self-explanatory...
 if (nav) nasa.close();
 window.clearTimeout(next);
 document.getElementById("WWstatus").innerHTML =
 '扫描结束.<br>重新按"开始"钮启动'

}



-->

</SCRIPT>

</HEAD>

<BODY

style="COLOR: rgb(0,0,0); DIRECTION: ltr; BACKGROUND-COLOR: rgb(213,213,240)"

vLink=#333399 aLink=#ff0000 link=#0000ff>

<FORM id=polygon name=polygon action=# method=post>

<P id=WWstatus>首先 <A href="worldwind://goto/world=Earth">NASA WorldWind</A>打开. 按下

"开始" 钮,然后在WorldWind窗口中打开指定区域<BR>............享受吧!! </P><INPUT onclick=wwe(); type=button value="开始" name=nom><BR><BR><INPUT onclick=stopExploration(); type=button value="停止" name=stop><BR><BR><!-- value = default coordinates lat and lon - edit as necessary - view is optional and has no effect - "worldwind" is compulsory -->在下列中修改或者输入浏览地标<BR><INPUT size=100

value=worldwind://goto/world=Earth&lat=44.7&lon=5><BR><INPUT size=100

value=worldwind://goto/world=Earth&lat=46.4&lon=6.8><BR><INPUT size=100

value=worldwind://goto/world=Earth&lat=45.9&lon=7.17139765437&view=0.4000001763929><BR><INPUT

size=100 value=worldwind:lat=44.65&lon=5.4><BR><INPUT size=100><BR><INPUT

size=100><BR><INPUT size=100><BR><INPUT size=100><BR><INPUT size=100><BR><INPUT

size=100><BR><!--   Add as many other input fields  as needed :  "<input size="60" ><br>" --><BR>输入浏览最低级别 <SELECT name=levelMin> <OPTION value=0>0 (海拔 750 km)</OPTION>
  <OPTION value=1>1 (380 km)</OPTION> <OPTION value=2 selected>2 (190
  km)</OPTION> <OPTION value=3>3 (96 km)</OPTION> <OPTION value=4>4 (48
  km)</OPTION> <OPTION value=5>5 (23 km)</OPTION> <OPTION value=6>6 (11
  km)</OPTION></SELECT> - - 最大级别 <SELECT name=levelMax> <OPTION
  value=0>0 (海拔 750 km)</OPTION> <OPTION value=1>1 (380 km)</OPTION>
  <OPTION value=2>2 (190 km)</OPTION> <OPTION value=3>3 (96 km)</OPTION> <OPTION
  value=4 selected>4 (48 km)</OPTION> <OPTION value=5>5 (23 km)</OPTION> <OPTION
  value=6>6 (11 km)</OPTION></SELECT><BR><BR>块数量 : <INPUT id=tilesNumber type=button> - 大小 : <INPUT id=tilesSize type=button>

Mbytes<BR><BR>浏览的相应资源卫星块名称  :<BR><TEXTAREA id=tilesNames rows=4 cols=50></TEXTAREA><BR><BR>在WorldWind中浏览 <INPUT id=nav

title="在WorldWind窗口中自动控制 - 不勾只显示块的名称"

type=checkbox CHECKED><BR>速度<INPUT id=speed

title=" 如果需要调整 (默认 = 1)" size=3 value=" 1"> 平坦度 <INPUT

id=smooth title="中间值 (默认 = 5)" size=3 value=5>

搜索幅度(经度) <INPUT id=latspan

title=" 如果需要调整(默认= 1)" type=" text" size=3 value=" 1"> <!--Scan span (latitude)--><INPUT id=lonspan

title="如果需要调整 (默认 = 1)" type=hidden size=3 value=1> <BR>循环

<INPUT id=loop

title="打勾继续循环"

type=checkbox> <BR><BR><INPUT type=reset value="恢复默认"> </FORM>

<H3>说明 </H3>

<P>进入指定的范围和你选择的级别,WorldWind会自动把数据下载到你的硬盘中.

请在"WorldWind.exe.config"中适当调整你cache的大小否则数据会被覆盖. 默认是 2 G太少了!. </P>

<P>警告 :不要尝试下载大面积或太高精度的数据,因为它实在太大了(<B>20TB!</B>)这将需要很长时间(几天?或几周?)!!! </P>

<P>你的输入情况可能符合下列情况: </P>

<UL>
  <LI>1.  单一实位就指向这一选择的海拔
  <LI>2.  二个定位(有相同的经度或纬度)沿着子午线方向呈现
  <LI>3.  三个或以上定位时以 <B>顺时针</B> 方向呈现 </LI></UL>

<P>输入坐标如下: " worldwind:&lat=30.171&lon=-7.218 " (十进制,南纬西经是负数.) </P>

<P>更加容易获得坐标的办法是在WorldWind中用"Ctrl+C"键复制象</P>

<P>"worldwind://goto/world=Earth&lat=42.3187484741211&lon=2.26865649223328&view=0.400000125169754

"</P>

<P>的语句到本页的输入窗口中</P>

<P><B>注意:</B></P>

<P>1.在开始扫描期间前你一定要注意浏览级别:如果浏览级别低而你的坐标又很高,本装置将不会运行!</P>

<P>2.不要再一次输入第一指向,否则它将自动关闭</P>

<P>3.按"开始"按钮启动,它将打开一个空白窗口,请不要关闭它否则将无法启动</P>

<P>4.在扫描期间你可能会改变角度,象平时在用的垂直缩放等,请一定要先按"停止"按钮关闭浏览.</P>

<P>举例 : 6\3071_2217.dds 它指的是存放在 "x:\Program Files\NASA\World Wind

1.3\Cache\Earth\NASA Landsat Imagery\Community Landsat7 (Pseudo

Color)6\3071_2217.dds.dds". .DDS图片浏览请用 <A

href="http://www.godeyes.cn/bbs/Announce/Announce.asp?BoardID=104&;ID=4550/"

target=_blank>IrfanView(上帝之眼有下载需要注册会员)</A></P>

<P>更多信息:<A href="http://worldwind.arc.nasa.gov/"; target=_blank>NASA WorldWind

主页</A> </P>

<P><A href="http://www.godeyes.cn/";

target=_blank>报告Bug或者意见</A> </P>

<H3>相关链接 </H3>

<P>制作: <A href="http://www.godeyes.cn/"; target=_blank>chenkwok---上帝之眼</A>

</P></BODY></HTML>

[/CODE]

TOP

 

re:作什么用的哦~?

作什么用的哦~?

TOP

 

re:点击连接或下代码另存htm文件运行一下o...

点击连接或下代码另存htm文件运行一下ok?

TOP

 

re:这就是所谓电影插件![em05]会按...

这就是所谓电影插件!

会按你的坐标运行,边运行边下载,跨度别太大了!

TOP

 

re:原来这麽好玩阿?~~黑黑 写篇文...

原来这麽好玩阿?~~



黑黑 写篇文字出来!:)

TOP

 

re:[QUOTE][b]下面引用由[u]kd...

下面引用由kdbker发表的内容:



原来这麽好玩阿?~~



黑黑 写篇文字出来!:)


这种事还是你来,我的文采毕业后都还给老师了!



我运行以后觉得最大特点不是它能象放电影一样而是下载,你没有办法下南宁到桂林的图(除非拿个鼠标守在哪里点).有了这个你从起点沿途设几个坐标到终点,然后设一下级别,go,让它自动去下载好了,网络速度慢可以在循环那打勾一次来不及来二次,哈哈.爽,刚才我试着下了上海到杭州的,现在主要问题是还不支持USGS的!

TOP

 

re:没人支持偶。。。偶好伤感。。。。可偶发现...

没人支持偶。。。偶好伤感。。。。可偶发现他人更需要支持。。。。。偶支持你。。。嘻嘻。。。



------------------------------------------------------------------------------------

爱情就像发帖子一样,期待别人的回复;

即便是灌水,也执着的刷新,想听听别人说了些什么;

多人回复的未必是好帖,没人回复的却有可能是精品;

然而!那么多的回帖中,也未必有人真的懂你!



------------------------------------------------------------------------------------------





























TOP

 

re:好帖,研究研究

好帖,研究研究

TOP

 

re:佩服,佩服!高手如云啊........

佩服,佩服!

高手如云啊.....

源代码都贴出来了....

TOP

 

re:这里是稍详细的介绍!http:/...

TOP

 

re:支持版主啊

支持版主啊

TOP

 

re:C版,这个用不成了吗?怎么不能下了?

C版,这个用不成了吗?怎么不能下了?

TOP

 

版主请帮忙,我想吧等值线转换成ww的 pathlist.idx 和pathlist.pkg 文件,
怎么办,是需要什么制作软件。

TOP

 
1/1页1 跳转到
回复该主题 发表新主题
  <<上一主题 | 下一主题>>