var today = new Date(); var Ymkobjs=new Array(); var idnum=0; var millisecondsLeft = today.getTime(); millisecondsLeft = Math.round(millisecondsLeft); function ll_to_xy(lat, lon, level) { circum_px = 1 << (26 - level); x_per_lon_ = circum_px / 360.0; tile_h_=256;tile_w_=256; ntiles_h_ = circum_px / tile_h_; pixel_height=ntiles_h_*tile_h_; alat = Math.abs(lat); alon = lon + 180.0; if(alat >= 90.0 || alon > 360.0 || alon < 0.0) return(0); alat *= 3.1415926 / 180.0; x = parseInt(alon * x_per_lon_); ytemp = (Math.log(Math.tan(alat) + 1.0 / Math.cos(alat))) / 3.1415926; y = parseInt(ytemp * pixel_height) / 2; if(lat < 0) y = -y; xp=x; yp=y; x=0;y=0; ypos = (yp < 0) ? -yp : yp; col = xp / tile_w_; x = xp % tile_w_; row = ypos / tile_h_; y = ypos % tile_h_; if(yp < 0) { row = -row; if(y > 0) { row--; y = tile_h_ - y; } } row=parseInt(row); col=parseInt(col); return (new Array(col,row)); } function ll_to_pxy(lat,lon,z){ circum_px=(1<<(26-z)); _cp=new Array(); alon=lon+180; ltmp=Math.abs(alon) % 360; if(alon<0) alon=360-ltmp; if(alon>360) alon=ltmp; alat=Math.abs(lat); if(alat>90) alat=90; alat*=(Math.PI/180); _cp[0]=parseInt(alon*(circum_px/360)); ytemp=Math.log(Math.tan(alat)+1.0/Math.cos(alat))/Math.PI; _cp[1]=parseInt(ytemp*((circum_px/256)*256))/2; if(lat<0) _cp[1]=-_cp[1]; return _cp; } function pxy_to_ll(x_pixel,y_pixel,z){ circum_px=(1<<(26-z)); _gp=new Array(); alon=x_pixel/(circum_px/360); ltmp=Math.abs(alon)%360; if(alon<0) alon=360-ltmp; if(alon>360) alon=ltmp; _gp[1]=alon-180; alat=(y_pixel/(((circum_px/256)*256)/2))*Math.PI; alat=Math.atan(Math.sinh(alat))/(Math.PI/180); if(alat<-90) alat=-90; if(alat>90) alat=90; _gp[0]=alat; return _gp; } function ntiles_w_(z){ circum_px = 1 << (26 - z); ntiles_w_ = circum_px / 256; return ntiles_w_; } function makeImap(){ var container="
"; document.write(container); } function makeYMarker(w, h, pos, content){ idnum=idnum+1; var odiv=document.createElement("DIV"); var trnsxy=transXY(pos); odiv.id="marker_"+idnum;Ymkobjs.push("marker_"+idnum); odiv.style.width=w+"px";odiv.style.height=h+"px";odiv.style.float="left";odiv.style.position="absolute"; odiv.style.top=(trnsxy[1]-h-10)+"px";odiv.style.left=trnsxy[0]+"px";odiv.style.padding=0;odiv.style.margin=0; odiv.innerHTML=content; document.getElementById('imgmap_'+millisecondsLeft).appendChild(odiv); return document.getElementById("marker_"+idnum); } function clearYMarker(){ for(i=0;i