// // searchGmap.js // // main Ext.onReady(function(){ // set Google map map = new GMap2(document.getElementById("srch_gmap_canvas")); map.addMapType(G_PHYSICAL_MAP); // map.setMapType(G_HYBRID_TYPE); // set limit [zoom up & out] map.getMapTypes().length=0; var myMapType = new Array(); var MapTypeName = new Array("G_PHYSICAL_MAP","G_NORMAL_MAP","G_HYBRID_MAP","G_SATELLITE_MAP"); for(var i=0;igp0.x){ x.push(point.x); y.push(point.y); div = drawLine(gp0,gp1); map.getPane(G_MAP_MAP_PANE).appendChild(div); if(y[0]>y[1]){ document.getElementById("tex1").value = y[0]; document.getElementById("tex4").value = point.y; }else{ document.getElementById("tex1").value = point.y; document.getElementById("tex4").value = y[0]; } if(gp0.x>gp1.x){ document.getElementById("tex2").value = x[1]; document.getElementById("tex3").value = x[0]; }else{ document.getElementById("tex2").value = x[0]; document.getElementById("tex3").value = x[1]; } flg = 0; x = []; y = []; // } break; } } } ); }else{ if(document.getElementById("square")){ map.getPane(G_MAP_MAP_PANE).removeChild(document.getElementById("square")); } GEvent.clearListeners(map,'click'); GEvent.clearListeners(map,'zoomend'); } } function drawLine(gp0,gp1){ var div = document.createElement("div"); div.id = "square"; div.style.border = "1px solid red"; div.style.position = "absolute"; if(gp0.y>gp1.y){ div.style.top = gp1.y + "px"; div.style.height = gp0.y - gp1.y + "px"; }else{ div.style.top = gp0.y + "px"; div.style.height = gp1.y - gp0.y + "px"; } if(gp0.x>gp1.x){ div.style.left = gp1.x + "px"; div.style.width = gp0.x - gp1.x + "px"; }else{ div.style.left = gp0.x + "px"; div.style.width = gp1.x - gp0.x + "px"; } // alert(gp1.x + " / " + gp1.y); return div; } // set trajectory function setTraj(url) { var request = GXmlHttp.create(); request.open("GET", url, true); request.onreadystatechange = function() { if (request.readyState == 4 && request.status == 200) { var xmlDoc = GXml.parse(request.responseText); var prof_num=plotPos(xmlDoc,2); Ext.getDom("srch_map_side_bar").innerHTML = side_bar_html; infClickT(prof_num); } } request.send(null); } // plot search map function srchPlotMap(xmlDoc){ var prof_num=plotPos(xmlDoc,2); Ext.getDom("srch_map_side_bar").innerHTML = side_bar_html; // infClickT(prof_num); // grid line lineLatLon(); plotGridIcon(); } // plot position mapping function plotPos(xmlDoc,flag){ // var xmlDoc = GXml.parse(xmlDoc); // text2xml map.clearOverlays(); map.getInfoWindow().hide(); side_bar_html=""; // set profiles if(flag==2){ gmarkersT = []; htmlsT = []; var pts = []; var profiles = xmlDoc.getElementsByTagName("profile"); for(var i=1; i<4; i++){ var str="li"+(i*1000); if(document.getElementById(str).checked){ var li = i*1000; break; } } if(li <= profiles.length){ alert("LIMIT OVER !\n The search is over "+profiles.length+" profiles.\n Please zoom up and search again."); } if(profiles.length > 0){ document.getElementById("append").style.display = "block"; } alert(profiles.length+" profiles"); for(var i=0; i=gchart) {var step = Math.floor((pres1.length/gchart)+1);} else {var step = 1;} var k = 0; var psal_axis = new Array; var temp_axis = new Array; var pres_axis = new Array; var zSize = new Array; var Title = wmo + '_' + profno; var profHtml = '# ' + Title + '
'; profHtml += '# ' + date + ', ' + Math.abs(lat) + latu + ', ' + Math.abs(lon) + lonu + '
#
'; profHtml += '# pres, temp, psal
'; for (var j = 0; j < pres1.length; j++) { if(pres_f[j]==0 || pres_f[j]==3 || pres_f[j]==4 || pres_f[j]==9 || temp_f[j]==0 || temp_f[j]==3 || temp_f[j]==4 || temp_f[j]==9 || psal_f[j]==0 || psal_f[j]==3 || psal_f[j]==4 || psal_f[j]==9){ continue; } if((j%step)==0) { psal_axis[k] = ""+ Math.round((((psal1[j]-0)-psal_min)*(100/(psal_max-psal_min)))*100)/100; temp_axis[k] = ""+ Math.round((((temp1[j]-0)-temp_min)*(100/(temp_max-temp_min)))*100)/100; pres_axis[k] = ""+ Math.round((((pres1[j]-0)-pres_min)*(100/(pres_max-pres_min)))*100)/100; zSize[k] = "20"; k++; } if(pres1[j]==99999) {pres1[j]='NaN';} if(temp1[j]==99999) {temp1[j]='NaN';} if(psal1[j]==99999) {psal1[j]='NaN';} profHtml += pres1[j] + ', ' + temp1[j] + ', ' + psal1[j] + '
'; } html = ''+st["wmo"]+' : ' + wmo + '
'; html += date + ' (Cycle No : ' + profno + ')
'; html += 'Lat : ' + Math.abs(lat) + latu + ', Lon : ' + Math.abs(lon) + lonu + '
'; // ext window html += '
'; // google chart /* html += 't-s'; html += 'p-t'; html += 'p-s
'; */ html += 't-s'; html += 'p-t'; html += 'p-s
'; html += ''+st["netcdf2"]+' '; if(!document.getElementById("zenkyu").checked){ html += ''+st["float_inf"]+' 
'; }else{ var html1 = ''+st["float_inf"]+' 
'; if(lang==0){ var html1 = ''+st["float_inf"]+' 
'; } html += html1; } // html += 'GDAC(アメリカ) 
'; var marker = createMarker(point,profno,html,iconN,flag,i,wmo); map.addOverlay(marker); // plot line var color = '#ff9900'; var width = 2; var opasity = 2; pts[i] = point; } // var polyline = new GPolyline(pts, color, width); // map.addOverlay(polyline); } return(profiles.length-1); } // set Marker function createMarker(point, name, html, n, flag,ii,wmo) { var marker = new GMarker(point, icon[n]); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); if (flag == 2) { gmarkersT[ii] = marker; htmlsT[ii] = html; side_bar_html += '' + wmo+ '_' + name + '<\/a>
'; } return marker; } function infClickT(i) { gmarkersT[i].openInfoWindowHtml(htmlsT[i]); } // create Ext window function makeExtwin(Title,wid,hei,Html){ var win = new Ext.Window({ title:Title, width:wid, height:hei, layout: 'fit', autoDestroy:true, plain:true, closeAction:'hide', collapsible:true, resizable:true, // maximizable:true, constrain:true, deferredRender:true, items: [{ autoScroll:true, html:Html }] }); win.show(); } // set icon var icon = Array(); // profile__qc // A (QC) icon[10] = new GIcon(); icon[10].image = "../images/argo_gmap/qcAB.png"; icon[10].iconSize = new GSize(6,6); icon[10].iconAnchor = new GLatLng(2,2); icon[10].infoWindowAnchor = new GLatLng(2,2); // B (QC) icon[11] = new GIcon(icon[10],"../images/argo_gmap/qcAB.png"); // C (QC) icon[12] = new GIcon(icon[10],"../images/argo_gmap/qcCDE.png"); // CE (QC) icon[13] = new GIcon(icon[10],"../images/argo_gmap/qcCDE.png"); // F (QC) icon[14] = new GIcon(icon[10],"../images/argo_gmap/qcF.png"); // dQC icon[15] = new GIcon(icon[10],"../images/argo_gmap/qcC.png");