";
html+=""+data[i].prov+"
";
html+="";
for(var j=0;j"+data[i].kabkot[j]+"
";
}
html+="";
html+="";
}
$("#areaawas-pdie").html(html);
}
});
//ambil area awas untuk pcht_das
$.post("areacoverage.php?req=getareacoverage", {
layername:"pcht_das",
legendindex:3,
date1:"2025-02-01",
date2: null,
num1:"1"
},function(data){
if(jQuery.isEmptyObject(data)){
$("#areaawas-pcht_das").html("Wilayah tidak ditemukan
");
}else{
var html="";
for(var i=0;i";
html+=""+data[i].prov+"
";
html+="";
for(var j=0;j"+data[i].kabkot[j]+"
";
}
html+="";
html+="";
}
$("#areaawas-pcht_das").html(html);
}
});
});
function switchLayer(obj){
var layername = obj.layername || "";
var date1 = obj.date1 || "";
var date2 = obj.date2 || "";
var num1 = obj.num1 || "";
var num2 = obj.num2 || "";
cur_active_layer = layername;
var odate1 = date1.substring(8,10);
var omonth1_m2 = MONTHS[(parseInt(date1.substring(5,7))-3) < 0?(parseInt(date1.substring(5,7))-3+12):(parseInt(date1.substring(5,7))-3)];
var omonth1_m1 = MONTHS[(parseInt(date1.substring(5,7))-2) < 0?(parseInt(date1.substring(5,7))-2+12):(parseInt(date1.substring(5,7))-2)];
var omonth1 = MONTHS[parseInt(date1.substring(5,7))-1];
var omonth1_p1 = MONTHS[(parseInt(date1.substring(5,7))) > 11?(parseInt(date1.substring(5,7))-12):(parseInt(date1.substring(5,7)))];
var omonth1_p2 = MONTHS[(parseInt(date1.substring(5,7))+1) > 11?(parseInt(date1.substring(5,7))+1-12):(parseInt(date1.substring(5,7))+1)];
var omonth1_short = MONTHS_SHORT[parseInt(date1.substring(5,7))-1];
var oyear1 = date1.substring(0,4);
var odate2 = date2.substring(8,10);
var omonth2_m2 = MONTHS[(parseInt(date2.substring(5,7))-3) < 0?(parseInt(date2.substring(5,7))-3+12):(parseInt(date2.substring(5,7))-3)];
var omonth2_m1 = MONTHS[(parseInt(date2.substring(5,7))-2) < 0?(parseInt(date2.substring(5,7))-2+12):(parseInt(date2.substring(5,7))-2)];
var omonth2 = MONTHS[parseInt(date2.substring(5,7))-1];
var omonth2_p1 = MONTHS[(parseInt(date2.substring(5,7))) > 11?(parseInt(date2.substring(5,7))-12):(parseInt(date2.substring(5,7)))];
var omonth2_p2 = MONTHS[(parseInt(date2.substring(5,7))+1) > 11?(parseInt(date2.substring(5,7))+1-12):(parseInt(date2.substring(5,7))+1)];
var oyear2 = date2.substring(0,4);
layer_pdie.setVisible($("input[value='pdie']").is(":checked"));
layer_pcht_das.setVisible($("input[value='pcht_das']").is(":checked"));
layer_hth_das_info.setVisible($("input[value='hth']").is(":checked"));
layer_hth_das_view.setVisible($("input[value='hth']").is(":checked"));
layer_spi_ps3m.setVisible($("input[value='spi_ps3m']").is(":checked"));
layer_spi_as1m.setVisible($("input[value='spi_as1m']").is(":checked"));
layer_spi_as3m.setVisible($("input[value='spi_as3m']").is(":checked"));
layer_pch_prob_1m.setVisible($("input[value='pch_prob_1m']").is(":checked"));
layer_pch_prob_2m.setVisible($("input[value='pch_prob_2m']").is(":checked"));
layer_pch_prob_3m.setVisible($("input[value='pch_prob_3m']").is(":checked"));
layer_pch_prob_das.setVisible($("input[value='pch_prob_das']").is(":checked"));
layer_pem.setVisible($("input[value='pem']").is(":checked"));
layer_titikstationmatahari.setVisible($("input[value='titikstationmatahari']").is(":checked"));
layer_pea.setVisible($("input[value='pea']").is(":checked"));
layer_analisiscurahhujan.setVisible($("input[value='analisiscurahhujan']").is(":checked"));
layer_analisissifathujan.setVisible($("input[value='analisissifathujan']").is(":checked"));
setLegend(layername, date1, date2, num1);
var maptitle = [];
if($("input[value='pdie']").is(":checked")){
if(layername == "pdie"){
maptitle_pdie = "PERINGATAN DINI KEKERINGAN METEOROLOGIS
BERLAKU DASARIAN "+romawi(num1)+" "+omonth1.toUpperCase()+" "+oyear1;
layer_pdie.getSource().updateParams({
'LAYERS': 'pdie,prov,kabkot',
'date': date1,
'num': num1
});
}
maptitle.push(maptitle_pdie);
$("#maplegend_pdie").show();
}else{
$("#maplegend_pdie").hide();
}
if($("input[value='pcht_das']").is(":checked")){
if(layername == "pcht_das"){
maptitle_pcht_das = "PERINGATAN DINI CURAH HUJAN TINGGI
BERLAKU DASARIAN "+romawi(num1)+" "+omonth1.toUpperCase()+" "+oyear1;
layer_pcht_das.getSource().updateParams({
'LAYERS': 'pcht_das,prov,kabkot',
'date': date1,
'num': num1
});
}
maptitle.push(maptitle_pcht_das);
$("#maplegend_pcht_das").show();
}else{
$("#maplegend_pcht_das").hide();
}
if($("input[value='hth']").is(":checked")){
if(layername == "hth"){
maptitle_hth = "MONITORING HARI TANPA HUJAN BERTURUT-TURUT
PEMUTAKHIRAN DASARIAN "+romawi(num1)+" "+omonth1.toUpperCase()+" "+oyear1;
layer_hth_das_info.getSource().updateParams({
'LAYERS': 'kabkot,prov,hth_das_info',
'date': date1
});
layer_hth_das_view.getSource().updateParams({
'LAYERS': 'kabkot,prov,hth_das0,hth_das1,hth_das2,hth_das3,hth_das4,hth_das5,hth_das6',
'date': date1
});
$("#mdlprintout a.indonesia").attr("href", "ftp/HTH_jpg/Das "+num1+" "+omonth1_short+" "+oyear1+"/PetaMonitoringHariTanpaHujan-Indonesia.jpg");
$("#mdlprintout a.balinusa").attr("href", "ftp/HTH_jpg/Das "+num1+" "+omonth1_short+" "+oyear1+"/PetaMonitoringHariTanpaHujan-BaliNustra.jpg");
$("#mdlprintout a.jawa").attr("href", "ftp/HTH_jpg/Das "+num1+" "+omonth1_short+" "+oyear1+"/PetaMonitoringHariTanpaHujan-Jawa.jpg");
$("#mdlprintout a.kalimantan").attr("href", "ftp/HTH_jpg/Das "+num1+" "+omonth1_short+" "+oyear1+"/PetaMonitoringHariTanpaHujan-Kalimantan.jpg");
$("#mdlprintout a.malukupapua").attr("href", "ftp/HTH_jpg/Das "+num1+" "+omonth1_short+" "+oyear1+"/PetaMonitoringHariTanpaHujan-MalukuPapua.jpg");
$("#mdlprintout a.sulawesi").attr("href", "ftp/HTH_jpg/Das "+num1+" "+omonth1_short+" "+oyear1+"/PetaMonitoringHariTanpaHujan-Sulawesi.jpg");
$("#mdlprintout a.sumatera").attr("href", "ftp/HTH_jpg/Das "+num1+" "+omonth1_short+" "+oyear1+"/PetaMonitoringHariTanpaHujan-Sumatera.jpg");
}
maptitle.push(maptitle_hth);
$("#mapprint").show();
$("#maplegend_hth").show();
}else{
$("#maplegend_hth").hide();
$("#mapprint").hide();
}
if($("input[value='spi_ps3m']").is(":checked")){
if(layername == "spi_ps3m"){
maptitle_spi_ps3m = "PRAKIRAAN INDEKS PRESIPITASI TERSTANDARISASI (SPI) 3 BULANAN
"+omonth1.toUpperCase()+" - "+omonth1_p2.toUpperCase()+" "+oyear1;
layer_spi_ps3m.getSource().updateParams({
'LAYERS': 'spi_ps3m,prov,kabkot',
'date': date1
});
}
maptitle.push(maptitle_spi_ps3m);
$("#maplegend_spi_ps3m").show();
}else{
$("#maplegend_spi_ps3m").hide();
}
if($("input[value='spi_as1m']").is(":checked")){
if(layername == "spi_as1m"){
maptitle_spi_as1m = "INDEKS PRESIPITASI TERSTANDARISASI (SPI) 1 BULANAN
"+omonth1.toUpperCase()+" "+oyear1;
layer_spi_as1m.getSource().updateParams({
'LAYERS': 'spi_as1m,prov,kabkot',
'date': date1
});
}
maptitle.push(maptitle_spi_as1m);
$("#maplegend_spi_as1m").show();
}else{
$("#maplegend_spi_as1m").hide();
}
if($("input[value='spi_as3m']").is(":checked")){
if(layername == "spi_as3m"){
maptitle_spi_as3m = "INDEKS PRESIPITASI TERSTANDARISASI (SPI) 3 BULANAN
"+omonth1_m2.toUpperCase()+" - "+omonth1.toUpperCase()+" "+oyear1;
layer_spi_as3m.getSource().updateParams({
'LAYERS': 'spi_as3m,prov,kabkot',
'date': date1
});
}
maptitle.push(maptitle_spi_as3m);
$("#maplegend_spi_as3m").show();
}else{
$("#maplegend_spi_as3m").hide();
}
if($("input[value='pch_prob_1m']").is(":checked")){
if(layername == "pch_prob_1m"){
maptitle_pch_prob_1m = "PETA PRAKIRAAN CURAH HUJAN
"+omonth1.toUpperCase()+" "+oyear1+"
PELUANG HUJAN < 20MM";
layer_pch_prob_1m.getSource().updateParams({
'LAYERS': 'pch_prob,prov,kabkot',
'date1': date1,
'date2': date2,
});
}
maptitle.push(maptitle_pch_prob_1m);
$("#maplegend_pch_prob_1m").show();
}else{
$("#maplegend_pch_prob_1m").hide();
}
if($("input[value='pch_prob_2m']").is(":checked")){
if(layername == "pch_prob_2m"){
maptitle_pch_prob_2m = "PETA PRAKIRAAN CURAH HUJAN
"+omonth1.toUpperCase()+" "+oyear1+"
PELUANG HUJAN < 20MM";
layer_pch_prob_2m.getSource().updateParams({
'LAYERS': 'pch_prob,prov,kabkot',
'date1': date1,
'date2': date2,
});
}
maptitle.push(maptitle_pch_prob_2m);
$("#maplegend_pch_prob_2m").show();
}else{
$("#maplegend_pch_prob_2m").hide();
}
if($("input[value='pch_prob_3m']").is(":checked")){
if(layername == "pch_prob_3m"){
maptitle_pch_prob_3m = "PETA PRAKIRAAN CURAH HUJAN
"+omonth1.toUpperCase()+" "+oyear1+"
PELUANG HUJAN < 20MM";
layer_pch_prob_3m.getSource().updateParams({
'LAYERS': 'pch_prob,prov,kabkot',
'date1': date1,
'date2': date2,
});
}
maptitle.push(maptitle_pch_prob_3m);
$("#maplegend_pch_prob_3m").show();
}else{
$("#maplegend_pch_prob_3m").hide();
}
if($("input[value='pch_prob_das']").is(":checked")){
if(layername == "pch_prob_das"){
maptitle_pch_prob_das = "PETA PRAKIRAAN CURAH HUJAN
DASARIAN "+romawi(num1)+" "+omonth1.toUpperCase()+" "+oyear1+"
PELUANG HUJAN < 20 MM
UPDATE "+odate2+" "+omonth2.toUpperCase()+" "+oyear2+"";
layer_pch_prob_das.getSource().updateParams({
'LAYERS': 'pch_prob_das,prov,kabkot',
'date1': date1,
'date2': date2,
'num': num1,
});
}
maptitle.push(maptitle_pch_prob_das);
$("#maplegend_pch_prob_das").show();
}else{
$("#maplegend_pch_prob_das").hide();
}
if($("input[value='pem']").is(":checked")){
if(layername == "pem"){
maptitle_pem = "PETA SEBARAN POTENSI ENERGI MATAHARI
PERIODE 5 TAHUN";
layer_pem.getSource().updateParams({
'LAYERS': 'pem,prov,kabkot',
'date': date1
});
}
maptitle.push(maptitle_pem);
$("#maplegend_pem").show();
}else{
$("#maplegend_pem").hide();
}
if($("input[value='titikstationmatahari']").is(":checked")){
if(layername == "titikstationmatahari"){
maptitle_titikstationmatahari = "PETA SEBARAN TITIK STASIUN PEMANTAU
ENERGI MATAHARI";
layer_titikstationmatahari.getSource().updateParams({
'LAYERS': 'titikstationmatahari,prov,kabkot'
});
}
maptitle.push(maptitle_titikstationmatahari);
$("#maplegend_titikstationmatahari").show();
}else{
$("#maplegend_titikstationmatahari").hide();
}
if($("input[value='pea']").is(":checked")){
if(layername == "pea"){
maptitle_pea = "PETA SEBARAN POTENSI ENERGI ANGIN
PERIODE 5 TAHUN";
layer_pea.getSource().updateParams({
'LAYERS': 'pea,prov,kabkot',
'date': date1
});
}
maptitle.push(maptitle_pea);
$("#maplegend_pea").show();
}else{
$("#maplegend_pea").hide();
}
if($("input[value='analisiscurahhujan']").is(":checked")){
if(layername == "analisiscurahhujan"){
maptitle_analisiscurahhujan = "Analisis Curah Hujan Bulanan";
layer_analisiscurahhujan.getSource().updateParams({
'LAYERS': 'analisiscurahhujan,prov,kabkot',
'date': date1
});
}
maptitle.push(maptitle_analisiscurahhujan);
$("#maplegend_analisiscurahhujan").show();
}else{
$("#maplegend_analisiscurahhujan").hide();
}
if($("input[value='analisissifathujan']").is(":checked")){
if(layername == "analisissifathujan"){
maptitle_analisissifathujan = "Analisis Sifat Hujan Bulanan";
layer_analisissifathujan.getSource().updateParams({
'LAYERS': 'analisissifathujan,prov,kabkot',
'date': date1
});
}
maptitle.push(maptitle_analisissifathujan);
$("#maplegend_analisissifathujan").show();
}else{
$("#maplegend_analisissifathujan").hide();
}
if(maptitle.length > 0){
$("#maptitle").show();
$("#maptitle").html(maptitle.join(", "));
$("#legendcontainer").show();
}else{
$("#maptitle").hide();
$("#legendcontainer").hide();
}
infodetails.setPosition(undefined);
}
function setLegend(layername, date1, date2, num1){
var legendsetting;
switch(layername){
case "pdie":
legendsetting = legend_pdie;
$("#mapannotation").hide();
legendtext = "Peringatan Dini Iklim";
break;
case "pcht_das":
legendsetting = legend_pcht_das;
$("#mapannotation").hide();
legendtext = "Peringatan Dini Curah Hujan Tinggi";
break;
case "hth":
legendsetting = legend_hth_das_view;
$("#mapannotation").hide();
legendtext = "Hari Tanpa Hujan";
break;
case "spi_ps3m":
legendsetting = legend_spi;
$("#mapannotation").hide();
legendtext = "SPI Prakiraan 3 Bulan";
break;
case "spi_as1m":
legendsetting = legend_spi;
$("#mapannotation").hide();
legendtext = "SPI Analisa 1 Bulan";
break;
case "spi_as3m":
legendsetting = legend_spi;
$("#mapannotation").hide();
legendtext = "SPI Analisa 3 Bulan";
break;
case "pch_prob_1m":
legendsetting = legend_pch_prob;
$("#mapannotation").hide();
legendtext = "Prakiraan Curah Hujan Bulanan (1 Bulan)";
break;
case "pch_prob_2m":
legendsetting = legend_pch_prob;
$("#mapannotation").hide();
legendtext = "Prakiraan Curah Hujan Bulanan (2 Bulan)";
break;
case "pch_prob_3m":
legendsetting = legend_pch_prob;
$("#mapannotation").hide();
legendtext = "Prakiraan Curah Hujan Bulanan (3 Bulan)";
break;
case "pch_prob_das":
legendsetting = legend_pch_prob_das;
$("#mapannotation").hide();
legendtext = "Prakiraan Curah Hujan Dasarian";
break;
case "pem":
legendsetting = legend_pem;
$("#mapannotation").html("Disclaimer: Data dari tahun 2011-2019");
$("#mapannotation").show();
legendtext = "XXXXXXX";
break;
case "pea":
legendsetting = legend_pea;
$("#mapannotation").html("Disclaimer: Data dari tahun 2011-2019");
$("#mapannotation").show();
legendtext = "XXXXXXX";
break;
case "titikstationmatahari":
legendsetting = legend_titikstationmatahari;
$("#mapannotation").hide();
legendtext = "XXXXXXX";
break;
case "analisiscurahhujan":
legendsetting = legend_analisiscurahhujan;
$("#mapannotation").hide();
legendtext = "XXXXXXX";
break;
case "analisissifathujan":
legendsetting = legend_analisissifathujan;
$("#mapannotation").hide();
legendtext = "XXXXXXX";
break;
}
var html="";
if(layername=="hth"){
html+=""+legendtext+" |
";
}else{
html+=""+legendtext+" |
";
}
for(var i=0;i"+legendsetting[i][0]+" | | "+legendsetting[i][2]+" | ";
}else{
html+=" | "+legendsetting[i][2]+" |
";
}
}
html+="
";
$("#areacoverage").hide();
$('#areaawas').show();
$("#maplegend tr").unbind();
$("#maplegend_"+layername).html(html);
if(layername!="titikstationmatahari"){
$("#maplegend_"+layername+" tr.trlegend").unbind().click(function(){
$("#areaawas").hide();
setAreaCoverage($(this).attr("layername"), $(this).attr("legendindex"), date1, date2, num1);
});
}
}
function setAreaCoverage(layername, legendindex, date1, date2, num1){
$("#mapannotation").hide();
$("#areacoverage").show();
$("#areacoverage-content").html("Loading...");
$.post("areacoverage.php?req=getareacoverage", {
layername:layername,
legendindex:legendindex,
date1:date1,
date2:date2,
num1:num1
},function(data){
if(jQuery.isEmptyObject(data)){
$("#areacoverage-content").html("Wilayah tidak ditemukan");
}else{
var html="";
for(var i=0;i";
html+=""+data[i].prov+"
";
html+="";
for(var j=0;j"+data[i].kabkot[j]+"
";
}
html+="";
html+="";
}
$("#areacoverage-content").html(html);
}
});
}
function showSubInfo(selector){
$("#mdlsubinfo .modal-body").html("");
var data = selector.attr("data");
var target = selector.attr("target");
var title = "";
var src = "";
switch(data){
case "riwayatpenyinaran":
title = "Riwayat Penyinaran Matahari";
src = "ftp/Isi_dari_titik_energi_matahari/LPM/" + target +".png";
break;
case "potensienergi":
title = "Potensi Energi Matahari";
src = "ftp/Isi_dari_titik_energi_matahari/Potensi Energi Matahari/" + target +".png";
break;
case "tutupanawan":
title = "Persentase Tutupan Awan";
src = "ftp/Isi_dari_titik_energi_matahari/grafik awan/" + target +".png";
break;
case "suhu":
title = "Suhu Diurnal";
src = "ftp/Isi_dari_titik_energi_matahari/Suhu/" + target +".png";
break;
case "wind":
title = "Wind Rose";
src = "ftp/Isi_dari_titik_energi_matahari/Angin/" + target +".png";
break;
case "beneningan":
title = "Indeks Kebeningan";
src = "ftp/Isi_dari_titik_energi_matahari/Indeks Kebeningan/" + target +".png";
break;
}
$("#mdlsubinfo").modal("show");
$("#mdlsubinfo .modal-title").html(title);
$("#mdlsubinfo .modal-body").html("");
}
function romawi(num){
switch(Number(num)){
case 1:
return "I";
case 2:
return "II";
case 3:
return "III";
case 4:
return "IV";
case 5:
return "V";
}
}