Back to US Map
Mouse over counties to
view county name and SAME code
Transmitter Status
| Areas Receiving Alert Tones ![]() |
|
Geolocation to get your browser location (if you grant
permission)
";var Topo = L.tileLayer( 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', { maxZoom: 12 });var Roads = L.tileLayer( 'https://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}', { maxZoom: 12 });var Streets = L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 12 });var Satellite = L.tileLayer( 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { maxZoom: 12 });var Stamen_Terrain = L.tileLayer('https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}{r}.{ext}', {maxZoom: 12,ext: 'png'});var StamenFeatures = L.tileLayer( 'https://stamen-tiles-{s}.a.ssl.fastly.net/toposm-features/{z}/{x}/{y}.{ext}', { subdomains: 'abcd', minZoom: 0, maxZoom: 12, ext: 'png', bounds: [ [22, -132], [51, -56] ], opacity: 0.9, });map = new L.Map('map', { layers: [Topo], center: new L.LatLng(38.192778, -97.187778), zoom: 4, // Tell the map to use a loading control loadingControl: true, fullscreenControl: { pseudoFullscreen: true }});map.createPane('labels');map.getPane('labels').style.zIndex = 503;L.control.scale({ metric: false}).addTo(map);document.getElementById("information").innerHTML = info_string;function show_info() { var x = document.getElementById("information"); if (x.style.display === "none") { x.style.display = "block"; } else { x.style.display = "none"; }}// get the counties a transmitter is alertingfunction get_counties(xmittr) { for (x = 0; x <= CALLSIGN.length - 1; x++) { if (CALLSIGN[x] === xmittr) { // shade counties here var fips = SAME[x]; // Modify this line to get the full fips code... deal with leading zero too if necessary. fips = fips.substring(0, 6); fips_array.push(fips); continue; } }}// get the lat lon for a transmitterfunction get_latlon(xmittr) { for (y = 0; y <= CALLSIGN.length - 1; y++) { if (xmittr == CALLSIGN[y]) { lat = LAT[y]; lon = LON[y]; } } // set map center // map.setView(new L.LatLng(lat, lon), 9);}// Get the Site from the URLfunction getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); var ARGS = window.location.search.substring(1).toLowerCase().replace('?', ''); if (ARGS) { var args = ARGS.split('='); var site = ''; var SITE = ''; var chunk = args; if (chunk[0] == 'site' && chunk[1].length >= '5' && chunk[1].length <='7') { SITE = chunk[1].toUpperCase(); } else { alert( 'Something is wrong!\n Valid arguments are "State" followed by a valid site station callsign identifier\nExample:\nhttps://www.weather.gov/nwr/sites?site=WXJ33' ); window.location.href = 'https://www.weather.gov/nwr/maps'; } } return SITE;}function getStatus(xmittr) { for (x = 0; x <= CALLSIGN.length - 1; x++) { if (xmittr === CALLSIGN[x]) { var tmp = STATUS[x]; break; } } return tmp;}function getStateName(state_abrv) { for (i = 0; i <= ST.length - 1; i++) { var tmp_state = ST[i]; if (tmp_state === state_abrv) { state_tmp = SITESTATE[i]; break; } } statename = states[state_abrv]; return statename;}function markers(lat, lon, fips, name, xmittr) { console.log(fips + " " + name + " " + xmittr); skip = "false"; for (x = 0; x <= xmit.length - 1; x++) { var tmp_xmit = xmit[x]; var tmp_same = same[x]; if ((tmp_xmit == xmittr) && (fips == tmp_same)) { skip = "true"; break; } } var lz = fips.substring(0, 1); if (skip == "true") { console.log(fips + " " + name + " <-- Don't Display this label"); document.getElementById("zero_shown").innerHTML = "
Label not shown:
" + fips + ""; } else { if (lz == "0") { var same_string = "
" + fips + " |
"; } else { var same_string = "
" + fips + " |
"; sameLayer.on("add", function() { lbox.addTo(map); var x = document.getElementById("zero_shown"); if (x.style.display === "none") { x.style.display = "block"; } }); sameLayer.on("remove", function() { map.removeControl(lbox); var x = document.getElementById("zero_shown"); if (x.style.display === "block") { x.style.display = "none"; } }); } var myIcon = L.divIcon({ iconSize: [0, 0], html: same_string, iconAnchor: [20, 15] }); var tmp_marker = L.marker([lat, lon], { icon: myIcon, title: "Click for more information" }); var text_string = "
"; text_string += "County: | " + name + " |
SAME CODE: | " + fips + " |
"; tmp_marker.bindPopup(text_string).addTo(sameLayer); tmp_marker.on('click', function(ev) { ev.target.openPopup(); }); }}var xmittr = getQueryVariable("site");var status = getStatus(xmittr);// update the legend with the callsign and statusvar legend_string = "
Operating Status for " + xmittr + " |
" + status + " |
---|
";Legend.innerHTML = legend_string;var green = "#33FF33";var orange = "#FFB833";var red = "#FF3333";var fill = green;if (status == "DEGRADED") { fill = orange;}if (status == "OUT OF SERVICE") { fill = red;}var shpfile = new L.Shapefile('/source/nwr/hires/' + xmittr + ".zip", { style: function(feature) { return { color: "Black", opacity: 0.4, weight: 1, fillColor: fill, fillOpacity: 0.65 } }});shpfile.addTo(map);// Custom Stripesvar stripes = new L.StripePattern({ angle: 40, color: "Green", weight: 2.1});stripes.addTo(map);var stripes2 = new L.StripePattern({ angle: 40, color: "DarkGreen", weight: 4.1, opacity: 1.0});stripes2.addTo(map);get_counties(xmittr);var sameLayer = new L.layerGroup();var labelLayer = new L.layerGroup();var uscounties = new L.layerGroup();map.createPane('county_labels');map.getPane('county_labels').style.zIndex = 502;map.createPane('pca_labels0');map.getPane('pca_labels0').style.zIndex = 508;map.createPane('pca_labels1');map.getPane('pca_labels1').style.zIndex = 509;var state_borders = new L.Shapefile('/source/nwr/states.zip', { style: function(feature) { return { color: "Black", opacity: 0.9, weight: 2.4, fillColor: "White", fillOpacity: 0.1 } }});var highlightStyle = { color: '#2262CC', weight: 3, opacity: 0.6, fillOpacity: 0.4, fillColor: 'Gray'};var defaultStyle = { color: "#5b85fc", opacity: 0.7, weight: 0.7, fillColor: "White", fillOpacity: 0.1,}var shpfile1 = new L.Shapefile('/source/nwr/Counties5.zip', { style: function(feature) { return { color: "#5b85fc", opacity: 0.7, weight: 0.7, fillColor: "White", fillOpacity: 0.1, pane: 'county_labels' } }, onEachFeature: function(feature, layer) { var string = "
"; var fips = feature.properties.FIPS; if (fips.length <= 5) { fips = "0" + fips; } string += "SAME CODE: " + fips + "
"; layer.on('mouseover', function() { document.getElementById("counties").innerHTML = string; layer.setStyle(highlightStyle); }); layer.on('mouseout', function() { document.getElementById("counties").innerHTML = "Mouse over counties to
view county name and SAME code"; layer.setStyle(defaultStyle); }); }});shpfile1.addTo(uscounties);map.on('layeradd', function(event) { if (event.layer == uscounties) { document.getElementById("counties").style.display = "block"; }});map.on('layerremove', function(event) { if (event.layer == uscounties) { // do your events. document.getElementById("counties").innerHTML = "Mouse over counties to
view county name and SAME code"; //layers var overlayLayers = control.getActiveOverlayLayers() for (var overlayId in overlayLayers) { if (overlayLayers[overlayId].name == "Alerting Area") { document.getElementById("counties").style.display = "block"; } else { document.getElementById("counties").style.display = "none"; } if (overlayLayers[overlayId].name == "SAME Labels") { document.getElementById("counties").style.display = "block"; } } }});uscounties.addTo(map);uscounties.setZIndex(502);var clat = ""var clon = "";var cnam = "";var cfip = "";var highlightStyle2 = { color: "Green", opacity: 1.0, weight: 3.5, fillPattern: stripes2};var defaultStyle2 = { color: "Green", opacity: 1.0, weight: 1.5, fillPattern: stripes}for (x = 0; x <= fips_array.length - 1; x++) { // LOAD COUNTY ALERTING AREA SHAPE FILES if (fips_array[x] == "904021") { document.getElementById("note").innerHTML = "NOTE: The coverage area for Southeast Pinal (904021) is not shown on the map."; } var pca_val = fips_array[x].charAt(0); if (pca_val == "0") { var cntyfile1 = new L.Shapefile('/source/nwr/pca/' + fips_array[x] + '.zip', { style: function(feature) { return { color: "Green", opacity: 1.0, weight: 1.7, fillPattern: stripes, pane: 'pca_labels0' } }, onEachFeature: function(feature, layer) { var fips = feature.properties.AREA_FIPS; var string = "
"; string += "SAME CODE: " + feature.properties .AREA_FIPS + "
"; layer.on('mouseover', function() { document.getElementById("counties") .innerHTML = string; layer.setStyle(highlightStyle2); }); layer.on('mouseout', function() { document.getElementById("counties") .innerHTML = "Mouse over counties to
view county name and SAME code"; layer.setStyle(defaultStyle2); }); clat = feature.properties.LAT; clon = feature.properties.LON; cnam = feature.properties.NWR_NAME; cfip = feature.properties.AREA_FIPS; markers(clat, clon, cfip, cnam, xmittr); } }); cntyfile1.addTo(labelLayer); } else { if(pca_show == 0){ pca_show = 1; console.log("This site uses PCA"); document.getElementById("pca_message").style.display = "block"; var pca_message_string = "This transmitter utilizes Partial County Alerting to allow users to receive more localized alerts for their location.
More details about Partial County Alerting."; document.getElementById("pca_message").innerHTML = pca_message_string; } var cntyfile2 = new L.Shapefile('/source/nwr/pca/' + fips_array[x] + '.zip', { style: function(feature) { return { color: "Green", opacity: 1.0, weight: 1.7, fillPattern: stripes, pane: 'pca_labels1' } }, onEachFeature: function(feature, layer) { var fips = feature.properties.AREA_FIPS; var pca = ""; pca_val = fips.charAt(0); switch (pca_val) { case '1': pca = "Northwest"; break; case '2': pca = "Northern"; break; case '3': pca = "Northeast"; break; case '4': pca = "Western"; break; case '5': pca = "Central"; break; case '6': pca = "East"; break; case '7': pca = "Southwest"; break; case '8': pca = "Southern"; break; case '9': pca = "Southeast"; break; case '0': pca = ""; break; } var string = "
"; string += "SAME CODE: " + feature.properties.AREA_FIPS + "
"; layer.on('mouseover', function() { document.getElementById("counties").innerHTML = string; layer.setStyle(highlightStyle2); }); layer.on('mouseout', function() { document.getElementById("counties").innerHTML = "Mouse over counties to
view county name and SAME code"; layer.setStyle(defaultStyle2); }); clat = feature.properties.LAT; clon = feature.properties.LON; cnam = feature.properties.NWR_NAME; cfip = feature.properties.AREA_FIPS; // console.log(cnam + " " + cfip); markers(clat, clon, cfip, cnam, xmittr); } }); cntyfile2.addTo(labelLayer); }}map.on('layeradd', function(event) { if (event.layer == labelLayer) { document.getElementById("counties").style.display = "block"; var x = document.getElementById("zero_shown"); if (x.style.display === "none") { x.style.display = "block"; } }});map.on('layerremove', function(event) { if (event.layer == labelLayer) { // do your events. document.getElementById("counties").innerHTML = "Mouse over counties to
view county name and SAME code"; //layers var overlayLayers = control.getActiveOverlayLayers() for (var overlayId in overlayLayers) { if (overlayLayers[overlayId].name == "Counties") { document.getElementById("counties").style.display = "block"; } else { document.getElementById("counties").style.display = "none"; } if (overlayLayers[overlayId].name == "SAME Labels") { document.getElementById("counties").style.display = "block"; } } var x = document.getElementById("zero_shown"); if (x.style.display === "block") { x.style.display = "none"; } }});var controlbounds_shpfile = window.setInterval(function() { if (shpfile.getBounds().isValid() == true) { map.fitBounds(shpfile.getBounds()); window.clearInterval(controlbounds_shpfile); }}, 500);get_latlon(xmittr);get_freq(xmittr);var basemaps = { "TopoMap": Topo, "Streets": Streets, "Satellite": Satellite, "Terrain": Stamen_Terrain,};var overlayMap = { "Propagation": shpfile, "Counties": uscounties, "Alerting Area": labelLayer, "SAME Labels": sameLayer, "Features": StamenFeatures};var control = L.control.activeLayers(basemaps, overlayMap, { collapsed: false});control.addTo(map);map.on('click', function(e) { console.log("Lat, Lon : " + e.latlng.lat + ", " + e.latlng.lng);});var lbox = L.control({ position: 'bottomright'});// Alerting ArealabelLayer.addTo(map);labelLayer.setZIndex(505);lbox.onAdd = function(map) { this._div = L.DomUtil.create('div', 'lbox'); this.update(); return this._div;};lbox.update = function() { var text = '
Partial County Alerting | (1-9)XXXXX |
Entire County Alerting | 0XXXXX |
'; this._div.innerHTML = text;};function get_freq(xmittr) { var county_names = []; var thisstate; var string; var string2; var string3; var state; if (xmittr == "WNG675") { string3 = "
"; string3 += "Note: Wade Hampton County is now named Kusilvak."; string3 += "
"; } else { string3 = ""; } if (xmittr == "KZZ53") { string3 = "
"; string3 += "Note: Barrow, AK is now Utqiagvik, AK."; string3 += "
"; } else { string3 = ""; } for (i = 0; i <= CALLSIGN.length - 1; i++) { if (CALLSIGN[i] === xmittr) { var xmittr_freq = FREQ[i]; string2 = "
" string2 += "
Transmitter Details | |
Station ID | " + xmittr + " |
---|---|
Station Name | " + SITENAME[i] + " |
Frequency | " + FREQ[i] + " |
State | " + thisstate + " |
Station Location | " + SITELOC[i] + ", " + SITESTATE[i] + " |
Operating Status | " + STATUS[i] + " |
Operating Status | " + STATUS[i] + " |
Weather Forecast Office | " + wfo_tmp[0] + " " + wfo_tmp[1] + " |
"; string1 = "
" + xmittr + " Transmitter Details | |
Station ID | " + xmittr + " |
---|---|
Station Name | " + SITENAME[i] + " |
Frequency | " + FREQ[i] + " |
State | " + thisstate + " |
Station Location | " + SITELOC[i] + ", " + SITESTATE[i] + " |
Operating Status | " + STATUS[i] + " |
Operating Status | " + STATUS[i] + " |
"; string1 += "
"; break; } } var popup = L.popup() .setLatLng(lat, lng) .setContent(string1); shpfile.bindPopup(popup); var pca_on = 0; var pca = ""; // get data for xmitter for (xx = 0; xx <= CALLSIGN.length - 1; xx++) { if (CALLSIGN[xx] == xmittr) { var same_tmpB = SAME[xx]; var pca_val = same_tmpB.charAt(0); switch (pca_val) { case '1': pca = "Northwest"; pca_on++; break; case '2': pca = "North"; pca_on++; break; case '3': pca = "Northeast"; pca_on++; break; case '4': pca = "West"; pca_on++; break; case '5': pca = "Central"; pca_on++; break; case '6': pca = "East"; pca_on++; break; case '7': pca = "Southwest"; pca_on++; break; case '8': pca = "South"; pca_on++; break; case '9': pca = "Southeast"; pca_on++; break; case '0': pca = "ALL"; break; } } REMARKS[xx] = pca; } for (xx = 0; xx <= CALLSIGN.length - 1; xx++) { if (CALLSIGN[xx] == xmittr) { var same_tmpB = SAME[xx]; var pca_val = same_tmpB.charAt(0); if ((pca_val == 0) && (pca_on > 0)) { REMARKS[xx] = "Entire"; } } } tmp = document.getElementById("detail"); string2 += "
County | State | SAME Location Code | "; string2 += "Partial County Description |
---|---|---|---|
" + COUNTY[i] + " | " + STATE[i] + " | " + SAME[i] + " | " + REMARKS[i] + " |
"; tmp.innerHTML += string3; tmp.innerHTML += string2; document.getElementById("nwr").innerHTML = ""; document.getElementById("nwr").innerHTML += "