'); mywindow.document.close(); // necessary for IE >= 10 mywindow.focus(); // necessary for IE >= 10 mywindow.print(); mywindow.close(); return true; } function initialize(pw) {//browserZoom = window.outerWidth / window.innerWidth;// browserZoom hard coded to 1. on 08/25/2023 (KSL). Yields best downloads.browserZoom = 1.;var pw = pw || false;//$("#green").fitText(0.2); $('#obsTempsChgPointRange').find('.ui-slider-handle').eq(0).text('>'); $('#obsTempsChgPointRange').find('.ui-slider-handle').eq(1).text('<');if (document.getElementById('droughtMonDateBox')) {var val = document.getElementById('droughtMonDateBox').value;var date = new Date(Date.parse(val.substr(4,2) + "/" + val.substr(6,2) + "/" + val.substr(0,4)) + 2*86400000);//alert(val+" "+val.substr(4,2) + "/" + val.substr(6,2) + "/" + val.substr(0,4));document.getElementById('droughtMonDate').innerHTML = "Selection Valid: " + val.substr(4,2) + "/" + val.substr(6,2) + "/" + val.substr(0,4) + "Issued: " + date.f("MM/dd/yyyy");}if (document.getElementById('NOHRSCDateBox')) {var val = document.getElementById('NOHRSCDateBox').value;document.getElementById('NOHRSCDate').innerHTML = "Selected date: " + val.substr(4,2) + "/" + val.substr(6,2) + "/" + val.substr(0,4);} var boxes = document.getElementsByName("box"); for(var i = 0; i < boxes.length; i++) { //boxes[i].checked = false;} var briefing = "0"; var centerLat = parseFloat(38.02); var centerLon = parseFloat(-120); var zoomLevel = parseInt(6); //var attribution = new ol.control.Attribution({ //label: 'Tiles © ArcGIS'//}); var attribution = 'Tiles © ArcGIS'; //var attributionNM = new ol.control.Attribution({ //label: 'Tiles © The National Map'//}); var attributionNM = 'Tiles © The National Map'; esriTopo = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous', url: https+'://server.arcgisonline.com/ArcGIS/rest/services/' + 'World_Topo_Map/MapServer/tile/{z}/{y}/{x}' }), zIndex: 0 }) topo2 = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous', url: https+'://server.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}' //url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}' //url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}' }), zIndex: 0 }) satBG1 = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous', url: https+'://server.arcgisonline.com/ArcGIS/rest/services/' + 'World_Imagery/MapServer/tile/{z}/{y}/{x}' }), zIndex: 0 }) satBG2 = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous', url: https+'://server.arcgisonline.com/ArcGIS/rest/services/' + 'Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}' }), zIndex: 1050 }) satBG3 = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous', url: https+'://server.arcgisonline.com/ArcGIS/rest/services/' + 'Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}' }), zIndex: 1051 })topo3 = new ol.layer.Tile({source: new ol.source.XYZ({attributions: [attribution],url: https+'://wtb.maptiles.arcgis.com/arcgis/rest/services/World_Topo_Base/MapServer/tile/{z}/{y}/{x}',crossOrigin: 'anonymous',//url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}'}),zIndex: 0,opacity: 0.7}) citiesLayer = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous', //url: 'http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}'//url: 'http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}'url: https+'://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}' }), zIndex: 1050 })roadsLayer = new ol.layer.Tile({source: new ol.source.XYZ({url: https+'://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}',crossOrigin: 'anonymous',}), zIndex: 1049, opacity: 0.8}); lightGrayLayer = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous',url: https+'://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}' }), zIndex: 0 }); lightGrayCitiesLayer = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous',url: https+'://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}' }), zIndex: 1050 }); shadedRelief = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous',url: https+'://services.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}' }), zIndex: 0 });federalLands = new ol.layer.Tile({source: new ol.source.XYZ({attributions: [attribution],url: https+'://gis.blm.gov/arcgis/rest/services/lands/BLM_Natl_SMA_Cached_without_PriUnk/MapServer/tile/{z}/{y}/{x}',crossOrigin: 'anonymous',//url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}'}),zIndex: 0,//opacity: 0.7});federalLandsReference = new ol.layer.Tile({source: new ol.source.XYZ({attributions: [attribution],url: https+'://gis.blm.gov/arcgis/rest/services/lands/BLM_Natl_SMA_LimitedScale/MapServer/tile/{z}/{y}/{x}',crossOrigin: 'anonymous',//url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}'}),zIndex: 1050,//opacity: 0.1});/*federalLands = new ol.layer.Tile({source: new ol.source.XYZ({attributions: [attribution],url: https+'://gis.blm.gov/arcgis/rest/services/lands/BLM_Natl_SMA_LimitedScale/MapServer/tile/{z}/{y}/{x}',//crossOrigin: 'anonymous',//url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}'}),zIndex: 0,opacity: 0.7})*//*streetMap = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous', url: 'http://server.arcgisonline.com/ArcGIS/rest/services/' + 'World_Street_Map/MapServer/tile/{z}/{y}/{x}' }) })*/natGeoMap = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous', url: https+'://services.arcgisonline.com/ArcGIS/rest/services/' + 'NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}' }), zIndex: 0 }); oceans = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous', url: https+'://services.arcgisonline.com/arcgis/rest/services/' + 'Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}' }), zIndex: 0 }); oceansReference = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attribution],crossOrigin: 'anonymous', url: https+'://services.arcgisonline.com/arcgis/rest/services/' + 'Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}' }), zIndex: 1050 });/* hucs = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attributionNM],//crossOrigin: 'anonymous', url: https+'://basemap.nationalmap.gov/arcgis/rest/services/' + 'USGSHydroCached/MapServer/tile/{z}/{y}/{x}' }), zIndex: 0 })*/ hucs = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attributionNM],crossOrigin: 'anonymous', url: https+'://basemap.nationalmap.gov/arcgis/rest/services/' + 'USGSTopo/MapServer/tile/{z}/{y}/{x}' }), zIndex: 0 });extentRadar = ol.proj.transformExtent([-126, 24, -66, 50], 'EPSG:4326', 'EPSG:3857');/* hucs = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: [attributionNM],crossOrigin: 'anonymous', url: https+'://basemap.nationalmap.gov/arcgis/rest/services/nhd/MapServer/tile/{z}/{y}/{x}' }), zIndex: 0 }) */ map = new ol.Map({ target: document.getElementById('map'), controls: ol.control.defaults.defaults().extend([new ol.control.FullScreen(),new ol.control.ZoomToExtent({label: '', className: 'homeIcon', extent: [-14171628.876147104, 3750616.659747102, -12545048.914238555, 5413886.395232537]})]),layers: [topo3,citiesLayer,roadsLayer],//layers: [esriTopo], /*layers: [ new ol.layer.Tile({ source: new ol.source.MapQuest({layer: 'osm'})//source: new ol.source.TileWMS({ // url: 'http://demo.opengeo.org/geoserver/wms', // params: { // 'LAYERS': 'ne:NE1_HR_LC_SR_W_DR' // } //}) }) ],*/ view: new ol.View({ //projection: 'EPSG:4326', center: ol.proj.transform([centerLon, centerLat], 'EPSG:4326', 'EPSG:3857'), //center: [-119.25,38.15], zoom: zoomLevel, constrainResolution: true }) }); markerLayer = new ol.layer.Vector({ source: new ol.source.Vector({})}); var listener = markerLayer.getSource().on('change', function(e) {layerLoaded = true;console.log('markers loaded');//if (markerLayer.getSource().getState() == 'ready') {//ol.Observable.unByKey(listener);////callback();//} }); //console.log(map.getView());/*map.getView().on('change:layerGroup',function() {console.log('put cities back on top');map.removeLayer(citiesLayer);map.addLayer(citiesLayer);});*///var select = new ol.interaction.Select();//map.addInteraction(select);//selectedFeatures = select.getFeatures();popupDIV = document.getElementById('popup');popupDIVcontent = document.getElementById('popup-content');popup = new ol.Overlay({ element: popupDIV, positioning: 'top-center', stopEvent: true, offset: [4,-25], insertFirst: true, autoPan: true});map.addOverlay(popup);closer = document.getElementById('popup-closer');/** * Add a click handler to hide the marker popup. * @return {boolean} Don't follow the href. */closer.onclick = function() { popup.setPosition(undefined); //map.removeOverlay(popup); closer.blur(); return false;};popupGEODIV = document.getElementById('popupGEO');popupDIVcontentGEO = document.getElementById('popup-contentGEO');popupGEO = new ol.Overlay({ element: popupGEODIV, positioning: 'top-center', stopEvent: true, offset: [0,-10], insertFirst: true, //autoPan: true});map.addOverlay(popupGEO);var closerGEO = document.getElementById('popup-closerGEO');/** * Add a click handler to hide the geocode popup. * @return {boolean} Don't follow the href. */closerGEO.onclick = function() { popupGEO.setPosition(undefined); closerGEO.blur(); return false;}; /* map.on('postcompose', function(event) { var canvas = event.context.canvas;context = canvas.getContext('2d'); base_image = new Image(); base_image.src = '/data/icons/logos/google_nws_noaa.png'; base_image.onload = function(){ context.drawImage(base_image, 45, 5); }; }); */ // Default imageBounds for GFE gridded overlays. window.imageBounds = ol.proj.transformExtent([-124.48,32.5,-114.105,43.375],'EPSG:4326','EPSG:3857'); // Unprojected imageBounds for GFE gridded overlays. window.imageBoundsMQCcustom = [-124.48,32.5,-114.105,43.375]; // imageBounds for radar overlay. window.imageBoundsRadar = ol.proj.transformExtent([-127.6203750,27.94249444,-112.5244778,49.50806111],'EPSG:4326','EPSG:3857'); // imageBounds for NOHRSC overlays. window.imageBoundsNOHRSC = ol.proj.transformExtent([-126.25,24.1,-62.25,53.96666667],'EPSG:4326','EPSG:3857'); window.imageBoundsNOHRSC4326 = [-126.25,24.1,-62.25,53.96666667];var CNRFC = "";if (CNRFC == "") {toggleOverlay(true, "CNRFC", 'none');}//unloadMarkers(['all']); var prod = ""; var year = "2024"; var month = "Jun"; var curmo2 = ""; // if (prod == "SWEbasins") {//toggleKML2Area(true,'SWEbasins',0,month,year,'waterResources');//if (briefing == 0) {// document.getElementById('archiveAreasnow').checked=true;//}// } else if (prod=="hucPrecip") {//if (briefing == 0) {//document.getElementById('archiveAreaprecip').checked=true;//}// } var typeID = "wwa"; var scriptID = "toggleWWA"; var productID = "wwa"; var foundProduct = "0"; var setCheckMark = ""; var time = ""; var PNGtypeID = ""; var cursorReadout = ""; var showElev = ""; var useEst = ""; var id2ID = ""; var typeID2 = "wwa"; var scriptID2 = "toggleWWA"; var productID2 = "wwa"; var foundProduct2 = "0"; var setCheckMark2 = ""; var overlays = ["CNRFC","STATES","COUNTIES","HYDROGRAPHY","MAJORRIVERS","BASINS","BURNAREAS1","NATIONALPARKS","WFOS","LAKES"]; var overlayValues = ["","","","","","","","","",""]; var overlaysTile = []; var overlayTileValues = []; var filters = ["Elev","QPEPoint","obsTempsPoint","obsTempsChgPoint","SWEPoint","SWEChg","SDPoint","SDChg","waterTempsPoint","peakDates"]; var filterMax = ["-9999","-9999","-9999","-9999","-9999","-9999","-9999","-9999","-9999",""]; var filterMin = ["-9999","-9999","-9999","-9999","-9999","-9999","-9999","-9999","-9999",""]; var typesOpacity = ["riverReservoir","radar","QPE","QPF","obsTemps","fcstTemps","FzLevel","FFG","QPFverif","waterResources","snow","wwa"]; // var opacities = ; var opacity = -1; var controlsDocked = true; var typesAnimate = ["radarrefl","QPE6hr","QPF6hr","QPF24hr","TempObs6hr","MaxTFcstMaxT","MinTFcstMinT","FzLevel6hrObs","FzLevel6hrFcst"]; var animate = ["","","","","","","","",""]; var animateSpeed = ["-1","-1","-1","-1","-1","-1","-1","-1","-1"]; var precipToggle = ""; var obsTempsChgInvert = ""; var origExtent = ""; if (obsTempsChgInvert == "true") { document.getElementById('obsTempsChgInvert').checked = true; document.querySelector('#obsTempsChgPointRange .ui-slider-range').style.backgroundColor = 'white'; document.getElementById('obsTempsChgPointRange').style.backgroundColor = '#1763AB'; $('#obsTempsChgPointRange').find('.ui-slider-handle').eq(0).text('<'); $('#obsTempsChgPointRange').find('.ui-slider-handle').eq(1).text('>'); } if (precipToggle == "precipDots") { document.getElementById('precipDots').checked = true; } var cat = ["","","","","","",""]; if (id2ID != '') { if (document.getElementById(id2ID) && (id2ID == productID || (id2ID == productID2))) { window.id2 = id2ID; } } else { window.id2 = id2ID; } /* for (var i = 0; i < typesOpacity.length; i++) { var type = typesOpacity[i]; //alert(overlay+" " +overlayValues[i]); if (opacities[i] > -1 && opacities[i] <= 100) { $('#'+type+'slider').slider('value',opacities[i]); } } */ if (opacity > -1 && opacity <= 100) { $('#imageslider').slider('value',opacity); } if (controlsDocked == false && 0 == 0 ) { toggleDataControls(); } for (var i = 0; i < typesAnimate.length; i++) { var type = typesAnimate[i]; //alert(overlay+" " +overlayValues[i]); if (document.getElementById(type+'Animate')) { if (animate[i] == "true") { document.getElementById(type+'Animate').checked = true; } else if (animate[i] == "false") { document.getElementById(type+'Animate').checked = false; } } if (animateSpeed[i] > -2000 && animateSpeed[i] <= -100) { $('#'+type+'speed').slider('value',animateSpeed[i]); PNGanimateSpeed[type]= -1*animateSpeed[i]; } } for (var i = 0; i < overlays.length; i++) { var overlay = overlays[i]; //alert(overlay+" " +overlayValues[i]); if (overlayValues[i] == "true") { document.getElementById(overlay).checked = true; toggleOverlay(true,overlay,'none'); } if (overlayValues[i] == "false") { document.getElementById(overlay).checked = false; toggleOverlay(false,overlay,'none'); } } for (var i = 0; i < overlaysTile.length; i++) { var overlay = overlaysTile[i]; //console.log(overlay+" " +overlayTileValues[i]); if (overlayTileValues[i] == "true") { document.getElementById(overlay).checked = true; toggleTile(true,overlay,'none'); } if (overlayValues[i] == "false") { document.getElementById(overlay).checked = false; toggleTile(false,overlay,'none'); } } for (var i = 0; i < filters.length; i++) { var filter = filters[i]; var filterMaxName = filter+"Max"; var filterMinName = filter+"Min"; var countFilters = 0; //alert("length "+filters.length+" filter "+filter+" Max "+filterMax[i]+" Exists: "+document.getElementById(filterMaxName)+" Max: "+filterMax[i]); if (document.getElementById(filterMaxName) && filterMax[i] != -9999 && filterMax[i] != "") { document.getElementById(filterMaxName).value = filterMax[i]; countFilters++; } if (document.getElementById(filterMinName) && filterMin[i] != -9999 && filterMin[i] != "") { document.getElementById(filterMinName).value = filterMin[i]; countFilters++; } if (countFilters > 0) { document.getElementById(filter+"Apply").click(); } } //alert(foundProduct); if (foundProduct == 1) { manageFilters(true,productID);for (var i = 0; i < cat.length; i++) {cat2 = cat[i];j=i+1;if (document.getElementById('cat'+j)) {if (cat2 == "true") {document.getElementById('cat'+j).checked = true;} else if (cat2 == "false") {document.getElementById('cat'+j).checked = false;}}}if (document.getElementById('cursorReadout')) {document.getElementById('cursorReadout').checked = true;}if (document.getElementById('showElev')) {if (showElev != "false") {document.getElementById('showElev').checked = true;}}if (document.getElementById('useEst')) {if (useEst == "true") {document.getElementById('useEst').checked = true;} else if (useEst == "false") {document.getElementById('useEst').checked = false;}} if (document.getElementById(setCheckMark)) { document.getElementById(setCheckMark).checked = true; } //alert(setCheckMark); //Start product window.imageType = productID; if (scriptID=="toggleKMLRivFcst") { if(productID.substr(0,4) == "fcst") {window[scriptID](true,productID,0.0,typeID,'fcst'); } else { window[scriptID](true,productID,0.0,typeID,'other'); } } else if (scriptID=="toggleKMLRivFcst2") {window[scriptID](true,productID,0.0,typeID,'fcst'); } else if (scriptID=="toggleKML1" || scriptID=="toggleKML2" || scriptID=="toggleKML3") { window[scriptID](true,productID,-30.0,typeID); } else if (scriptID=="toggleKML2Area") { if (briefing == "1") { window['loadKML1Area'](true,productID,month,year,'waterResources'); } else { window[scriptID](true, productID, 0, document.getElementById('month'+typeID).value,document.getElementById('year'+typeID).value, typeID); } } else if (scriptID=="toggleKML2AreaDaily") { if (briefing == "1") { window['loadKML1Area'](true,productID,month,year,'waterResources'); } else { window[scriptID](true, productID, 0, document.getElementById('month'+typeID).value,document.getElementById('year'+typeID).value, typeID, false, document.getElementById('day'+typeID).value); } } else if (scriptID=="toggleOverlay") { window[scriptID](true,productID,typeID); } else if (scriptID=="togglePNG") { window[scriptID](PNGtypeID,true,time,productID); } else if (scriptID=="toggleWWA" || scriptID=="toggleTile") { window[scriptID](true,productID,typeID); } else if (scriptID == "whichPlottingFunction") { window[scriptID](true,productID,0,document.getElementById('month'+typeID).value,document.getElementById('year'+typeID).value,typeID); } } //Start product2if (foundProduct2 == 1) { window.imageType = productID2; manageFilters(true,productID2);//alert(setCheckMark2);if (document.getElementById(setCheckMark2)) { document.getElementById(setCheckMark2).checked = true; } if (scriptID2=="toggleKMLRivFcst") { if(productID2.substr(0,4) == "fcst") {window[scriptID2](true,productID2,0.0,typeID2,'fcst'); } else { window[scriptID2](true,productID2,0.0,typeID2,'other'); } } else if (scriptID2=="toggleKMLRivFcst2") {window[scriptID2](true,productID2,0.0,typeID2,'fcst'); } else if (scriptID2=="toggleKML1" || scriptID2=="toggleKML2" || scriptID2=="toggleKML3") { window[scriptID2](true,productID2,-30.0,typeID2); } else if (scriptID2=="toggleKML2Area") { if (briefing == "1") { window['loadKML1Area'](true,productID2,month,year,typeID2); } else { window[scriptID2](true, productID2, 0, document.getElementById('month'+typeID2).value,document.getElementById('year'+typeID2).value, typeID2); } } else if (scriptID2=="toggleKML2AreaDaily") { if (briefing == "1") { window['loadKML1Area'](true,productID2,month,year,typeID2); } else { window[scriptID2](true, productID2, 0, document.getElementById('month'+typeID2).value,document.getElementById('year'+typeID2).value, typeID2,false,document.getElementById('day'+typeID2).value); } } else if (scriptID2=="toggleOverlay") { window[scriptID2](true,productID2,typeID2); } else if (scriptID2=="togglePNG") { window[scriptID2](PNGtypeID,true,time,productID2); } else if (scriptID2=="toggleWWA" || scriptID2=="toggleTile") { window[scriptID2](true,productID2,typeID2); } else if (scriptID2 == "whichPlottingFunction") { window[scriptID2](true,productID2,0,document.getElementById('month'+typeID2).value,document.getElementById('year'+typeID2).value,typeID2); console.log(document.getElementById('month'+typeID2).value + "/" + document.getElementById('year'+typeID2).value); } } if (briefing == "0") { loadStns(); } prevZoom = parseInt(map.getView().getZoom()); if (briefing == "1") { map.getView().on('change:resolution',function() { if (!markersLoaded) { return; } var newLevel = parseInt(map.getView().getZoom()); oldLevel = prevZoom; prevZoom = newLevel; //alert("Zoom was changed from "+oldLevel+ " to "+newLevel+"!"); var mode = $('#loadMode').val(); //abc123 //console.log(mode + " " + oldLevel + " " + newLevel + " " + neverZoomed); if (mode == "default" && ((oldLevel <=7 && newLevel >=8) || (neverZoomed == 1 && newLevel >=8))) { //alert('switching to percentages'); if (markerTypes && markerTypes.length) { unloadMarkers(['all'],true,false);loadMarkers(window.textRes2,true); } //document["legend1"].src = legendAltSrc; } else if (oldLevel >=8 && newLevel <=7 && mode == "default") { //alert('switching to dots'); if (markerTypes && markerTypes.length) { unloadMarkers(['all'],true,true); loadMarkers(window.textRes2); } //document["legend1"].src = legendSrc; } neverZoomed = 0;}); //End zoom_change } loadedFirstTime = 0; map.once('postcompose',function(event) { if (loadedFirstTime) { return; } //console.log('tiles loaded'); loadedFirstTime = 1; var mapBG = "topo3"; if (mapBG != "topo3") { toggleMapBG(mapBG); } /* var MapOptions = ""; document.getElementById('MapOptionsLbl').style.display = 'inline'; document.getElementById('MapOptions').style.display = 'inline'; if (MapOptions == "false") { document.getElementById('MapOptions').value = false; toggleMap("false"); } */var mode = "";var product = ""; ; var zoomLevel = parseInt(map.getView().getZoom()); var len = markersList.length; if (briefing == "0") {updateTextMaster();window.setInterval(function(){updateTextMaster()},timeRefreshInterval); } else { document.getElementById('loadMode').value = mode; if (product != "SWENOHRSC" && product != "SWE7DayChange" && product != "SWE0" && product.substr(0,3) != "huc" && product.substr(0,4) != "peak" && product.substr(0,9) != "SWEbasins") { document.getElementById('loadModeLbl').style.display = 'inline'; document.getElementById('loadMode').style.display = 'inline'; } } if (0) {findSelected();//clickDataType(4);if (0) {prod = 'ForecastFlow';if ($('#' + prod)) {$('#' + prod).click();}} else {if ($('#ForecastFlow')) {$('#ForecastFlow').click();}} } if (pw) { toggleKML1(true, "gpsIPW", 0,"PW",150) } }); //test = new ol.maps.GroundOverlay("/new.png",window.imageBounds); //test.setMap(gmap); //test.setOpacity(0.65); dataCheckClick(); /* console.log(map.getView().on.getProperties); */ /* map.getView().on('change:resolution',function() { //console.log("Let's count some points, shall we?"); //console.log(map.getView().calculateExtent(map.getSize())); var featuresinBox = []; markerLayer.getSource().forEachFeature(function(e) { if (ol.extent.containsCoordinate(map.getView().calculateExtent(map.getSize()), e.getGeometry().getCoordinates())) { featuresinBox.push(e); } }); console.log("Hey, I found "+featuresinBox.length+" points on the map!!"); }); */ /* map.on('moveend',function() { //console.log("Let's count some points, shall we?"); //console.log(map.getView().calculateExtent(map.getSize())); var featuresinBox = []; if (markerLayer && checkLayer(markerLayer)) { markerLayer.getSource().forEachFeature(function(e) { if (ol.extent.containsCoordinate(map.getView().calculateExtent(map.getSize()), e.getGeometry().getCoordinates())) { featuresinBox.push(e); } }); console.log("Hey, I found "+featuresinBox.length+" points on the map!!"); } }); */ map.on('postrender',function() { if (!highlighted) { markerCount() } checkPostRender(); });function sleep(ms) {return new Promise(resolve => setTimeout(resolve, ms));}origExtent = map.getView().calculateExtent();function onMoveEnd(evt){if (document.getElementById('wwa').checked) {drawWWALegend();}}map.on('moveend', onMoveEnd); /* map.getView().on('change:center',function() { //console.log("Let's count some points, shall we?"); //console.log(map.getView().calculateExtent(map.getSize())); var featuresinBox = []; markerLayer.getSource().forEachFeature(function(e) { if (ol.extent.containsCoordinate(map.getView().calculateExtent(map.getSize()), e.getGeometry().getCoordinates())) { featuresinBox.push(e); } }); console.log("Hey, I found "+featuresinBox.length+" points on the map!!"); }); */ /**/ var dataTable = "false"; if (dataTable == "true") { $("#markerTable").dialog("open"); } } var images = new Array(); //var imagesIn = new Array('/data/icons/homeIconHover.png'); //preload(imagesIn); function checkLayer(layer) { var res = false; for (var i=0;i ' + feature.get('phenomenon') + " " + feature.get('significance') + ' ' + feature.get('phenomenon') + " " + feature.get('significance') + ' "+banner+" '+content1[j]+' ';//html = html +content1;//html = html + ' ";return html;} var typeNum = parseInt(""); $(function() { window.mapBG2 = "topo3"; $( "#accordion" ).accordion({ collapsible: true,heightStyle: "content",active:typeNum});$( "#dialog-modal" ).dialog({height: 140,modal: true, autoOpen: false});$( "#noKML" ).dialog({height: 140,modal: true, autoOpen: false});$( "#mapBGdialog" ).dialog({autoOpen: false,//width: 550,width: 685,open: function (event, ui) {var mapBGs = ["topo3","topo2","esriTopo","shadedRelief","satBG","natGeoMap","oceans","hucs","lightGray","federalLands"];for (i=0; i HOME HYDROLOGY WEATHER CLIMATE RESEARCH / OUTREACH LINKS CNRFC Interactive Map Interface The number inside each circle above represents the number of gages with observed conditions inside that category. The number inside each circle above represents the number of gages with forecast conditions inside that category. The number inside each circle above/below represents the number of gages with conditions inside that category. Forecast The number inside each circle above represents the number of gages with observed conditions inside that category. The number inside each circle above represents the number of gages with forecast conditions inside that category. The number inside each circle above/below represents the number of gages with conditions inside that category. Observed This image is currently not available. Please try again later. The selected data is currently not available. Please check again later. The "Download PNG" feature is not available in this browser. Please try a different browser. Load a point data set to view data. Note: Please select a data type above to activate KML download section. Feedback / Comments: Email the CNRFC Webmaster with your feedback and comments. US Dept of Commerce Comments? Questions? Please Contact Us. Disclaimer Privacy Policy"); data = data.replace(" cfs "," "); data = data.replace(" Ft / "," "); data = data.replace(" Feet / "," "); data = data.replace(" cfs",""); data = data.replace(" acre-feet",""); data = data.replace("NA","-9999"); data = data.replace("NA","-9999"); } if (id == "CLKC1" && (product == "zeroFCST" || product == "oneFCST" || product == "twoFCST" || product == "threeFCST" || product == "zeroFCSTcombo" || product == "oneFCSTcombo" || product == "twoFCSTcombo" || product == "threeFCSTcombo")) { data = data + " acre-ft"; } idTest=id; if (obs && window.id2.substr(window.id2.length-5)=="combo") { idTest = id+"test"; }var iconFeature = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.transform([lonpoint,latpoint],'EPSG:4326','EPSG:3857')), html: html, river: river, location: location, color: color2, textColor: textColor, link2: link2, // type: 'marker', id: idTest, stn: stn, amt: data});iconFeature.setId(idTest);//iconFeature.setId(id);var iconStyle = new ol.style.Style({image: new ol.style.Icon({anchor: [0.5, 0.5],anchorXUnits: 'fraction',anchorYUnits: 'fraction',opacity: 1.0,src: url }),zIndex: zIndex});var iconStyleText = new ol.style.Style({text: new ol.style.Text({text: stn.replace(/\/$/, "").split('(').shift(),offsetY: 12,stroke: new ol.style.Stroke({color: 'white',width: 2}),}),zIndex: zIndex});iconFeatureText = jQuery.extend(true,new ol.Feature(),iconFeature);iconFeatureText.setStyle(iconStyleText);markerSourceText.addFeature(iconFeatureText);iconFeature.setStyle(iconStyle);iconFeature.set('type','marker');markerSource.addFeature(iconFeature); }function createMarkerWS(stn,latpoint,lonpoint,html,url,url2,num,file,elev,amt,info,zIndex,secondary){id = stn.match(/\([^()]*\)/g).pop().replace(/(\(|\))/g,"").replace(/(^\s+|\s+$)/g,"");zIndex = zIndex || false;secondary = secondary || false;var briefing = "0";//alert('hi');if (briefing == 0) {var maxElev = parseFloat(document.getElementById('ElevMax').value);var minElev = parseFloat(document.getElementById('ElevMin').value);var proceed = 0;if (file == "wsfcst" || file == "flow2dateWY" || file == "espfcst" || file == "espfcstWY") { if (elev >= minElev && elev <= maxElev) { if (document.getElementById('cat1').checked && amt <50) { proceed = 1; } else if (document.getElementById('cat2').checked && amt >=50 && amt < 70) { proceed = 1; } else if (document.getElementById('cat3').checked && amt >=70 && amt < 90) { proceed = 1; } else if (document.getElementById('cat4').checked && amt >=90 && amt < 110) { proceed = 1; } else if (document.getElementById('cat5').checked && amt >=110 && amt < 130) { proceed = 1; } else if (document.getElementById('cat6').checked && amt >=130 && amt < 150) { proceed = 1; } else if (document.getElementById('cat7').checked && amt >=150) { proceed = 1; } } } else { if (elev >= minElev && elev <= maxElev) { if (document.getElementById('cat1').checked && amt <50) { proceed = 1; } else if (document.getElementById('cat2').checked && amt >=50 && amt < 70) { proceed = 1; } else if (document.getElementById('cat3').checked && amt >=70 && amt < 90) { proceed = 1; } else if (document.getElementById('cat4').checked && amt >=90 && amt < 110) { proceed = 1; } else if (document.getElementById('cat5').checked && amt >=110 && amt < 130) { proceed = 1; } else if (document.getElementById('cat6').checked && amt >=130 && amt < 150) { proceed = 1; } else if (document.getElementById('cat7').checked && amt >=150) { proceed = 1; } } }} else {proceed = 1;} if (proceed == 0) {return 51;} if (num == 1) {var anchor = [0.32, 1.0];} else {var anchor = [0.5, 0.5];} /* marker.iconLevel1 = url;marker.iconLevel2 = url2;marker.latpoint = latpoint;marker.lonpoint = lonpoint;marker.info = html;*/var iconFeature = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.transform([lonpoint,latpoint],'EPSG:4326','EPSG:3857')), html: html, //type: 'marker', id: id, stn: stn, amt: amt});iconFeature.setId(id);var iconStyle = new ol.style.Style({image: new ol.style.Icon({anchor: anchor,anchorXUnits: 'fraction',anchorYUnits: 'fraction',opacity: 1.0,src: url }),zIndex: Math.abs(amt) * 100});var iconStyleText = new ol.style.Style({text: new ol.style.Text({text: stn.replace(/\/$/, "").split('(').shift(),offsetY: 5,stroke: new ol.style.Stroke({color: 'white',width: 2}),}),zIndex: Math.abs(amt) * 100});iconFeatureText = jQuery.extend(true,new ol.Feature(),iconFeature);iconFeatureText.setStyle(iconStyleText);markerSourceText.addFeature(iconFeatureText);iconFeature.setStyle(iconStyle);iconFeature.set('type','marker');if (!secondary) {markerSource.addFeature(iconFeature);} else {markerSource2.addFeature(iconFeature);} }var gridID = "";var gridIDarchive = "";var gridIDarchive2 = ""; function checkNewName(id) { id = id || "";// alert("caller is " + arguments.callee.caller.toString()); var briefing = "0"; if (briefing == 1) { return; } //alert("Old name: "+oldName+"\nNew name: "+name2+"\nID: "+id);if (id == "RADARPCPN"){thisID = "radarrefl";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;//document.getElementById(thisID).click();disablePNG('radar',false, 'refl', thisID);return;}}if (id == "radarrefl"){thisID = "RADARPCPN";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disableOverlay(false, thisID, 'precip')return;}} if (id == "radarrefl" || id == "RADARPCPN"){thisID = "QPE6hr";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('QPE',false, '6hr', thisID);document.getElementById('6hrQPEsection').style.display = 'none';return;}thisID = "QPE24hr";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('QPE',false, '24hr', thisID);document.getElementById('24hrQPEsection').style.display = 'none';return;}thisID = "QPE48hr";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('QPE',false, '48hr', thisID);document.getElementById('48hrQPEsection').style.display = 'none';return;}thisID = "QPE72hr";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('QPE',false, '72hr', thisID);document.getElementById('72hrQPEsection').style.display = 'none';return;}thisID = "QPE7day";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('QPE',false, '7day', thisID);document.getElementById('7dayQPEsection').style.display = 'none';return;}thisID = "QPEmonthly";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('MQC',false, 'custom', thisID);return;}thisID = "QPEmonthlyPercentNormal";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('MQC',false, 'custom', thisID);return;}thisID = "QPEmonthlyDeparture";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('MQC',false, 'custom', thisID);return;}thisID = "QPEmonthlyNormal";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('MQC',false, 'custom', thisID);return;}thisID = "QPEWY";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('MQC',false, 'custom', thisID);return;}thisID = "QPEWYPercentNormal";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('MQC',false, 'custom', thisID);return;}thisID = "QPEWYDeparture";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('MQC',false, 'custom', thisID);return;}thisID = "QPEWYNormal";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('MQC',false, 'custom', thisID);return;}thisID = "fgroups";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disablePNG('MQC',false, 'custom', thisID);return;}} //alert(id); if (id.substr(0,3) == "QPE") {thisID = "radarrefl";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;//document.getElementById(thisID).click();//disablePNG('radar',false, 'refl', thisID);map.removeLayer(tileLayer);return;}thisID = "RADARPCPN";if (document.getElementById(thisID).checked) {document.getElementById(thisID).checked = false;disableOverlay(false, thisID, 'precip')map.removeLayer(tileLayer);return;}} if ((id=='PPS' || id=='PPM' || id=='PNS' || id=='PNM') && ($('#QPEmonthly').prop("checked") || $('#QPEmonthlyPercentNormal').prop("checked") || $('#QPEmonthlyDeparture').prop("checked") || $('#QPEmonthlyNormal').prop("checked") || $('#QPEWY').prop("checked") || $('#QPEWYPercentNormal').prop("checked") || $('#QPEWYDeparture').prop("checked") || $('#QPEWYNormal').prop("checked") || $('#hucPrecip').prop("checked") || $('#hucPrecipSeasonal').prop("checked") || $('#fgroups').prop("checked"))) { return; } if ((name2 == 'precip' && oldName == 'QPE') || (oldName == 'precip' && name2 == 'QPE') || (name2 == 'precip' && oldName == 'radar') || (oldName == 'precip' && name2 == 'radar')) {//oldName = name2; return; }// return; if (name2 != oldName && name2 != "none") {//alert("clearing now name2: "+name2+ " oldName: "+oldName);popup.setPosition(undefined);clearMap(1,id);clearGages();clearClimate();oldName = name2;if (window.updateVar != "") {clearTimeout(window.updateVar);}window.updateVar = "";if (window.updateVar2 != "") {clearTimeout(window.updateVar2);}window.updateVar2 = ""; } } function toggleOverlay(checked,id,name,fromToggle){popup.setPosition(undefined);if (id == "RADARPCPN" || id == "droughtMon") {if (window.updateVar2 != "") {clearTimeout(window.updateVar2);}window.updateVar2 = "";} else {if (window.updateVar != "") {clearTimeout(window.updateVar);}window.updateVar = "";}name = name.substring(name.indexOf('_')+1);if (name != "none") {name2 = name;}checkNewName(id);if (name != "none") {loadFooter(name);}var briefing = "0";var overlays = ["CNRFC","STATES","COUNTIES","HYDROGRAPHY","MAJORRIVERS","BASINS","BURNAREAS1","NATIONALPARKS","WFOS","LAKES"];var overlays_clickable = ["MAJORRIVERS","BASINS","BURNAREAS1","NATIONALPARKS","LAKES"];if (briefing == 0) {var count = 0;var allPNGtypes = PNGtypes.concat(PNGtypes2);for(var i=0; i
'; ll[l] = htm; l = l + 1; }}if (features.length == 0) {//alert('none');}$.each(ll, function(i, el){ if($.inArray(el, lll) === -1) lll.push(el);});$('#WWAlegend').html(lll);}function updateWWA() {var geojsonFormat = new ol.format.GeoJSON();$.ajax({type: "GET",crossDomain: true,url: '/allhazard.geojson?random='+Math.random(),//url: '/allhazardHiRes.geojson?random='+Math.random(),//url: 'https://www.wrh.noaa.gov/map/json/WR_All_Hazards.json?random='+Math.random(),cache: false,dataType: "json",success: function(data) {dataStr = JSON.stringify(data)dataStr = dataStr.replace(/, 0.5/g,", 1.0");data = JSON.parse(dataStr);var features = geojsonFormat.readFeatures(data, {featureProjection:"EPSG:3857", dataProjection:"EPSG:4326"});//var features = geojsonFormat.readFeatures(data);markerLayer.getSource().clear();markerLayer.getSource().addFeatures(features);markerLayer.setOpacity($( "#imageslider" ).slider( "value" )*0.01);drawWWALegend();}});}var displayFeatureInfo = function(pixel) {coord = ol.proj.transform(map.getCoordinateFromPixel(pixel), 'EPSG:3857', 'EPSG:4326');url='https://forecast.weather.gov/MapClick.php?lon='+coord[0]+'&lat='+coord[1]; window.open(url, "_self");};var getContrastYIQ = function (color){ var hex = '#'; var r,g,b; if(color.indexOf(hex) > -1){ r = parseInt(color.substr(0,2),16); g = parseInt(color.substr(2,2),16); b = parseInt(color.substr(4,2),16); }else{ color = color.match(/\d+/g); r = color[0]; g = color[1]; b = color[2]; } var yiq = ((r*299)+(g*587)+(b*114))/1000; return (yiq >= 128) ? 'black' : 'white'; }var displayFeatureInfo_hover = function(pixel) {var mapTop = $('#map').offset().top;var mapLeft = $('#map').offset().left;var featureCount = 0;var msg = "";var feature = map.forEachFeatureAtPixel(pixel, function(feature, layer) {if (layer.get('name') == 'wwa') {et = feature.get('end');if (et == 0) { vt = "Until Further Notice";} else {vt = getTime(et);}//if (featureCount != 0) {//msg = msg + ""//}hex = feature.get('color'); hex = hex.slice(1);msg = msg + '
Expires at: ' + vt + '
Expires at: ' + vt + '
if (month == "Jan") {month = "Dec";year = year-1;} else if (month == "Feb") {month = "Jan";} else if (month == "Mar") {month = "Feb";} else if (month == "Apr") {month = "Mar";} else if (month == "May") {month = "Apr";} else if (month == "Jun") {month = "May";} else if (month == "Jul") {month = "Jun";} else if (month == "Aug") {month = "Jul";} else if (month == "Sep") {month = "Aug";} else if (month == "Oct") {month = "Sep";} else if (month == "Nov") {month = "Oct";} else if (month == "Dec") {month = "Nov";}id = code + "_" + month + "_" + year;window["addMarkersFromXML1_"+name](min,id);var mode = "";var briefing = "0"; var zoomLevel = parseInt(map.getView().getZoom());loadMarkers(textRes,loadSecondary());})} else {window["addMarkersFromXML1_"+name](min,id);loadMarkers(textRes,loadSecondary());}window.updateVar = setTimeout(function(){loadKML2(code,month,year,name,textRes);},dataRefreshInterval);}var KMZanimateSpeed = {};KMZanimateSpeed['DroughtMonitorArchive'] = 500;var PNGimgnum = {}; var PNGimg = {}; var PNGimg2 = {};var PNGanimateSpeed = {};var PNGtypeName = {};var PNGmaxImg = {};PNGimgnum["wpcQpf6hr"] = 1;PNGimgnum["wpcQpf24hr"] = 1; //var PNGmainTypes = ["QPF","QPE","FzLevel","temps"];var PNGmainTypes = ["riverReservoir","waterResources","QPF","QPE","FzLevel","obsTemps","fcstTemps","FFG","QPFverif"];for (var x in PNGmainTypes) {var type = PNGmainTypes[x]; PNGimg[type] = "";PNGimg2[type] = "";} //var PNGtypes = ["QPF6hr","QPF24hr","QPF5day","QPE6hr","QPE24hr","QPE7day","FzLevel6hrFcst","FzLevel6hrObs","MaxTFcstMaxT","MaxTFcstDeparture","MaxTFcst24Chg","MaxTFcstNormal","MinTFcstMinT","MinTFcstDeparture","MinTFcst24Chg","MinTFcstNormal"];var PNGtypes = ["riverReservoirFOP","QPF6hr","QPF24hr","QPF72hr","QPF5day","QPF6day","QPFcustom","QPE6hr","QPE24hr","QPE48hr","QPE72hr","QPE7day","QPEcustom","FzLevel6hrFcst","FzLevel6hrObs","MaxTFcstMaxT","MinTFcstMinT","TempObs6hr","MaxTObsMaxT","MinTObsMinT","FFG1hr","FFG3hr","FFG6hr","QPFverif","QPFverifCompare","QPEmonthly","QPEmonthlyDeparture","QPEmonthlyPercentNormal","QPEmonthlyNormal","QPEWY","QPEWYDeparture","QPEWYPercentNormal","QPEWYNormal","MQCcustom","snowNOHRSC","snowNOHRSCCHG","snowNOHRSCdepth"];var PNGtypes2 = ["MaxTFcstDeparture","MaxTFcst24Chg","MaxTFcstNormal","MinTFcstDeparture","MinTFcst24Chg","MinTFcstNormal","MaxTObsDeparture","MaxTObs24Chg","MaxTObsNormal","MinTObsDeparture","MinTObs24Chg","MinTObsNormal"]; for (x in PNGtypes) { PNGimgnum[PNGtypes[x]] = 1;PNGanimateSpeed[PNGtypes[x]] = 500;}PNGimgnum["radarrefl"] = 10;PNGanimateSpeed["radarrefl"] = 200;PNGtypeName["QPEmonthly"] = "QPE";PNGtypeName["QPEmonthlyDeparture"] = "QPE";PNGtypeName["QPEmonthlyPercentNormal"] = "QPE";PNGtypeName["QPEmonthlyNormal"] = "QPE";PNGtypeName["QPEWY"] = "QPE";PNGtypeName["QPEWYDeparture"] = "QPE";PNGtypeName["QPEWYPercentNormal"] = "QPE";PNGtypeName["QPEWYNormal"] = "QPE";PNGtypeName["MQCcustom"] = "QPE";PNGtypeName["riverReservoirFOP"] = "riverReservoir";PNGtypeName["QPF6hr"] = "QPF";PNGtypeName["QPF24hr"] = "QPF";PNGtypeName["QPF72hr"] = "QPF";PNGtypeName["QPF5day"] = "QPF";PNGtypeName["QPF6day"] = "QPF";PNGtypeName["QPFcustom"] = "QPF";//PNGtypeName["radarrefl"] = "radar";//PNGtypeName["RADARPCPN"] = "radar";PNGtypeName["QPE6hr"] = "QPE";PNGtypeName["QPE24hr"] = "QPE";PNGtypeName["QPE48hr"] = "QPE";PNGtypeName["QPE72hr"] = "QPE";PNGtypeName["QPE7day"] = "QPE";PNGtypeName["QPEcustom"] = "QPE";PNGtypeName["FzLevel6hrFcst"] = "FzLevel";PNGtypeName["FzLevel6hrObs"] = "FzLevel";PNGtypeName["MaxTFcstMaxT"] = "fcstTemps";PNGtypeName["MaxTFcstDeparture"] = "fcstTemps";PNGtypeName["MaxTFcst24Chg"] = "fcstTemps";PNGtypeName["MaxTFcstNormal"] = "fcstTemps";PNGtypeName["MinTFcstMinT"] = "fcstTemps";PNGtypeName["MinTFcstDeparture"] = "fcstTemps";PNGtypeName["MinTFcst24Chg"] = "fcstTemps";PNGtypeName["MinTFcstNormal"] = "fcstTemps";PNGtypeName["MaxTObsMaxT"] = "obsTemps";PNGtypeName["MinTObsMinT"] = "obsTemps";PNGtypeName["MinTObsNormal"] = "obsTemps";PNGtypeName["MaxTObsDeparture"] = "obsTemps";PNGtypeName["MaxTObs24Chg"] = "obsTemps";PNGtypeName["MaxTObsNormal"] = "obsTemps";PNGtypeName["MinTObsDeparture"] = "obsTemps";PNGtypeName["MinTObs24Chg"] = "obsTemps";PNGtypeName["TempObs6hr"] = "obsTemps";PNGtypeName["FFG1hr"] = "FFG";PNGtypeName["FFG3hr"] = "FFG";PNGtypeName["FFG6hr"] = "FFG";PNGtypeName["Day1QPFverif"] = "QPFverif";PNGtypeName["Day2QPFverif"] = "QPFverif";PNGtypeName["Day3QPFverif"] = "QPFverif";PNGtypeName["Day4QPFverif"] = "QPFverif";PNGtypeName["Day5QPFverif"] = "QPFverif";PNGtypeName["QPFverif"] = "QPFverif";PNGtypeName["QPFverifCompare"] = "QPFverif";PNGtypeName["snowNOHRSC"] = "snow";PNGtypeName["snowNOHRSCCHG"] = "snow";PNGtypeName["snowNOHRSCdepth"] = "snow";PNGmaxImg["riverReservoirFOP"] = 1;PNGmaxImg["QPF6hr"] = 24;PNGmaxImg["QPF24hr"] = 6;PNGmaxImg["QPF72hr"] = 1;PNGmaxImg["QPF5day"] = 1;PNGmaxImg["QPF6day"] = 1;PNGmaxImg["QPFcustom"] = 1;PNGmaxImg["radarrefl"] = 10;//PNGmaxImg["RADARPCPN"] = 1;PNGmaxImg["QPE6hr"] = 4;PNGmaxImg["QPE24hr"] = 1;PNGmaxImg["QPE48hr"] = 1;PNGmaxImg["QPE72hr"] = 1;PNGmaxImg["QPE7day"] = 1;PNGmaxImg["QPEcustom"] = 1;PNGmaxImg["FzLevel6hrFcst"] = 25;PNGmaxImg["FzLevel6hrObs"] = 4;PNGmaxImg["MaxTFcstMaxT"] = 11;PNGmaxImg["MaxTFcstDeparture"] = 11;PNGmaxImg["MaxTFcst24Chg"] = 11;PNGmaxImg["MaxTFcstNormal"] = 11;PNGmaxImg["MinTFcstMinT"] = 10;PNGmaxImg["MinTFcstDeparture"] = 10;PNGmaxImg["MinTFcst24Chg"] = 10;PNGmaxImg["MinTFcstNormal"] = 10;PNGmaxImg["MaxTObsMaxT"] = 4;PNGmaxImg["MinTObsMinT"] = 4;PNGmaxImg["TempObs6hr"] = 4;PNGmaxImg["MaxTObsDeparture"] = 4;PNGmaxImg["MaxTObs24Chg"] = 4;PNGmaxImg["MaxTObsNormal"] = 4;PNGmaxImg["MinTObsDeparture"] = 4;PNGmaxImg["MinTObs24Chg"] = 4;PNGmaxImg["MinTObsNormal"] = 4;PNGmaxImg["Day1QPFverif"] = 1;PNGmaxImg["Day2QPFverif"] = 1;PNGmaxImg["Day3QPFverif"] = 1;PNGmaxImg["Day4QPFverif"] = 1;PNGmaxImg["Day5QPFverif"] = 1;PNGmaxImg["snowNOHRSC"] = 1;PNGmaxImg["snowNOHRSCCHG"] = 1;PNGmaxImg["snowNOHRSCdepth"] = 1;window.refreshCount = 0; window.reloadingPNG = false;window.imageLoading = false;function AnimatePNG(type,checked,time,id) {if (window.reloadingPNG) {window.setTimeout(function(){AnimatePNG(type,checked,time,id)},100);return;}if (window.updateVar != "") {clearTimeout(window.updateVar);}window.updateVar = "";time2 = time;var subtypes = ["Departure","24Chg","Normal"];if (time == 'MaxT' || time == 'MinT') {for(var i = 0; i < subtypes.length; i++) {var subtype = subtypes[i];var e = document.getElementById(type+subtype);if (e.checked) {time2 = subtype;}}}if (document.getElementById(type+time2).checked == 0) {return;}var imgnum = PNGimgnum[type+time];var maxImg = PNGmaxImg[type+time];if (type.substring(0,4) == "MaxT" || type.substring(0,4) == "MinT") {time3 = type.substring(0,4);} else {time3 = time2;}if (document.getElementById(id).checked) {//nextPNGgrid(type,time3,'fromAnimate');//ol.maps.event.trigger(PNGimg[PNGtypeName[type+time]],'mousemove',{latlon:event.latLng});//alert(PNGanimateSpeed[type+time3]);window.refreshCount = window.refreshCount + 1;if (window.refreshCount >= 200) {window.reloadingPNG = true;//alert('refreshing now');//Loop through images to refreshvar maxImg = PNGmaxImg[type+time];//for (var i = 1; i <= maxImg; i++) {PNGimgnum[type+time] = 0;nextPNGgrid(type,time3,'fromAnimate',true,true);//while (window.imageLoading) {//}//}//Refresh timestamps//updateText();//Reset variableswindow.refreshCount = 0;window.reloadingPNG = false;//Now restart loopingif (imgnum == maxImg-1) {window.setTimeout(function(){AnimatePNG(type,checked,time,id)},2.5*PNGanimateSpeed[type+time3]);} else {window.setTimeout(function(){AnimatePNG(type,checked,time,id)},PNGanimateSpeed[type+time3]);}} else {nextPNGgrid(type,time3,'fromAnimate');if (imgnum == maxImg-1) {window.setTimeout(function(){AnimatePNG(type,checked,time,id)},2.5*PNGanimateSpeed[type+time3]);} else {window.setTimeout(function(){AnimatePNG(type,checked,time,id)},PNGanimateSpeed[type+time3]);}}} else {//makePNGlisteners(type,time2,time,id);//togglePNG(type,document.getElementById(type+time2).checked,time2,type+time2);reinitializePNG(type,document.getElementById(type+time2).checked,time2,type+time2);}}function loadPNGgrid(type,time,step,fromAnimate){fromAnimate = fromAnimate || false;var time2 = time;var subtypes = ["Departure","24Chg","Normal"];if (time == 'MaxT' || time == 'MinT') {for(var i = 0; i < subtypes.length; i++) {var subtype = subtypes[i];var e = document.getElementById(type+subtype);if (e.checked) {time2 = subtype;}}}window.time11 = time2;window.time12 = time;window.type11 = type;//window.id2 = id;PNGimgnum[type+time] = step;var maxImg = PNGmaxImg[type+time];var minImg = 1;//if (PNGimgnum[type+time] == minImg) {// document.getElementById('prev'+type+time).disabled = true;//} else {// document.getElementById('prev'+type+time).disabled = false;//}//if (PNGimgnum[type+time] == maxImg) {// document.getElementById('next'+type+time).disabled = true;//} else {// document.getElementById('next'+type+time).disabled = false;//}//var imageBounds = new ol.maps.LatLngBounds(// new ol.maps.LatLng(32.5,-124.48),// new ol.maps.LatLng(43.375,-114.105));for (var i = 1; i <= maxImg; i++) { var e = document.getElementById(type+time+"time_"+i); if (i == PNGimgnum[type+time]) { e.style.display="block"; } else { e.style.display="none"; }} //alert(step); if (document.getElementById(type+time2).checked) { //document.getElementById('cursorReadoutDiv').style.display = 'block'; //document.getElementById('showElevDiv').style.display = 'block';loadingOn();if (fromAnimate) {window.imageLoading = true;} if (time2 == "24Chg" && PNGimgnum[type+time] == 1 && (type == "MaxTFcst" || type == "MinTFcst")) { var url = "/data/icons/24Change_NA.png"; } else if (type == "radar") { var url = "/archive/radar/images/"+time2+"_"+type+"_"+step+"_Mercator.png?random="+Math.random(); } else { var url = "/data/png/"+time2+"_"+type+"_"+step+".png?random="+Math.random(); } if (PNGimg[PNGtypeName[type+time]] != "") { map.removeLayer(PNGimg[PNGtypeName[type+time]]); stopListener('image'); PNGimg[PNGtypeName[type+time]] = ""; } var img = new Image();img.src=url;//$('img').load('load',function () {//loadingOff();//});if (type == "radar") {ib = imageBoundsRadar;} else {ib = imageBounds;}PNGimg[PNGtypeName[type+time2]] = loadImageLayer(url,ib);PNGimg[PNGtypeName[type+time2]].setOpacity($( "#imageslider" ).slider( "value" )/100);if (time2 == "24Chg" && PNGimgnum[type+time] == 1 && (type == "MaxTFcst" || type == "MinTFcst")) { PNGimg[PNGtypeName[type+time2]].setOpacity(1.0); }if (!fromAnimate) {makePNGlisteners(type,time2,time);} } else { document.getElementById('cursorReadoutDiv').style.display = 'none'; document.getElementById('showElevDiv').style.display = 'none'; }}function prevPNGgrid(type,time,id){time2 = time;var subtypes = ["Departure","24Chg","Normal"];if (time == 'MaxT' || time == 'MinT') {for(var i = 0; i < subtypes.length; i++) {var subtype = subtypes[i];var e = document.getElementById(type+subtype);if (e.checked) {time2 = subtype;}}}window.time11 = time2;window.time12 = time;window.type11 = type;//window.id2 = id;var minImg = 1;var maxImg = PNGmaxImg[type+time];PNGimgnum[type+time] = PNGimgnum[type+time] - 1;if (PNGimgnum[type+time] < minImg) { PNGimgnum[type+time] = maxImg;}//if (PNGimgnum[type+time] == minImg) {// document.getElementById('prev'+type+time).disabled = true;//} else {// document.getElementById('prev'+type+time).disabled = false;//}//document.getElementById('next'+type+time).disabled = false;$( "#"+type+time+"slider" ).slider( "value", PNGimgnum[type+time]);//var imageBounds = new ol.maps.LatLngBounds(// new ol.maps.LatLng(32.5,-124.48),// new ol.maps.LatLng(43.375,-114.105));for (var i = 1; i <= PNGmaxImg[type+time]; i++) { var e = document.getElementById(type+time+"time_"+i); if (i == PNGimgnum[type+time]) { e.style.display="block"; } else { e.style.display="none"; }} if (document.getElementById(type+time2).checked) { // document.getElementById('cursorReadoutDiv').style.display = 'block'; // document.getElementById('showElevDiv').style.display = 'block'; loadingOn(); if (time2 == "24Chg" && PNGimgnum[type+time] == 1 && (type == "MaxTFcst" || type == "MinTFcst")) { var url = "/data/icons/24Change_NA.png"; } else if (type == "radar") { var url = "/archive/radar/images/"+time2+"_"+type+"_"+PNGimgnum[type+time]+"_Mercator.png?random="+Math.random(); } else { var url = "/data/png/"+time2+"_"+type+"_"+PNGimgnum[type+time]+".png?random="+Math.random(); } if (PNGimg[PNGtypeName[type+time]] != "") { map.removeLayer(PNGimg[PNGtypeName[type+time]]); stopListener('image'); PNGimg[PNGtypeName[type+time]] = ""; } var img = new Image();img.src=url;//$('img').load('load',function () {//loadingOff();//});if (type == "radar") {ib = imageBoundsRadar;} else {ib = imageBounds;}PNGimg[PNGtypeName[type+time2]] = loadImageLayer(url,ib);PNGimg[PNGtypeName[type+time2]].setOpacity($( "#imageslider" ).slider( "value" )/100);if (time2 == "24Chg" && PNGimgnum[type+time] == 1 && (type == "MaxTFcst" || type == "MinTFcst")) { PNGimg[PNGtypeName[type+time2]].setOpacity(1.0); }makePNGlisteners(type,time2,time); } else { document.getElementById('cursorReadoutDiv').style.display = 'none'; document.getElementById('showElevDiv').style.display = 'none'; }}function nextPNGgrid(type,time,id,fromAnimate,override){fromAnimate = fromAnimate || false;override = override || false;time2 = time;var subtypes = ["Departure","24Chg","Normal"];if (time == 'MaxT' || time == 'MinT') {for(var i = 0; i < subtypes.length; i++) {var subtype = subtypes[i];var e = document.getElementById(type+subtype);if (e.checked) {time2 = subtype;}}}window.time11 = time2;window.time12 = time;window.type11 = type;//window.id2 = id;var maxImg = PNGmaxImg[type+time];PNGimgnum[type+time] = PNGimgnum[type+time] + 1;if (fromAnimate) {//alert('Msg from nextPNGimg: ' + PNGimgnum[type+time]);} if (PNGimgnum[type+time] > maxImg) { PNGimgnum[type+time] = 1; }// if (PNGimgnum[type+time] == maxImg) {// document.getElementById('next'+type+time).disabled = true;// } else {// document.getElementById('next'+type+time).disabled = false;// }// document.getElementById('prev'+type+time).disabled = false;// if (PNGimgnum[type+time] == 1) {// document.getElementById('prev'+type+time).disabled = true;// }$( "#"+type+time+"slider" ).slider( "value", PNGimgnum[type+time]);//var imageBounds = new ol.maps.LatLngBounds(// new ol.maps.LatLng(32.5,-124.48),// new ol.maps.LatLng(43.375,-114.105));for (var i = 1; i <= maxImg; i++) {//alert(type+time+"time_"+i); var e = document.getElementById(type+time+"time_"+i); if (i == PNGimgnum[type+time]) { e.style.display="block"; } else { e.style.display="none"; }}//alert(type+' '+time+' '+time2+' '+PNGimgnum[type+time]); if (document.getElementById(type+time2).checked) { //document.getElementById('cursorReadoutDiv').style.display = 'block'; //document.getElementById('showElevDiv').style.display = 'block'; //if (id!="fromAnimate") { //document.getElementById('loading').innerHTML = PNGimgnum[type+time]; loadingOn(); //}if (fromAnimate) {window.imageLoading = true;} if (document.getElementById(type+time+'Animate')) { if (document.getElementById(type+time+'Animate').checked == false || override) { //alert('refreshing now'); if (time2 == "24Chg" && PNGimgnum[type+time] == 1 && (type == "MaxTFcst" || type == "MinTFcst")) { var url = "/data/icons/24Change_NA.png"; } else if (type == "radar") { var url = "/archive/radar/images/"+time2+"_"+type+"_"+PNGimgnum[type+time]+"_Mercator.png?random="+Math.random(); } else { var url = "/data/png/"+time2+"_"+type+"_"+PNGimgnum[type+time]+".png?random="+Math.random();}//updateText(); } else { if (time2 == "24Chg" && PNGimgnum[type+time] == 1 && (type == "MaxTFcst" || type == "MinTFcst")) { var url = "/data/icons/24Change_NA.png"; } else if (type == "radar") { var url = "/archive/radar/images/"+time2+"_"+type+"_"+PNGimgnum[type+time]+"_Mercator.png"; } else { var url = "/data/png/"+time2+"_"+type+"_"+PNGimgnum[type+time]+".png";} } } //alert(url); if (PNGimg[PNGtypeName[type+time]] != "") { map.removeLayer(PNGimg[PNGtypeName[type+time]]); stopListener('image'); PNGimg[PNGtypeName[type+time]] = ""; } //if (id!="fromAnimate") { var img = new Image();$('img').load('load',function () {if (window.type11 == "radar") {ib = imageBoundsRadar;} else {ib = imageBounds;}if (window.imageLoading) {if (PNGimg[PNGtypeName[window.type11+window.time12]] != "") { map.removeLayer(PNGimg[PNGtypeName[window.type11+window.time12]]); PNGimg[PNGtypeName[window.type11+window.time12e]] = ""; }PNGimg[PNGtypeName[window.type11+window.time11]] = loadImageLayer(url,ib);PNGimg[PNGtypeName[window.type11+window.time11]].setOpacity($( "#imageslider" ).slider( "value" )/100);if (time2 == "24Chg" && PNGimgnum[window.type11+window.time12] == 1 && (type == "MaxTFcst" || type == "MinTFcst")) { PNGimg[PNGtypeName[window.type11+window.time11]].setOpacity(1.0); }}if (window.imageLoading) {makePNGlisteners(type,time2,time);}loadingOff();//alert(window.imageLoading + ' ' + PNGimgnum[type+time] + ' ' + PNGmaxImg[type+time]);if (window.imageLoading && PNGimgnum[type+time] < PNGmaxImg[type+time]) {nextPNGgrid(window.type11,window.time12,'fromAnimate',true,true);} else {window.imageLoading = false;}});img.src=url;//}if (type == "radar") {ib = imageBoundsRadar;} else {ib = imageBounds;}if (!fromAnimate) {PNGimg[PNGtypeName[type+time2]] = loadImageLayer(url,ib);PNGimg[PNGtypeName[type+time2]].setOpacity($( "#imageslider" ).slider( "value" )/100);if (time2 == "24Chg" && PNGimgnum[type+time] == 1 && (type == "MaxTFcst" || type == "MinTFcst")) { PNGimg[PNGtypeName[type+time2]].setOpacity(1.0); }}if (!fromAnimate) {makePNGlisteners(type,time2,time);} } else { document.getElementById('cursorReadoutDiv').style.display = 'none'; document.getElementById('showElevDiv').style.display = 'none'; }}function togglePNG(type,checked,time,id){var briefing = "0";//updateText();window.refreshCount = 199;//alert(skipCheck);//alert('hi');//return;if (time == "Departure" || time == "24Chg" || time == "Normal") {var time2 = type.substring(0,4);} else {var time2 = time;}if (window.updateVar2 != "") {clearTimeout(window.updateVar2);}window.updateVar2 = "";window.time11 = time;window.time12 = time2;window.type11 = type;//window.id2 = id;name2 = PNGtypeName[type+time2];if (name2 == "QPE") {name2 = "precip";}name3 = PNGtypeName[type+time2];if (name3 = "QPE") {name3 = "precip";}checkNewName(id);if (type == 'QPE') {showHideQPE(time);}document.getElementById('briefingCreatedTime').innerHTML = "";document.getElementById('briefingValidTime').innerHTML = "";document.getElementById('briefingCreatedTimeMaster').style.display = 'none';document.getElementById('briefingValidTimeMaster').style.display = 'none';//alert(type+" "+checked+" "+time+" "+id+" "+skipCheck);if (window.name2 == 'QPE' || window.name2 == 'radar') {loadFooter('precip');} else {loadFooter(window.name2);} //alert("'"+type+time2+"' '"+PNGtypeName[type+time2]+"' '"+PNGimg[PNGtypeName[type+time2]]+"' '"+skipCheck); if (checked) {if (typeof tileLayer !== 'undefined') {map.removeLayer(tileLayer);var boxes = document.getElementsByName("boxTile");for(var i = 0; i < boxes.length; i++) {if (boxes[i].checked) {boxes[i].checked = false;}}} $('#hucPrecip').prop('checked',false); $('#hucPrecipSeasonal').prop('checked',false); $('#fgroups').prop('checked',false);if (briefing == 0) {document.getElementById('gridOptions').style.display = 'block';}if (name2 == 'QPF') {if (gridID != "") { map.removeLayer(kml[gridID].kmlLayer); gridID = "";} $('#wpcQpf6hr').prop('checked',false); $('#wpcQpf24hr').prop('checked',false); $('#wpcQpf72hr').prop('checked',false); $('#wpcQpf7day').prop('checked',false);} //document.getElementById('cursorReadoutDiv').style.display = 'block'; //document.getElementById('showElevDiv').style.display = 'block'; // alert("id is "+id+" and checked is true"); loadingOn(); if (document.forms["data_waterResources"]) { //var thisType = document.forms["data_waterResources"].elements["typeArea"].value; var thisType = window.imageType; } else { var thisType = ""; } if (time == "24Chg") {document["legend2"].src="/data/icons/24change.png";} else if (time == "Departure") {document["legend2"].src="/data/icons/departure.png";} else if (type == "FFG") {document["legend2"].src="/data/icons/QPF_colorTable.png";} else if (time == "custom" && type == "MQC") {if (window.typeMQC == "QPE" || window.typeMQC == "normal") {document["legend2"].src="/data/icons/QPE_"+window.numYears+"yr_colorTable.png";} else if (window.typeMQC == "departure") {document["legend2"].src="/data/icons/QPEWYDepartureMulti.png";} else if (window.typeMQC == "percent") {document["legend2"].src="/data/icons/percentNormalGridded.png";}} else if (time=="custom") {document["legend2"].src="/data/icons/QPF_6.5_colorTable.png";} else if (type=="QPF" || type == "QPE") {if (time != "6hr") { window.type2 = type;$.getScript("/data/kml/"+time+"_"+type+".txt", function(){ document["legend2"].src="/data/icons/"+type2+"_"+max+"_colorTable.png";});} else {document["legend2"].src="/data/icons/QPF_6.5_colorTable.png";}} else if (type=="obsTemps" || type == "fcstTemps") { document["legend2"].src="/data/icons/temps_colorTable.png";} else if (type=="radar") {document["legend2"].src="/data/icons/blank.png"; document["legend3"].src="/data/icons/blank.png";} else if (type=="QPFverif") {document["legend2"].src="/data/icons/QPFverif_colorTable.png";} else if (type=="QPFverifCompare") {document["legend2"].src="/data/icons/QPF_6.5_colorTable.png";} else if (thisType=="QPEmonthly" || thisType=="QPEmonthlyNormal") {document["legend2"].src="/data/icons/QPE_45.5_colorTable.png";} else if (thisType=="QPEmonthlyDeparture") {document["legend2"].src="/data/icons/QPEmonthlyDeparture.png";} else if (thisType=="QPEmonthlyPercentNormal") {document["legend2"].src="/data/icons/percentNormalGridded.png";} else if (thisType=="QPEWY" || thisType=="QPEWYNormal") {document["legend2"].src="/data/icons/QPE_130.0_colorTable.png";} else if (thisType=="QPEWYDeparture") {document["legend2"].src="/data/icons/QPEWYDeparture.png";} else if (thisType=="QPEWYPercentNormal") {document["legend2"].src="/data/icons/percentNormalGridded.png";} else if (id=="snowNOHRSC") {if (briefing == "1") {document["legend1"].src="/data/icons/swe_icons/legend_nohrsc.png";} else {document["legend2"].src="/data/icons/swe_icons/legend_nohrsc.png";}} else if (id=="snowNOHRSCCHG") {document["legend2"].src="/data/icons/swe_icons/legend_nohrsc_chg.png";} else if (id=="snowNOHRSCdepth") {document["legend2"].src="/data/icons/swe_icons/legend_nohrsc_depth.png";} else {document["legend2"].src="/data/icons/"+PNGtypeName[type+time]+"_colorTable.png";} var url2 = ""; if (time == "24Chg" && PNGimgnum[type+time2] == 1 && (type == "MaxTFcst" || type == "MinTFcst")) { var url = "/data/icons/24Change_NA.png"; } else if (type == "radar") { var url = "/archive/radar/images/"+time2+"_"+type+"_"+PNGimgnum[type+time]+"_Mercator.png?random="+Math.random(); } else if (type == "QPFverif") { var dayNum = document.getElementById('QPFverifSelect').value; var dateString = document.getElementById('datepicker').value; var newDate = new Date((dateString)); var url = "/archive/googlePrecipVerif/Day"+dayNum+"_"+type+"_"+newDate.f("yyyyMMdd")+"_Mercator.png?random="+Math.random(); } else if (type == "QPFverifCompare") { var dayNum = document.getElementById('QPFverifSelect').value; var dateString = document.getElementById('datepicker').value; var newDate = new Date((dateString)); var url = "/archive/googlePrecipVerif/Day"+dayNum+"_QPF_"+newDate.f("yyyyMMdd")+"_Mercator.png?random="+Math.random(); var url2 = "/archive/googlePrecipVerif/QPE_"+newDate.f("yyyyMMdd")+"_Mercator.png?random="+Math.random(); } else if (type.substr(0,10) == "QPEmonthly" || type.substr(0,5) == "QPEWY") { var thisType = id; var year = document.forms["data_"+name3].elements["year"+name3].value; var month = document.forms["data_"+name3].elements["month"+name3].value; var url = "/archive/googlePrecipMonthly/"+thisType+"_"+year+month+"_Mercator.png?random="+Math.random(); } else if (time == "custom" && type == "MQC") { var url = "/archive/googlePrecipMonthly/"+window.dateStamp+".png?random="+Math.random(); } else if (time == "custom") { var url = "/data/kml/6hr_"+type+"_custom.png?random="+Math.random(); } else if (type == "QPF") { var url = "/data/png/"+time+"_"+type+"_"+PNGimgnum[type+time2]+".png?random="+Math.random(); } else if (id == "snowNOHRSC") { if (document.getElementById('NOHRSCDateBox')) { var nohrsc_date = document.getElementById('NOHRSCDateBox').value; var url = "/archive/nohrsc/nohrsc_swe_"+nohrsc_date+"_Mercator.png?random="+Math.random(); } else { var url = "/data/png/nohrsc_swe_Mercator.png?random="+Math.random(); } } else if (id == "snowNOHRSCCHG") { if (document.getElementById('NOHRSCDateBox')) { var nohrsc_date = document.getElementById('NOHRSCDateBox').value; var url = "/archive/nohrsc/nohrsc_swe_change_24hr_"+nohrsc_date+"_Mercator.png?random="+Math.random(); } else { var url = "/data/png/nohrsc_swe_change_24hr_Mercator.png?random="+Math.random(); } } else if (id == "snowNOHRSCdepth") { if (document.getElementById('NOHRSCDateBox')) { var nohrsc_date = document.getElementById('NOHRSCDateBox').value; var url = "/archive/nohrsc/nohrsc_depth_"+nohrsc_date+"_Mercator.png?random="+Math.random(); } else { var url = "/data/png/nohrsc_depth_Mercator.png?random="+Math.random(); } } else { var url = "/data/png/"+time+"_"+type+"_"+PNGimgnum[type+time2]+".png?random="+Math.random(); } //alert(url); proj = "EPSG:3857";if ((id == "snowNOHRSC" || id == "snowNOHRSCCHG" || id == "snowNOHRSCdepth") && document.getElementById('NOHRSCDateBox')) {if (nohrsc_date >= "20210202" && nohrsc_date <= "20211209") {url = url.replace("_Mercator", "");proj = "EPSG:4326";}}if (archiveProds.indexOf(id) > -1) { if (briefing == 0) { var curmo2 = "";var typeA = "";var yearA = "2024";var monthA = "Jun";var month2A = "6"; //var thisType = document.forms["data_"].elements["typeArea"].value; var year = document.forms["data_"+name3].elements["year"+name3].value; var month = document.forms["data_"+name3].elements["month"+name3].value; if (month == 'Jan') { var month2 = 1; } else if (month == 'Feb') { var month2 = 2; } else if (month == 'Mar') { var month2 = 3; } else if (month == 'Apr') { var month2 = 4; } else if (month == 'May') { var month2 = 5; } else if (month == 'Jun') { var month2 = 6; } else if (month == 'Jul') { var month2 = 7; } else if (month == 'Aug') { var month2 = 8; } else if (month == 'Sep') { var month2 = 9; } else if (month == 'Oct') { var month2 = 10; } else if (month == 'Nov') { var month2 = 11; } else if (month == 'Dec') { var month2 = 12; }//if (curmo2 == "previous2" || curmo2 == "prev") {// var previousMonth = true;//}if (monthA == month && yearA == year) {var previousMonth = false;} else {var previousMonth = true;}MQCstampParse = MQCstamp.split(" ");MQCmonth = MQCstampParse[1];if (MQCmonth == 'Jan') {MQCmonth = 0;} else if (MQCmonth == 'Feb') {MQCmonth = 1;} else if (MQCmonth == 'Mar') {MQCmonth = 2;} else if (MQCmonth == 'Apr') {MQCmonth = 3;} else if (MQCmonth == 'May') {MQCmonth = 4;} else if (MQCmonth == 'Jun') {MQCmonth = 5;} else if (MQCmonth == 'Jul') {MQCmonth = 6;} else if (MQCmonth == 'Aug') {MQCmonth = 7;} else if (MQCmonth == 'Sep') {MQCmonth = 8;} else if (MQCmonth == 'Oct') {MQCmonth = 9;} else if (MQCmonth == 'Nov') {MQCmonth = 10;} else if (MQCmonth == 'Dec') {MQCmonth = 11;}MQCday = MQCstampParse[2];MQCyear = MQCstampParse[3];MQCdate = new Date(MQCyear,MQCmonth,MQCday,23,59,59);var dateString = month2 + "/" + daysInMonth(month2,year) + "/" + year;var newDate = new Date((dateString));if (MQCdate >= newDate) {if (newDate.getTimezoneOffset() == 420) {var timeVar = "5:00 AM PDT";} else {var timeVar = "4:00 AM PST";}document.getElementById("briefingValidTime").innerHTML = newDate.f("E NNN d yyyy") + " at " + timeVar;document.getElementById('briefingValidTimeMaster').style.display = 'block';} else {//$("#briefingValidTime").load("/data/kml/MQC_timestamp.txt");document.getElementById("briefingValidTime").innerHTML = MQCstamp;document.getElementById('briefingValidTimeMaster').style.display = 'block';}//var pngurl = "/archive/googlePrecipMonthly/"+thisType+"_"+year+month+".png";$("#briefingCreatedTime").load("/includes/timeStamp2.php?imgFile="+url.split('?')[0]+"&fontSize=10");document.getElementById('briefingCreatedTimeMaster').style.display = 'block'; }} var allPNGtypes = PNGtypes.concat(PNGtypes2); for (x in allPNGtypes) { var PNGtype = allPNGtypes[x];//console.log(PNGtypeName[type+time2] + " " + PNGtypeName[PNGtype] + " " + PNGtype); if (PNGtypeName[type+time2] == PNGtypeName[PNGtype]) {if (briefing == "0") {if (type+time == PNGtype) {document.getElementById(PNGtype).checked = true;} else {document.getElementById(PNGtype).checked = false;}}} } var img = new Image();//$('img').on('load',function () {//loadingOff();//});$('img').on('error',function () {//loadingOff();//$( "#dialog-modal" ).dialog( "open" );});img.src=url;if (type == "radar") {ib = imageBoundsRadar;} else if (type == "snow") {if (proj == "EPSG:3857") {ib = imageBoundsNOHRSC;} else {ib = imageBoundsNOHRSC4326;}} else if (type == "MQC" && time=="custom") {ib = imageBoundsMQCcustom;} else {ib = imageBounds;} //UNLOAD ANY PREVIOUSLY-LOADED IMAGES if (PNGimg[PNGtypeName[type+time2]] != "" && PNGimg[PNGtypeName[type+time2]] != "undefined" && typeof PNGimg[PNGtypeName[type+time2]] != "undefined") { map.removeLayer(PNGimg[PNGtypeName[type+time2]]); stopListener('image'); PNGimg[PNGtypeName[type+time2]] = ""; } if (PNGimg2[PNGtypeName[type+time2]] != "" && PNGimg2[PNGtypeName[type+time2]] != "undefined" && typeof PNGimg2[PNGtypeName[type+time2]] != "undefined") { map.removeLayer(PNGimg2[PNGtypeName[type+time2]]); stopListener('image'); PNGimg2[PNGtypeName[type+time2]] = ""; } if (gridIDarchive != "") { map.removeLayer(gridIDarchive); gridIDarchive = ""; } if (time=="custom") {PNGimg[PNGtypeName[type+time2]] = loadImageLayer(url,ib,true,proj); } else {PNGimg[PNGtypeName[type+time2]] = loadImageLayer(url,ib,false,proj); }//loadImageLayer(url,ib);if (url2 != "") { var img2 = new Image();$('img2').on('load',function () {//loadingOff();});img2.src=url2;if (type == "radar") {ib = imageBoundsRadar;} else {ib = imageBounds;}PNGimg2[PNGtypeName[type+time2]] = loadImageLayer(url2,ib,false,proj);//PNGimg[PNGtypeName[type+time2]].getPanes().overlayLayer.style['zIndex'] = 1002;//alert(kml['BASINS'].kmlLayer.getMap());}if (time == "24Chg" && PNGimgnum[type+time2] == 1 && (type == "MaxTFcst" || type == "MinTFcst")) { PNGimg[PNGtypeName[type+time2]].setOpacity(1.0); } else if (type == "QPFverifCompare") {var mainVal = $( "#imageslider" ).slider( "value" )/100;var val2 = $( "#"+PNGtypeName[type+time2]+"sliderCompare" ).slider( "value" )/100;PNGimg['QPFverif'].setOpacity(mainVal * val2);PNGimg2['QPFverif'].setOpacity(mainVal * (1-val2));} else {PNGimg[PNGtypeName[type+time2]].setOpacity($( "#imageslider" ).slider( "value" )/100);}if (briefing == "1") {PNGimg[PNGtypeName[type+time2]].setOpacity(0.65);}window.type11 = type;makePNGlisteners(type,time,time2,id);if (document.getElementById(type+time2+'Animate')) {if (document.getElementById(type+time2+'Animate').checked) {AnimatePNG(type,document.getElementById(type+time2+'Animate').checked,time,type+time2+'Animate');} else {//window.updateVar2 = setTimeout(function(){togglePNG(window.type11,true,window.time11,id);},dataRefreshInterval);window.updateVar2 = setTimeout(function(){togglePNG(type,true,time,id);},dataRefreshInterval);}} } else {window.id2 = '';window.time11 = '';window.type11 = ''; document.getElementById('gridOptions').style.display = 'none'; // alert("id is "+id+" and checked is false"); document.getElementById('cursorReadoutDiv').style.display = 'none'; document.getElementById('showElevDiv').style.display = 'none'; if (type == 'QPFverifCompare') { type = 'QPFverif'; } if (PNGimg[PNGtypeName[type+time2]] != "") { map.removeLayer(PNGimg[PNGtypeName[type+time2]]); stopListener('image'); PNGimg[PNGtypeName[type+time2]] = ""; } if (PNGimg2[PNGtypeName[type+time2]] != "") { map.removeLayer(PNGimg2[PNGtypeName[type+time2]]); stopListener('image'); PNGimg2[PNGtypeName[type+time2]] = ""; } document["legend2"].src="/data/icons/blank.png";document["legend3"].src="/data/icons/blank.png";//This is to fix clickable issues./*var overlays = ["CNRFC","STATES","COUNTIES","HYDROGRAPHY","MAJORRIVERS","BASINS","BURNAREAS1","NATIONALPARKS","WFOS","LAKES"];for (var i = 0; i < overlays.length; i++) {var overlay = overlays[i];if (kml[overlay].kmlLayer) {map.removeLayer(kml[overlay].kmlLayer);kml[overlay].kmlLayer = new ol.layer.Vector({source: new ol.source.Vector({format: new ol.format.KML(),projection: 'EPSG:3857',url: kml[overlay].url}),opacity:1.0});map.addLayer(kml[overlay].kmlLayer);}}*/ } //map.addLayer(citiesLayer); }function loadImageLayer(url,extent,custom,proj) {var custom = custom || false;var proj = proj || 'EPSG:3857';if (url.indexOf("nohrsc") > -1) {if (proj == "EPSG:3857") {var size = [7000,4321];} else {var size = [7680,3584];}imageLayer = new ol.layer.Image({source: new ol.source.ImageStatic({url: url,imageSize: size,imageExtent: extent,projection: proj}),opacity: 0.65,type: imageLayer,zIndex: 1000 });} else if (url.indexOf("radar") > -1) {imageLayer = new ol.layer.Image({source: new ol.source.ImageStatic({url: url,imageSize: [700,1300],imageExtent: extent}),opacity: 0.65,type: imageLayer,zIndex: 1000 });} else if (custom) {imageLayer = new ol.layer.Image({source: new ol.source.ImageStatic({url: url,imageSize: [1245,1305],projection: 'EPSG:4326',imageExtent: extent}),opacity: 0.65,type: imageLayer,zIndex: 1000 });} else {imageLayer = new ol.layer.Image({source: new ol.source.ImageStatic({url: url,imageSize: [1200,1600],imageExtent: extent}),opacity: 0.65,type: imageLayer,zIndex: 1000 });}//loadingOn(); imageLayer.getSource().once('imageloadend',function() { /* //UNLOAD ANY PREVIOUSLY-LOADED IMAGESvar type = window.type11;var time2 = window.time12; if (PNGimg[PNGtypeName[type+time2]] != "" && PNGimg[PNGtypeName[type+time2]] != "undefined" && typeof PNGimg[PNGtypeName[type+time2]] != "undefined") { map.removeLayer(PNGimg[PNGtypeName[type+time2]]); stopListener('image'); PNGimg[PNGtypeName[type+time2]] = ""; } if (PNGimg2[PNGtypeName[type+time2]] != "" && PNGimg2[PNGtypeName[type+time2]] != "undefined" && typeof PNGimg2[PNGtypeName[type+time2]] != "undefined") { map.removeLayer(PNGimg2[PNGtypeName[type+time2]]); stopListener('image'); PNGimg2[PNGtypeName[type+time2]] = ""; } if (gridIDarchive != "") { map.removeLayer(gridIDarchive); gridIDarchive = ""; } PNGimg[PNGtypeName[type+time2]] = imageLayer; */ loadingOff(); //console.log('done'); }); var key = imageLayer.getSource().on('change', function() { if (imageLayer.getSource().getState() == 'ready') { imageLayer.getSource().unByKey(key); console.log('done2'); } }); //console.log('added listener'); //imageLayer.on('mousemove',function() {//console.log('hey hey');}); map.addLayer(imageLayer);/* // Keep any boundary overlays above image layer: var overlays = ["CNRFC","STATES","COUNTIES","HYDROGRAPHY","MAJORRIVERS","BASINS","BURNAREAS1","NATIONALPARKS","WFOS","LAKES"]; for (var i = 0; i < overlays.length; i++) { var overlay = overlays[i]; if (kml[overlay].kmlLayer) { map.removeLayer(kml[overlay].kmlLayer); map.addLayer(kml[overlay].kmlLayer); } } if (checkLayer(citiesLayer)) { map.removeLayer(citiesLayer); map.addLayer(citiesLayer); } if (checkLayer(satBG3)) { map.removeLayer(satBG3); map.addLayer(satBG3); } */ /* // Keep any markers on top of image layer: if (clickVar) { map.removeLayer(markerLayer); map.addLayer(markerLayer); } */ return imageLayer;}function reinitializePNG(type,checked,time,id){makePNGlisteners(type,time,time2);if (window.updateVar2 != "") {clearTimeout(window.updateVar2);}window.updateVar2 = "";if (document.getElementById(type+time2+'Animate')) {if (document.getElementById(type+time2+'Animate').checked) {AnimatePNG(type,document.getElementById(type+time2+'Animate').checked,time,type+time2+'Animate');} else {window.updateVar2 = setTimeout(function(){togglePNG(window.type11,true,window.time11,id);},dataRefreshInterval);}}}function disablePNG(type,checked,time,id){var time2 = time;if (type=="QPF" || id=="QPEcustom") {var allPNGtypes = PNGtypes.concat(PNGtypes2);for(var i=0; i
("+unitsArray[product]+")"; } } else { var unitString = ""; } // Table with fcst/obs stage/flow if (product == 'fcstPointsFcst' || product == 'otherPointsFcst' || product == 'zeroFCSTcombo' || product == 'oneFCSTcombo' || product == 'twoFCSTcombo' || product == 'threeFCSTcombo') { table=table+" \n";var sortCol = 2; // Table with only obs stage/flow } else if (product == 'zeroFCST' || product == 'oneFCST' || product == 'twoFCST' || product == 'threeFCST' || product == 'zeroOTHER' || product == 'oneOTHER' || product == 'twoOTHER' || product == 'threeOTHER' || product == 'zeroRESERVOIR' || product == 'oneRESERVOIR' || product == 'twoRESERVOIR' || product == 'threeRESERVOIR') { if (product == 'zeroRESERVOIR' || product == 'oneRESERVOIR' || product == 'twoRESERVOIR' || product == 'threeRESERVOIR') { table=table+"Location Max Fcst Stage
(Feet)Max Fcst Flow
(CFS)Latest Obs Stage
(Feet)Latest Obs Flow
(CFS) \n"; } else { table=table+"Location Obs Lake Elev
(Feet)Obs Storage
(acre-ft) \n"; } var sortCol = 2; // Table for ensPoints (no values) } else if (product == 'ensPoints') { table=table+"Location Obs Stage
(Feet)Obs Flow
(CFS) \n"; var sortCol = 2; // All other tables } else { table=table+"Location
\n"; var arrays_same = (featuresinBox.length == oldMarkers.length) && featuresinBox.every(function(element, index) { return element === oldMarkers[index];}); //console.log('step 1'); if (!arrays_same || force) { //console.log('step 2');//if ($("#dataTable", window.parent.document).hasClass("tablesorter")) { if ($("#markerTable", window.parent.document).dialog("isOpen")) { $('#markerTableInside', window.parent.document).html(table); if (sortList == '') { sortList2 = [[sortCol,1],[0,0]]; } else { sortList2 = sortList; } $("#dataTable", window.parent.document).tablesorter({sortList: sortList2}).tablesorterPager({container: $("#pager", window.parent.document), size: window.parent.document.getElementById('numPages').value, fixedHeight: true, page: window.pageNumber})window.parent.document.getElementById('pagerWrapper').style.display = 'block';;$("#dataTable", window.parent.document).on("sortEnd", function(event) {sortList = event.target.config.sortList;});positionPager(); } //} } oldMarkers = featuresinBox; //console.log("Hey, I found "+featuresinBox.length+" points on the map!!"); //console.log(featuresinBox); }}function prevMonth(name){name = name.substring(name.indexOf('_')+1);var fromHome = "0";var year = document.forms["data_"+name].elements["year"+name].value;var month = document.forms["data_"+name].elements["month"+name].value;var year2 = year;if (month == "Jan"){var month2 = "Dec";year2 = year-1;} else if (month == "Feb") {var month2 = "Jan";} else if (month == "Mar") {var month2 = "Feb";} else if (month == "Apr") {var month2 = "Mar";} else if (month == "May") {var month2 = "Apr";} else if (month == "Jun") {var month2 = "May";} else if (month == "Jul") {var month2 = "Jun";} else if (month == "Aug") {var month2 = "Jul";} else if (month == "Sep") {var month2 = "Aug";} else if (month == "Oct") {var month2 = "Sep";} else if (month == "Nov") {var month2 = "Oct";} else if (month == "Dec") {var month2 = "Nov";}document.forms["data_"+name].elements["year"+name].value = year2;document.forms["data_"+name].elements["month"+name].value = month2;if (name == "snow") {document.forms["data_"+name].elements["year"+name+"2"].value = year2;document.forms["data_"+name].elements["month"+name+"2"].value = month2;}var day = "01";if (document.getElementById("day"+name)) {day = document.getElementById("day"+name).value;}if (document.getElementById(window.id2)&&document.getElementById(window.id2).checked&&archiveProds.indexOf(window.id2)>-1) {toggleKML2(document.getElementById(window.id2).checked, window.id2, 0, name);//whichPlottingFunction(document.getElementById(type).checked, window.id2, 0, month2,year2,name)}if (document.getElementById(window.imageType)&&document.getElementById(window.imageType).checked) {//toggleKML2(document.getElementById(type).checked, type, 0, name);whichPlottingFunction(document.getElementById(window.imageType).checked, window.imageType, 0, month2,year2,name,false,day)}if (fromHome != 1) {document.getElementById('monthText').value = month2;document.getElementById('yearText').value = year2;//document.getElementById('monthTextArea').value = month2;//document.getElementById('yearTextArea').value = year2;}document.getElementById('monthKML').value = month2;document.getElementById('yearKML').value = year2;//document.getElementById('monthKMLArea').value = month2;//document.getElementById('yearKMLArea').value = year2;}function nextMonth(name){name = name.substring(name.indexOf('_')+1);var year = parseInt(document.forms["data_"+name].elements["year"+name].value);var month = document.forms["data_"+name].elements["month"+name].value;var type = window.id2;var year2 = year;if (month == "Jan"){var month2 = "Feb";} else if (month == "Feb") {var month2 = "Mar";} else if (month == "Mar") {var month2 = "Apr";} else if (month == "Apr") {var month2 = "May";} else if (month == "May") {var month2 = "Jun";} else if (month == "Jun") {var month2 = "Jul";} else if (month == "Jul") {var month2 = "Aug";} else if (month == "Aug") {var month2 = "Sep";} else if (month == "Sep") {var month2 = "Oct";} else if (month == "Oct") {var month2 = "Nov";} else if (month == "Nov") {var month2 = "Dec";} else if (month == "Dec") {var month2 = "Jan";year2 = year+1;}document.forms["data_"+name].elements["year"+name].value = year2;document.forms["data_"+name].elements["month"+name].value = month2;if (name == "snow") {document.forms["data_"+name].elements["year"+name+"2"].value = year2;document.forms["data_"+name].elements["month"+name+"2"].value = month2;}var day = "01";if (document.getElementById("day"+name)) {day = document.getElementById("day"+name).value;}if (document.getElementById(window.id2)&&document.getElementById(window.id2).checked&&archiveProds.indexOf(window.id2)>-1) {toggleKML2(document.getElementById(window.id2).checked, window.id2, 0, name);//whichPlottingFunction(document.getElementById(type).checked, window.id2, 0, month2,year2,name)}if (document.getElementById(window.imageType)&&document.getElementById(window.imageType).checked) {//toggleKML2(document.getElementById(type).checked, type, 0, name);whichPlottingFunction(document.getElementById(window.imageType).checked, window.imageType, 0, month2,year2,name,false,day)}if (fromHome != 1) {document.getElementById('monthText').value = month2;document.getElementById('yearText').value = year2;//document.getElementById('monthTextArea').value = month2;//document.getElementById('yearTextArea').value = year2;}document.getElementById('monthKML').value = month2;document.getElementById('yearKML').value = year2;//document.getElementById('monthKMLArea').value = month2;//document.getElementById('yearKMLArea').value = year2;}function newMonth(name){name = name.substring(name.indexOf('_')+1);var fromHome = "0";var year2 = document.forms["data_"+name].elements["year"+name].value;var month2 = document.forms["data_"+name].elements["month"+name].value;document.forms["data_"+name].elements["year"+name].value = year2;document.forms["data_"+name].elements["month"+name].value = month2;if (name == "snow") {document.forms["data_"+name].elements["year"+name+"2"].value = year2;document.forms["data_"+name].elements["month"+name+"2"].value = month2;}var day = "01";if (document.getElementById("day"+name)) {day = document.getElementById("day"+name).value;}if (document.getElementById(window.id2)&&document.getElementById(window.id2).checked&&archiveProds.indexOf(window.id2)>-1) {toggleKML2(document.getElementById(window.id2).checked, window.id2, 0, name);//whichPlottingFunction(document.getElementById(type).checked, window.id2, 0, month2,year2,name)}if (document.getElementById(window.imageType)&&document.getElementById(window.imageType).checked) {//toggleKML2(document.getElementById(type).checked, type, 0, name);whichPlottingFunction(document.getElementById(window.imageType).checked, window.imageType, 0, month2,year2,name,false,day)}if (fromHome != 1) {document.getElementById('monthText').value = month2;document.getElementById('yearText').value = year2;//document.getElementById('monthTextArea').value = month2;//document.getElementById('yearTextArea').value = year2;}document.getElementById('monthKML').value = month2;document.getElementById('yearKML').value = year2;//document.getElementById('monthKMLArea').value = month2;//document.getElementById('yearKMLArea').value = year2;}function prevDay(name){name = name.substring(name.indexOf('_')+1);var fromHome = "0";var oldYear = document.forms["data_"+name].elements["year"+name].value;var oldDay = document.forms["data_"+name].elements["day"+name].value;var oldMonth = document.forms["data_"+name].elements["month"+name].valuevar oldDate = new Date(oldMonth+' '+oldDay+', '+oldYear);var newDate = new Date(oldDate.getTime() - 86400000);var newMonth = newDate.f('NNN');var newDay = newDate.f('dd');var newYear = newDate.f('yyyy');document.forms["data_"+name].elements["year"+name].value = newYear;document.forms["data_"+name].elements["day"+name].value = newDay;document.forms["data_"+name].elements["month"+name].value = newMonth;if (name == "snow") {document.forms["data_"+name].elements["year"+name+"2"].value = newYear;document.forms["data_"+name].elements["month"+name+"2"].value = newMonth;}var day = "01";if (document.getElementById("day"+name)) {day = document.getElementById("day"+name).value;}if (document.getElementById(window.id2)&&document.getElementById(window.id2).checked&&archiveProds.indexOf(window.id2)>-1) {toggleKML2(document.getElementById(window.id2).checked, window.id2, 0, name);//whichPlottingFunction(document.getElementById(type).checked, window.id2, 0, month2,year2,name)}if (document.getElementById(window.imageType)&&document.getElementById(window.imageType).checked) {//toggleKML2(document.getElementById(type).checked, type, 0, name);whichPlottingFunction(document.getElementById(window.imageType).checked, window.imageType, 0, newMonth,newYear,name,false,day)}if (fromHome != 1) {document.getElementById('monthText').value = newMonth;document.getElementById('yearText').value = newYear;//document.getElementById('monthTextArea').value = month2;//document.getElementById('yearTextArea').value = year2;}document.getElementById('monthKML').value = newMonth;document.getElementById('yearKML').value = newYear;//document.getElementById('monthKMLArea').value = month2;//document.getElementById('yearKMLArea').value = year2;}function nextDay(name){name = name.substring(name.indexOf('_')+1);var fromHome = "0";var oldYear = document.forms["data_"+name].elements["year"+name].value;var oldDay = document.forms["data_"+name].elements["day"+name].value;var oldMonth = document.forms["data_"+name].elements["month"+name].value;var oldDate = new Date(oldMonth+' '+oldDay+', '+oldYear);var newDate = new Date(oldDate.getTime() + 86400000);var newMonth = newDate.f('NNN');var newDay = newDate.f('dd');var newYear = newDate.f('yyyy');document.forms["data_"+name].elements["year"+name].value = newYear;document.forms["data_"+name].elements["day"+name].value = newDay;document.forms["data_"+name].elements["month"+name].value = newMonth;if (name == "snow") {document.forms["data_"+name].elements["year"+name+"2"].value = newYear;document.forms["data_"+name].elements["month"+name+"2"].value = newMonth;}var day = "01";if (document.getElementById("day"+name)) {day = document.getElementById("day"+name).value;}if (document.getElementById(window.id2)&&document.getElementById(window.id2).checked&&archiveProds.indexOf(window.id2)>-1) {toggleKML2(document.getElementById(window.id2).checked, window.id2, 0, name);//whichPlottingFunction(document.getElementById(type).checked, window.id2, 0, month2,year2,name)}if (document.getElementById(window.imageType)&&document.getElementById(window.imageType).checked) {//toggleKML2(document.getElementById(type).checked, type, 0, name);whichPlottingFunction(document.getElementById(window.imageType).checked, window.imageType, 0, newMonth,newYear,name,false,day)}if (fromHome != 1) {document.getElementById('monthText').value = newMonth;document.getElementById('yearText').value = newYear;//document.getElementById('monthTextArea').value = month2;//document.getElementById('yearTextArea').value = year2;}document.getElementById('monthKML').value = newMonth;document.getElementById('yearKML').value = newYear;//document.getElementById('monthKMLArea').value = month2;//document.getElementById('yearKMLArea').value = year2;}function prevMonthArea(){var year = document.forms["data_waterResources"].elements["yearArea"].value;var month = document.forms["data_waterResources"].elements["monthArea"].value;var type = document.forms["data_waterResources"].elements["typeArea"].value;var year2 = year;if (month == "Jan"){var month2 = "Dec";year2 = year-1;} else if (month == "Feb") {var month2 = "Jan";} else if (month == "Mar") {var month2 = "Feb";} else if (month == "Apr") {var month2 = "Mar";} else if (month == "May") {var month2 = "Apr";} else if (month == "Jun") {var month2 = "May";} else if (month == "Jul") {var month2 = "Jun";} else if (month == "Aug") {var month2 = "Jul";} else if (month == "Sep") {var month2 = "Aug";} else if (month == "Oct") {var month2 = "Sep";} else if (month == "Nov") {var month2 = "Oct";} else if (month == "Dec") {var month2 = "Nov";}document.forms["data_waterResources"].elements["yearArea"].value = year2;document.forms["data_waterResources"].elements["monthArea"].value = month2;if (document.data_waterResources.archiveArea.checked) {whichPlottingFunction(document.data_waterResources.archiveArea.checked, document.data_waterResources.archiveArea.id, 0, document.data_waterResources.month.value,document.data_waterResources.year.value, "waterResources");}if (fromHome != 1) {//document.getElementById('monthText').value = month2;//document.getElementById('yearText').value = year2;document.getElementById('monthTextArea').value = month2;document.getElementById('yearTextArea').value = year2;}//document.getElementById('monthKML').value = month2;//document.getElementById('yearKML').value = year2;document.getElementById('monthKMLArea').value = month2;document.getElementById('yearKMLArea').value = year2;}function nextMonthArea(){var year = parseInt(document.forms["data_waterResources"].elements["yearArea"].value);var month = document.forms["data_waterResources"].elements["monthArea"].value;var type = document.forms["data_waterResources"].elements["typeArea"].value;var year2 = year;if (month == "Jan"){var month2 = "Feb";} else if (month == "Feb") {var month2 = "Mar";} else if (month == "Mar") {var month2 = "Apr";} else if (month == "Apr") {var month2 = "May";} else if (month == "May") {var month2 = "Jun";} else if (month == "Jun") {var month2 = "Jul";} else if (month == "Jul") {var month2 = "Aug";} else if (month == "Aug") {var month2 = "Sep";} else if (month == "Sep") {var month2 = "Oct";} else if (month == "Oct") {var month2 = "Nov";} else if (month == "Nov") {var month2 = "Dec";} else if (month == "Dec") {var month2 = "Jan";year2 = year+1;}document.forms["data_waterResources"].elements["yearArea"].value = year2;document.forms["data_waterResources"].elements["monthArea"].value = month2;if (document.data_waterResources.archiveArea.checked) {whichPlottingFunction(document.data_waterResources.archiveArea.checked, document.data_waterResources.archiveArea.id, 0, document.data_waterResources.month.value,document.data_waterResources.year.value, "waterResources");}if (fromHome != 1) {//document.getElementById('monthText').value = month2;//document.getElementById('yearText').value = year2;document.getElementById('monthTextArea').value = month2;document.getElementById('yearTextArea').value = year2;}//document.getElementById('monthKML').value = month2;//document.getElementById('yearKML').value = year2;document.getElementById('monthKMLArea').value = month2;document.getElementById('yearKMLArea').value = year2;}function inIframe () {try {return window.self !== window.top;} catch (e) {return true;}}function scriptEnd (file,allowCtrlClick) {if (typeof allowCtrlClick === "undefined") {allowCtrlClick = true;}var briefing = 0;//document.getElementById('gageCount').innerHTML = 'Total gages: ' + numberWithCommas(count);document.getElementById('gageCount').style.display = 'block';if (!briefing) {if (allowCtrlClick ) {document.getElementById('ctrlClick').style.display = 'block';} else {document.getElementById('ctrlClick').style.display = 'none';}}loadingOff();//$("#markerTable").load('/xmlTablePHP.php?file='+file);layerLoaded = true;//console.log('layer loaded');}function loadingOff (products=1) {//console.log('OFF');productCount += 1;if (productCount >= products) { document.getElementById('loading').style.display='none'; productCount = 0;}//console.log('render');}function loadingOn () {//console.log('ON'); document.getElementById('loading').style.display='block';}var getClosestValues = function(a, x,before) {before = before || false;var index = x.indexOf('/');if (index > -1 ) {var first = pad(x.substring(0,index),2);var second = pad(x.substring(index+1),2);x = first+second;if (before) {return x;}}if (x 1) { var mid = Math.round((lo + hi)/2); if (a[mid] <= x) { lo = mid; } else { hi = mid; } } if (a[lo] == x) hi = lo; //return [a[lo], a[hi]];return lo;}function pad(num, size) { var s = num+""; while (s.length < size) s = "0" + s; return s;}function geoCode(){ popupGEO.setPosition(undefined);var location=document.getElementById("geolocate");address=location.value;id = address.toUpperCase();window.idGEO = id;if (typeof window.stnLat[id] != 'undefined') { map.setView(new ol.View({center: ol.proj.transform([parseFloat(window.stnLon[id]),parseFloat(window.stnLat[id])], 'EPSG:4326', 'EPSG:3857'), zoom: 11}));mapSearchLabel(parseFloat(window.stnLat[id]),parseFloat(window.stnLon[id]),id);document.getElementById("geolocate").value = id;} else if (id.substr(0,1) == 'K' && id.length == 4 && typeof window.stnLat[id.substr(1,4)] != 'undefined') {id = id.substr(1,4);map.setView(new ol.View({center: ol.proj.transform([parseFloat(window.stnLon[id]),parseFloat(window.stnLat[id])], 'EPSG:4326', 'EPSG:3857'), zoom: 11}));mapSearchLabel(parseFloat(window.stnLat[id]),parseFloat(window.stnLon[id]),id);document.getElementById("geolocate").value = id;} /* else {geocoder = new ol.maps.Geocoder();var gcReq={address:address};geocoder.geocode(gcReq,function(point,status){if (status == ol.maps.GeocoderStatus.OK){latinput=point[0].geometry.location.lat();loninput=point[0].geometry.location.lng();gmap.setCenter(new ol.maps.LatLng(latinput,loninput));gmap.setZoom(10);document.getElementById("geolocate").value = address.toTitleCase();mapSearchLabel(latinput,loninput,address.toTitleCase());}});} */}window.mapSearchLbl = "";function mapSearchLabel(lat,lon,loc) { var coord = ol.proj.transform([lon,lat], 'EPSG:4326', 'EPSG:3857') popupGEO.setPosition(coord); popupDIVcontentGEO.innerHTML = window.idGEO; //popupGEODIV.style.display='block';/*if (window.mapSearchLbl != "") {window.mapSearchLbl.setMap(null);window.mapSearchLbl = "";}var latLng = new ol.maps.LatLng(lat, lon);var image = {url: '/images/misc/arrow.png', size: new ol.maps.Size(9,11),origin: new ol.maps.Point(0,0),anchor: new ol.maps.Point(4.5,0) };window.mapSearchLbl = new MarkerWithLabel({ position: latLng, draggable: false, map: gmap, labelContent: loc, labelAnchor: new ol.maps.Point(0, -8), labelClass: "mapSearchLabel", // the CSS class for the label labelStyle: {opacity: 1.0}, icon: image, zIndex: 2, labelZIndex: 1 }); var iw1 = new ol.maps.InfoWindow({// content: "Home For Sale" }); ol.maps.event.addListener(window.mapSearchLbl, "click", function (e) { window.mapSearchLbl.setMap(null); }); */}String.prototype.toTitleCase = function() { var i, str, lowers, uppers; str = this.replace(/([^\W_]+[^\s-]*) */g, function(txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); }); // Certain minor words should be left lowercase unless // they are the first or last words in the string lowers = ['A', 'An', 'The', 'And', 'But', 'Or', 'For', 'Nor', 'As', 'At', 'By', 'For', 'From', 'In', 'Into', 'Near', 'Of', 'On', 'Onto', 'To', 'With']; for (i = 0; i < lowers.length; i++) str = str.replace(new RegExp('\\s' + lowers[i] + '\\s', 'g'), function(txt) { return txt.toLowerCase(); }); // Certain words such as initialisms or acronyms should be left uppercase uppers = ['Id', 'Tv', 'Ca', 'Or', 'Nv']; for (i = 0; i < uppers.length; i++) str = str.replace(new RegExp('\\b' + uppers[i] + '\\b', 'g'), uppers[i].toUpperCase()); return str;}//alert("Location \""+address+"\" not found.");function manageFilters(checked,id) {if (id=="PW") {return;}//return;//console.log(checked+" | " + id);var briefing = "0";if (briefing == 0) {if ((document.getElementById('flow2dateWY').checked || document.getElementById('flow2dateWYprev').checked || document.getElementById('espfcst').checked || document.getElementById('espfcstWY').checked || document.getElementById('wsfcst').checked || document.getElementById('resNormal').checked || document.getElementById('resNormalMajor').checked || document.getElementById('resCap').checked || document.getElementById('resCapMajor').checked || document.getElementById('monthlyFlow').checked) && id != 'fcstpeaks' && id != 'archive' && id != 'flow2dateWY' && id != 'flow2dateWYprev' && id != 'espfcst' && id != 'espfcstWY' && id != 'wsfcst') {} else {}document.getElementById('capacityfilter').style.display = 'none';document.getElementById('QPEfilter').style.display = 'none';document.getElementById('obsTempsfilter').style.display = 'none';document.getElementById('SWEfilter').style.display = 'none';document.getElementById('SDfilter').style.display = 'none';document.getElementById('obsTempsChgfilter').style.display = 'none';document.getElementById('SWEChgfilter').style.display = 'none';document.getElementById('SDChgfilter').style.display = 'none';document.getElementById('waterTempsfilter').style.display = 'none';document.getElementById('categoryfilter').style.display = 'none';document.getElementById('peakDatesfilter').style.display = 'none';document.getElementById('estFilter').style.display = 'none';document.getElementById('filters').style.display = 'none';//if (document.getElementById('type')) {//var typeVar = document.getElementById('type').value;//}//console.log('window.id2 '+window.id2);//console.log('typeVar '+typeVar);if (checked) {if (window.id2 == 'ta18' || window.id2 == 'ta00' || window.id2 == 'ta06' || window.id2 == 'ta12' || window.id2 == 'taX' || window.id2 == 'taN' || window.id2 == 'pp18' || window.id2 == 'pp00' || window.id2 == 'pp06' || window.id2 == 'pp12' || window.id2 == 'pp24') {document.getElementById('estFilter').style.display = 'block';}//console.log('window.id2 is '+window.id2);if (window.id2 == 'onehourP' || window.id2 == 'twohourP' || window.id2 == 'threehourP' ||window.id2 == 'sixhourP' || window.id2 == 'twelvehourP' || window.id2 == 'twentyfourhourP' || window.id2 == 'fourtyeighthourP' || window.id2 == 'seventytwohourP' || window.id2 == 'ninetysixhourP' || window.id2 == 'onetwentyhourP' || window.id2 == 'onefortyfourhourP' || window.id2 == 'onesixtyeighthourP' || window.id2 == 'sixhour18z' || window.id2 == 'sixhour00z' || window.id2 == 'sixhour06z' || window.id2 == 'sixhour12z' || window.id2 == 'twentyfourhour12z' || window.id2 == 'pp18' || window.id2 == 'pp00' || window.id2 == 'pp06' || window.id2 == 'pp12' || window.id2 == 'pp24' || window.id2=='PPS' || window.id2 == "PPM") {//console.log('turn filters on!!!');document.getElementById('filters').style.display = 'block';document.getElementById('gageCount').style.display = 'block';document.getElementById('ctrlClick').style.display = 'block';document.getElementById('QPEfilter').style.display = 'block';} else if (window.id2 == 'zerohourT' || window.id2 == 'onehourT' || window.id2 == 'twohourT' || window.id2 == 'threehourT' ||window.id2 == 'fourhourT' || window.id2 == 'fivehourT' || window.id2 == 'ta18' || window.id2 == 'ta00' || window.id2 == 'ta06' || window.id2 == 'ta12' || window.id2 == 'MxT' || window.id2 == 'MnT' || window.id2 == 'taX' || window.id2 == 'taN' || window.id2 == 'maxTday' || window.id2 == 'minTday') {document.getElementById('filters').style.display = 'block';document.getElementById('gageCount').style.display = 'block';document.getElementById('ctrlClick').style.display = 'block';document.getElementById('obsTempsfilter').style.display = 'block';} else if (window.id2 == 'zeroSWE' || window.id2 == 'oneSWE' || window.id2 == 'twoSWE' || window.id2 == 'threeSWE' || window.id2 == 'fourSWE' || window.id2 == 'fiveSWE' || window.id2 == 'sixSWE' || window.id2 == 'sevenSWE' || window.id2=="PPS" || window.id2=="PPM" || window.id2=="SWM") {document.getElementById('filters').style.display = 'block';document.getElementById('gageCount').style.display = 'block';document.getElementById('ctrlClick').style.display = 'block';document.getElementById('SWEfilter').style.display = 'block';} else if (window.id2 == 'zeroSD' || window.id2 == 'oneSD' || window.id2 == 'twoSD' || window.id2 == 'threeSD' || window.id2 == 'fourSD' || window.id2 == 'fiveSD' || window.id2 == 'sixSD' || window.id2 == 'sevenSD') {document.getElementById('filters').style.display = 'block';document.getElementById('gageCount').style.display = 'block';document.getElementById('ctrlClick').style.display = 'block';document.getElementById('SDfilter').style.display = 'block';} else if (window.id2 == 'onehourTC' || window.id2 == 'twentyfourhourTC') {document.getElementById('filters').style.display = 'block';document.getElementById('gageCount').style.display = 'block';document.getElementById('ctrlClick').style.display = 'block';document.getElementById('obsTempsChgfilter').style.display = 'block';} else if (window.id2 == 'oneDiffSWE' || window.id2 == 'threeDiffSWE' || window.id2 == 'fiveDiffSWE' || window.id2 == 'sevenDiffSWE' || window.id2 == 'fourteenDiffSWE' || window.id2 == 'thirtyDiffSWE') {document.getElementById('filters').style.display = 'block';document.getElementById('gageCount').style.display = 'block';document.getElementById('ctrlClick').style.display = 'block';document.getElementById('SWEChgfilter').style.display = 'block';} else if (window.id2 == 'oneDiffSD' || window.id2 == 'threeDiffSD' || window.id2 == 'fiveDiffSD' || window.id2 == 'sevenDiffSD' || window.id2 == 'fourteenDiffSD' || window.id2 == 'thirtyDiffSD') {document.getElementById('filters').style.display = 'block';document.getElementById('gageCount').style.display = 'block';document.getElementById('ctrlClick').style.display = 'block';document.getElementById('SDChgfilter').style.display = 'block';} else if (window.id2 == 'zerohourWT' || window.id2 == 'onehourWT' || window.id2 == 'twohourWT' || window.id2 == 'threehourWT' ||window.id2 == 'fourhourWT' || window.id2 == 'fivehourWT') {document.getElementById('filters').style.display = 'block';document.getElementById('gageCount').style.display = 'block';document.getElementById('ctrlClick').style.display = 'block';document.getElementById('waterTempsfilter').style.display = 'block';} else if (window.id2 == 'wsfcst' || window.id2 == 'flow2dateWY' || window.id2 == 'flow2dateWYprev' || window.id2 == 'espfcst' || window.id2 == 'espfcstWY' || window.id2 == "resNormal" || window.id2 == "resNormalMajor" || window.id2 == "monthlyFlow") {//document.getElementById('gradCell').style.background = "#6666CC";//document.getElementById('gradCell2').style.background = "#6699CC";document.getElementById('filters').style.display = 'block';document.getElementById('categoryfilter').style.display = 'block';document.getElementById('gageCount').style.display = 'block';document.getElementById('ctrlClick').style.display = 'block';} else if (window.id2 == "resCap" || window.id2 == "resCapMajor") {document.getElementById('filters').style.display = 'block';document.getElementById('capacityfilter').style.display = 'block';document.getElementById('gageCount').style.display = 'block';document.getElementById('ctrlClick').style.display = 'block';} else if (window.id2 == 'zeroSWEavg' || window.id2 == 'aprSWEavg' || window.id2=="PNS" || window.id2 == "PNM" || window.id2 == "SNM") {//document.getElementById('gradCell').style.background = "no-repeat url('/images/misc/gradBack.png')";//document.getElementById('gradCell2').style.background = "#00CCFF";document.getElementById('filters').style.display = 'block';document.getElementById('categoryfilter').style.display = 'block';document.getElementById('gageCount').style.display = 'block';document.getElementById('ctrlClick').style.display = 'block';} else if (window.id2 == 'obspeaks' || window.id2 == 'fcstpeaks') {document.getElementById('filters').style.display = 'block';document.getElementById('peakDatesfilter').style.display = 'block';} else {if (document.getElementById('flow2dateWY').checked || document.getElementById('flow2dateWYprev').checked || document.getElementById('espfcst').checked || document.getElementById('espfcstWY').checked || document.getElementById('wsfcst').checked || document.getElementById('resNormal').checked || document.getElementById('resNormalMajor').checked || document.getElementById('resCap').checked || document.getElementById('resCapMajor').checked ) {} else {document.getElementById('gageCount').style.display = 'none';document.getElementById('ctrlClick').style.display = 'none';document.getElementById('filters').style.display = 'none';}}} else {if (document.getElementById('flow2dateWY').checked || document.getElementById('flow2dateWYprev').checked || document.getElementById('espfcst').checked || document.getElementById('espfcstWY').checked || document.getElementById('wsfcst').checked || document.getElementById('resNormal').checked || document.getElementById('resNormalMajor').checked || document.getElementById('resCap').checked || document.getElementById('resCapMajor').checked ) {} else {document.getElementById('gageCount').style.display = 'none';document.getElementById('ctrlClick').style.display = 'none';document.getElementById('filters').style.display = 'none';}}}}function LaunchCGIprogram(type) {loadingOn();var result = jQuery.get("/gfe/scripts/make_PNG_web.cgi?imageA="+document.getElementById(type+'customMin').value+"&imageB="+(document.getElementById(type+'customMax').value-1)+"&type="+type);result.done(function() { loadingOff();togglePNG(type,true,'custom', type+'custom');});result.fail(function() { loadingOff();$( "#dialog-modal" ).dialog( "open" );});}window.dateStamp = '';function LaunchCGIprogramMQC(type) {//alert('here we go!');//document.getElementById('waterResourcesCustomButton').disabled = true;//document.getElementById('waterResourcesCustomButton').value = 'Please wait.......';loadingOn();//var result = jQuery.get("/gfe/scripts/make_PNG_mqc.cgi?startYear="+document.getElementById(type+'customMin').value+"&imageB="+(document.getElementById(type+'customMax').value-1)+"&type="+type);window.typeMQC = document.getElementById('MQCtype').value;window.MQCtype = $('#MQCtype option:selected').text();var startYear = document.getElementById('startYear').value;var endYear = document.getElementById('endYear').value;window.startYear = startYear;window.endYear = endYear;window.numYears = endYear-startYear+1;if (startYear > endYear) {alert('Start year cannot be greater than end year.');loadingOff();exit;}//window.dateStamp = Date.now();window.dateStamp = startYear+"."+endYear+"."+window.typeMQC;var result = jQuery.get("/gfe/scripts/make_PNG_mqc.cgi", {startYear: startYear, endYear: endYear, type: window.typeMQC, dateStamp: window.dateStamp});result.done(function(data) {//console.log(data);//var data = data.replace(/<\/?[^>]+(>|$)/g, "").replace(/\r?\n|]r/g,"").split('.');//var dateString = data[0];//window.dateStamp = dateString;//var type2 = data[1];togglePNG(type,true,'custom', type+'custom');document.getElementById('MQCcustom').checked=true;loadingOff();//document.getElementById('waterResourcesCustomButton').disabled = false;//document.getElementById('waterResourcesCustomButton').value = 'Generate Image';});result.fail(function() { loadingOff();$( "#dialog-modal" ).dialog( "open" );});}function numberWithCommas(x) { var parts = x.toString().split("."); parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); return parts.join(".");}function checkPostRender() {link = getLink();if (window.location.href != link && !window.location.href.includes("water_resources_update")) {//window.history.pushState('what', 'Title', link);window.history.replaceState('CNRFC', 'CNRFC - California Nevada River Forecast Center', link);}}function loadTabs(){ident = arguments[0];stn = arguments[1];river = arguments[2];info = arguments[3];info = info.replace(/\"/gi, '');var content1 = [];var html = ''+river+' \n"; var sortCol = 1; } markerLayer.getSource().forEachFeature(function(e) { if (ol.extent.containsCoordinate(map.getView().calculateExtent(map.getSize()), e.getGeometry().getCoordinates())) { featuresinBox.push(e); if (e.get('id').slice(-4) != 'test') { if (inIframe()) { if (product == 'ensPoints') { table=table+"Location Value"+unitString+" \n"; } else {table=table+""+e.get('stn')+" \n"; } } else { if (product == 'ensPoints') { table=table+""+e.get('stn')+" "+e.get('amt')+" \n"; } else {table=table+""+e.get('stn')+" \n"; } } } } }); count = featuresinBox.length; document.getElementById('gageCount').innerHTML = 'Markers: ' + numberWithCommas(count); table = table+""+e.get('stn')+" "+e.get('amt')+"
'+stn+'
Rollover links for more:';var j = 0;for (var i = 4; i < arguments.length; i = i + 3) {var content = "Click image below for more details:";if (i == 4) {content1[j] = content;}html = html + ''+arguments[i]+'';j+=1;}html = html + 'Station info';var j = 0;for (var i = 4; i < arguments.length; i = i + 3) {if (j == 0) {html = html + '
'+feature.get('location')+'
', FGCOLOR, feature.get('color'), BGCOLOR, '#000000', TEXTCOLOR, feature.get('textColor'));} if ($( "#markerTable", window.parent.document ).dialog( "isOpen" )) {$('#dataTable > tbody > tr', window.parent.document).each(function(){$(this).removeClass('hoverClass');});$('#tr'+id[0], window.parent.document).addClass('hoverClass');} map.getTarget().style.cursor = 'pointer'; } else { nd(); if ($( "#markerTable" , window.parent.document).dialog( "isOpen" )) {$('#dataTable > tbody > tr', window.parent.document).each(function(){$(this).removeClass('hoverClass');});} map.getTarget().style.cursor = ''; }} });} if (type == 'clickLink') { $(map.getViewport()).on('click', function(e) {var pixel = map.getEventPixel(e.originalEvent);var output = map.forEachFeatureAtPixel(pixel, function(feature, layer) {return {hit: true, feature: feature,layer:layer}; }); if (typeof output != 'undefined') { var hit = output.hit; var feature = output.feature; } else { var hit = false; }if (hit) {if (feature.get('link2') != "") {nd();if (typeof feature.get('link2') != 'undefined') {window.open(feature.get('link2'),"_self")}}} });} if (type == 'click') { $(map.getViewport()).on('mousedown', function(evt) {prevView = map.getView().getCenter();}); map.on('click', function(evt) {var newView = map.getView().getCenter();if (prevView != newView) {return;}if ((document.getElementById('debrisFlowBasinProb') && document.getElementById('debrisFlowBasinProb').checked) || (document.getElementById('debrisFlowBasinProb2') && document.getElementById('debrisFlowBasinProb2').checked) || (document.getElementById('debrisFlowBasinProb3') && document.getElementById('debrisFlowBasinProb3').checked)) {var viewResolution = /** @type {number} */ (map.getView().getResolution());console.log(evt);return;var url = tileLayerSource.getFeatureInfoUrl(evt.coordinate, viewResolution, 'EPSG:3857',{'INFO_FORMAT': 'text/xml'});if (url) {downloadUrl(url, function(data) {markers = data.documentElement.getElementsByTagName('FIELDS');if (markers.length > 0) {P = markers[0].getAttribute("P");P = P * 100.0; popupDIVcontent.innerHTML = 'Probability:
' + P.toFixed(0) + '%'; popup.setPosition(evt.coordinate);popup.setOffset([3,0]);} else {popup.setPosition(undefined);}});}return;} // Check if control Key is pressed. If so, remove the top// marker under the cursor. Then exit without trying// to load the info popup.if (evt.originalEvent.ctrlKey) {var pixel = map.getEventPixel(evt.originalEvent);var features = [];var id = [];var featureTypes = [];var output = map.forEachFeatureAtPixel(pixel, function(feature) { features.push(feature); featureTypes.push(feature.get('type')); if (feature.get('type') == 'marker') { id.push(feature.get('id')); }});if ($.inArray('marker',featureTypes) > -1) { for (i = 0; i' + '' + feature.get('description') + '
'; } else if ($.inArray('majorRivers',featureTypes) > -1) { popupDIVcontent.innerHTML = '' + '' + feature.get('name') + '
'; } else if ($.inArray('burnareas',featureTypes) > -1) { popupDIVcontent.innerHTML = '' + '' + feature.get('name') + '
'; } else if ($.inArray('debrisFlow',featureTypes) > -1) { popupDIVcontent.innerHTML = '
' + feature.get('description') + '' + '' + feature.get('name') + '
'; } else if ($.inArray('wpcQpf',featureTypes) > -1) { popupDIVcontent.innerHTML = '
' + Math.round(feature.get('description')*100) + '%' + '' + feature.get('name') + '
'; } else { if (feature.get('description') === undefined) { popupDIVcontent.innerHTML = '' + '' + feature.get('name') + '' + '
'; } else { popupDIVcontent.innerHTML = '' + '' + feature.get('name') + '
'; } } //map.addOverlay(popup); popup.setPosition(newCoord); bubblePixel = pixel; //popupDIV.style.display = 'block'; popup.setOffset([0,0]); //shiftMap(newCoord,popup,popupDIV);} else {//popupDIV.style.display = 'none';popup.setPosition(undefined);}});}//console.log('time: '+window.time11+' type: '+window.type11);if (type == 'image') {$(map.getViewport()).on('mousemove', function(e) {var pixel = map.getEventPixel(e.originalEvent);var coord = map.getCoordinateFromPixel(pixel);var latlon = ol.proj.transform(coord, 'EPSG:3857', 'EPSG:4326')var lat = latlon[1];var lon = latlon[0];var time = window.time11;var time2 = window.time12;var type = window.type11;map.getTarget().style.cursor = 'crosshair';if (window.whichData == 'old') {lat = (Math.ceil(lat*20)/20).toFixed(2);lon = (Math.ceil(lon*20)/20).toFixed(2);} else {lat = (Math.ceil(lat*50)/50).toFixed(2);lon = (Math.ceil(lon*50)/50).toFixed(2);}if (type.substr(0,8) == "QPFverif") {val = parseFloat(window.point[lat+lon]);val2 = parseFloat(window.point2[lat+lon]);} else {val = parseFloat(window.point[lat+lon]);}if ("" == "true") {val2 = parseFloat(window.point2[lat+lon]);}elev2 = parseFloat(window.elev[lat+lon]);if (elev2 == -300.) {elev2 = 0.;} if (!briefing) { //var thisType = document.forms["data_waterResources"].elements["typeArea"].value; var thisType = window.imageType; } else { var thisType = ""; }if (val == -9999. || (time == "24Chg" && PNGimgnum[type+time2] == 1 && (type == "MaxTFcst" || type == "MinTFcst"))) {nd();//overlib(numberWithCommas(val.toFixed(decimals))+suffix+"
' + feature.get('description') + '
Elev: "+numberWithCommas(elev2.toFixed(0))+" ft.", FGCOLOR, '#AFDEF7', TEXTSIZE,2,TEXTCOLOR, 'black', WIDTH, 110, OFFSETX, 35, OFFSETY,20,BACKGROUND,'/data/icons/1px65opac.png');} else {if (type.substr(0,4) == "MaxT" || type.substr(0,4) == "MinT" || type.substr(0,4) == "Temp" || type == "FzLevel" || thisType == "QPEmonthlyPercentNormal" || thisType == "QPEWYPercentNormal" || (time == "custom" && type == "MQC" && window.typeMQC == "percent")) {var decimals = 0;} else {var decimals = 2;}if (type.substr(0,4) == "MaxT" || type.substr(0,4) == "MinT" || type.substr(0,4) == "Temp") {var suffix = "°F";var width = 50;} else if (type == "FzLevel") {var suffix = " ft.";var width=70;} else if (thisType == "QPEmonthlyPercentNormal" || thisType == "QPEWYPercentNormal" || (time == "custom" && type == "MQC" && window.typeMQC == "percent")) {var suffix = "%";var width=50;} else {var suffix = " in.";var width=55;}if (type.substr(0,8) == "QPFverif") {var diff = (val-val2);}if ((time == "Departure" || time == "24Chg" || ((thisType == "QPEmonthlyDeparture" || thisType == "QPEWYDeparture") && document.getElementById(thisType).checked) || (time == "custom" && type == "MQC" && window.typeMQC == "departure") ) && val > 0) {var leadChar = "+";} else if (type.substr(0,8) == "QPFverif" && diff > 0) {var leadChar = "+";} else {var leadChar = "";}if (type.substr(0,8) == "QPFverif") {var string = "Verification: " + leadChar + diff.toFixed(2)+" in.
QPF: "+val.toFixed(2)+" in.
QPE: "+val2.toFixed(2)+" in.";var width2=155;} else if ((thisType == "QPEmonthlyPercentNormal" || thisType == "QPEWYPercentNormal") && val < 0.0 && document.getElementById(thisType).checked) {var string = leadChar + "N/A" + suffix + " (Normal = 0.00 in.)";var width2 = 175;} else {var string = leadChar + numberWithCommas(val.toFixed(decimals))+suffix;var width2 = 110;}if (typeof window.point[lat+lon] == 'undefined') {nd();} else {var textSize = 2;if ("" == "true") {var textSize = 4;width = width + 35;if (window.type11 == "QPF" && (window.time11 == "6hr" || window.time11 == "24hr") && avgSnowLevelLoaded) {string = string + "
" + nearest100(parseFloat(window.point2[lat+lon])) + " ft.";} else {string = string;}}if (document.getElementById('showElev').checked) {overlib(string+"
Elev: "+numberWithCommas(elev2.toFixed(0))+" ft.", FGCOLOR, '#AFDEF7', TEXTSIZE,textSize,TEXTCOLOR, 'black', WIDTH, width2, OFFSETX, 35, OFFSETY,20,BACKGROUND,'/data/icons/1px65opac.png');} else {overlib(string, FGCOLOR, '#AFDEF7', TEXTSIZE,textSize,TEXTCOLOR, 'black', WIDTH, width, OFFSETX, 35, OFFSETY,20,BACKGROUND,'/data/icons/1px65opac.png');}}//gmap.setOptions({ draggableCursor: 'crosshair' });}});$(map.getViewport()).on('mouseout', function(e) {nd();$("#WWAinfo").hide();map.getTarget().style.cursor = '';});}}function stopListener(type,preserve,clearDataTable) {type = type || 'all';preserve = preserve || false;var listenerTypes = ["image","mousemoveMarker","clickKML","click","clickLink"];/*if (type == 'mousemoveMarker' || type == 'click' || type == 'image' || type == 'all') {$(map.getViewport()).off('mousemove');}*/if (type == 'click' || type == 'clickLink' || type == 'all') {//$(map.getViewport()).off('click');//popupDIV.style.display = 'none';//popup.setPosition(undefined);//map.removeOverlay(popup);}$(map.getViewport()).off('mousemove');$(map.getViewport()).off('mousedown');$(map.getViewport()).off('click');if (!preserve) {if (type == 'all') {for(var i=0; i
Topography
Topography/USGS
ESRI Topography
Shaded Relief
Imagery
Nat'l Geographic
Topo/Rivers
Topo/Hydro
Light Gray
Federal Lands
(large dots)
(small dots)
Download Overlay Files
Download Overlay Shapefiles Rivers/Reservoirs
Water Resources
Snow Data
Observed Precipitation (QPE)
Forecast Precipitation (QPF)
Observed Temperatures
Forecast Temperatures
Freezing Levels
Flash Flood Guidance/Debris Flow
Water Temperatures
Climate/Drought
QPF Verification
Watches/Warnings/Advisories
National Oceanic and Atmospheric Administration
National Weather Service
California Nevada River Forecast Center
3310 El Camino Avenue, Room 227
Sacramento, CA 95821-6373
(916) 979-3056
Information Quality
Help
Glossary
Links
Freedom of Information Act (FOIA)
About Us
Career Opportunities
California Nevada River Forecast Center (2024)
Table of Contents
Rivers/Reservoirs
Water Resources
Snow Data
Observed Precipitation (QPE)
Forecast Precipitation (QPF)
Observed Temperatures
Forecast Temperatures
Freezing Levels
Flash Flood Guidance/Debris Flow
Water Temperatures
Climate/Drought
QPF Verification
Watches/Warnings/Advisories
References
References
Top Articles
Nova Bedtextile B.V. | Best (73613541)
Mumbai Samachar ePaper PDF Download free Newspaper
What Time Do Minute Clinics Close
Craigslist For Cars Los Angeles
L’ Elegance – Sold Listings and Market Reports
The Knapsack Problem
TradingView - A Complete Beginner’s Guide - Your Best Platform for Charting and Technical Analysis (with PDF) - TradingTools
How To Trade Order Flow On TradingView
![](https://ts2.mm.bing.net/th?q=(Solved) - Which law would you use to simplify the expression mc^(006)-1.jpg?... (1 Answer) | Transtutors)
(Solved) - Which law would you use to simplify the expression mc^(006)-1.jpg?... (1 Answer) | Transtutors
5.2: Simplifying Radical Expressions
Evansville University Women's Soccer
Unlocking The Legacy Of Rita Stark: Discoveries And Insights In Early Childhood Education
Latest Posts
Master One Forex Trading Strategy at a Time » Learn To Trade The Market
Nova Bedtextile B.V. - Bedrijfsinformatie
Article information
Author: Fr. Dewey Fisher
Last Updated:
Views: 5588
Rating: 4.1 / 5 (62 voted)
Reviews: 93% of readers found this page helpful
Author information
Name: Fr. Dewey Fisher
Birthday: 1993-03-26
Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827
Phone: +5938540192553
Job: Administration Developer
Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball
Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.