DIR : /home/kozerus/public_html/jkwii/js/jsdoit/clock_search/index.js
/home/kozerus/public_html/jkwii/js/jsdoit/clock_search
var timer;
var nums=[
[[-6.21858,106.802537,15],[-36.408727,145.22482,15]], //0
[[45.476594,-122.560301,16],[-35.973721,145.153111,17]], //1
[[44.957631,-93.27252,17],[-37.79201,142.698933,15]], //2
[[44.956259,-93.298023,17],[-38.416708,143.446891,16]], //3
[[41.708904,-87.794409,16],[-38.229466,142.829261,15],[-38.123931,145.351825,15]], //4
[[44.958755,-93.272381,17]], //5
[[32.220281,-110.855548,17]], //6
[[4.815662,7.02706,18]], //7
[[55.656466,12.297587,17],[-38.052397,142.844066,16]], //8
[[32.228186,-110.95597,17]], //9
[[51.913064,4.546884,17]] //:
];
var btime=[0,0,0,0,0,0];
var tobj={};
var linemap;
var linepoly;
var wCount;
var hh,nn,ss;
window.onload = function(){
var geo=timelatlng(0);
for(var i=1;i<=2;i++){
var ci=["h","n","s"];
for(var j=0;j<ci.length;j++){
var idname=ci[j]+i;
tobj[idname]=createMap('map'+idname,geo);
}
createMap('mapc'+i,timelatlng(10));
}
linemap = new google.maps.Map(document.getElementById('mapbig'), {
zoom:1,
center: new google.maps.LatLng(5,155),
mapTypeId: google.maps.MapTypeId.SATELLITE,
navigationControl: true,
mapTypeControl: false,
scaleControl: false
});
wCount=0;
callTimerEvent();
}
function createMap(id,geo){
var mapdiv = document.getElementById(id);
var opt = {
zoom:geo[2],
center: new google.maps.LatLng(geo[0],geo[1]),
mapTypeId: google.maps.MapTypeId.SATELLITE,
navigationControl: false,
mapTypeControl: false,
scaleControl: false,
draggable: false
};
return new google.maps.Map(mapdiv, opt);
}
function moveMap(id,num,key){
if(btime[key]!=num){
btime[key]=num;
var geo=timelatlng(num);
var opt = {
zoom:geo[2],
center: new google.maps.LatLng(geo[0],geo[1]),
};
tobj[id].setOptions(opt);
}
return tobj[id].getCenter();
}
function callTimerEvent(){
clearTimeout(timer);
if(wCount==0){
$('#timerText').val("");
$('#timerText').focus();
var now = new Date();
hh = now.getHours();
nn = now.getMinutes();
ss = now.getSeconds();
}else if(wCount==7){
$('#timerText').val(hh);
}else if(wCount==8){
$('#timerText').val(hh+"時");
}else if(wCount==10){
$('#timerText').val(hh+"時"+nn);
}else if(wCount==11){
$('#timerText').val(hh+"時"+nn+"分");
}else if(wCount==13){
$('#timerText').val(hh+"時"+nn+"分"+ss);
}else if(wCount==14){
$('#timerText').val(hh+"時"+nn+"分"+ss+"秒");
}else if(wCount==15){
$('#timerText').val(hh+"時"+nn+"分"+ss+"秒 の地図");
}
if(wCount<16){
wCount++;
timer=setTimeout("callTimerEvent()",500);
}else{
$('#timerBtn').focus();
submitTime();
}
}
function submitTime(){
clearTimeout(timer);
wCount=0;
$('#timerText').val(hh+"時"+nn+"分"+ss+"秒 の地図");
setClockTime(hh,nn,ss);
timer=setTimeout("callTimerEvent()",500);
}
function setClockTime(hh,nn,ss){
if(linepoly!=null){
linepoly.setMap(null);
}
var lines = [
moveMap("h2",Math.floor(hh/10),0),
moveMap("h1",Math.floor(hh%10),1),
moveMap("n2",Math.floor(nn/10),2),
moveMap("n1",Math.floor(nn%10),3),
moveMap("s2",Math.floor(ss/10),4),
moveMap("s1",Math.floor(ss%10),5)
];
linepoly = new google.maps.Polyline({
path:lines,
strokeColor: "#990000",
strokeOpacity: 1.0,
strokeWeight: 2
});
linepoly.setMap(linemap);
}
function timelatlng(num){
var tg = nums[num];
var choice = Math.floor(Math.random()*tg.length);
return tg[choice];
}
//
koh5_pano
Drag mouse to navigate.
Navigation
- Left/Right Mouse drag: Changes camera heading.
- Up/Sown Mouse drag: Changes camera pitch.
- Scroll wheel: Changes camera field of view.
- I-Key: Displays Info panel with canvas size, image size and FPS.
17.Aug.2010, Martin Wengenmayer