Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
-


## [2.8](https://github.com/USGS-WiM/fim-js/releases/tag/v2.8)

### Added

- NIMS cameras when available with links to HIVIS site

### Changed

-

### Fixed

-


## [2.7.1](https://github.com/USGS-WiM/fim-js/releases/tag/v2.7.1)

### Added
Expand Down
3 changes: 2 additions & 1 deletion build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,8 @@ <h3>
Web Cam
-->
<div id="ftWebcam" class="ftmodal-content">
<img src="" id="webcamImage" onerror="this.src='images/broken.png'"/>
<!-- <img src="" id="webcamImage" onerror="this.src='images/broken.png'"/> -->

</div>

<!--
Expand Down
55 changes: 52 additions & 3 deletions build/scripts/combined.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ var nwisUrl = "https://waterservices.usgs.gov/nwis/iv/?format=nwjson&period=P7D"
var historicalUrl = "http://nwis.waterdata.usgs.gov/ms/nwis/peak?agency_cd=USGS&format=rdb&site_no=";
var proxyUrl = "https://services.wim.usgs.gov/proxies/httpProxy/Default.aspx?";

var nimsUrl = "https://jj5utwupk5.execute-api.us-east-1.amazonaws.com/prod/cameras?siteId=";

require([
"esri/geometry/Extent",
"esri/InfoTemplate",
Expand Down Expand Up @@ -2375,17 +2377,64 @@ require([
//Web cam check and set up
//Web cam check and set up
//Web cam check and set up
if(feature.attributes.HAS_WEBCAM == "1"){ //Embed
if (feature.attributes.HAS_NIMS == "1" || feature.attributes.HAS_NIMS == "0" || feature.attributes.HAS_NIMS == null) {
console.log('has nims');
$("#webcamImage").hide();
$(".ft-webcam-link-tab").hide();
$("#ftWebcam").html("");

$("#nimsCam").attr('src', null);
$("#nimsCam").hide();

//code to retrieve latest webcam thumbnail timelapse gif
$.ajax({
dataType: 'json',
type: 'GET',
url: nimsUrl + siteAttr.SITE_NO,
headers: {'Accept': '*/*'},
success: function (data) {

$.each(data, function(key, camera) {
console.log(key, camera.locus);

if (camera.TL_enabled == true && camera.locus == "aws") {
$("#ftWebcam").append('<h3>' + camera.camDesc + '</h3><a target="_blank" href="https://apps.usgs.gov/hivis/camera/' + camera.camId + '">Access USGS HIVIS data</a><video id="nimsCam' + key + '" width="500" height="375" src="" controls></video>');

var nimsCamUrl = camera.tlDir + camera.camId + '_720.mp4'
$("#nimsCam"+key).attr('src', nimsCamUrl);
$(".ft-webcam-tab").show();
} else if (camera.TL_enabled == true && camera.locus == "umid"){
$("#ftWebcam").append('<h3>' + camera.camDesc + '</h3><a target="_blank" href="https://apps.usgs.gov/hivis/camera/' + camera.camId + '">Access USGS HIVIS data</a><video id="nimsCam' + key + '" width="500" height="375" src="" controls></video>');

var nimsCamUrl = camera.tlDir + camera.camId + '_720.mp4'
$("#nimsCam"+key).attr('src', nimsCamUrl);
$(".ft-webcam-tab").show();
}
});

if (data.length == 0) {
$(".ft-webcam-tab").hide();
}

},
error: function (error) {
console.log("Error processing the JSON. The error is:" + error);
}
});


} else if(feature.attributes.HAS_WEBCAM == "1"){ //Embed
$(".ft-webcam-tab").hide();
$(".ft-webcam-link-tab").show();
$(".ft-webcam-link-tab").attr("href", "https://services.wim.usgs.gov/webCam/webCamNew/Default.aspx?webCamInfo=" + feature.attributes.WEBCAM_INFO)
console.log("Open Webcam in new tab")
}else if(feature.attributes.HAS_WEBCAM == "2"){ //Image
} else if(feature.attributes.HAS_WEBCAM == "2"){ //Image
$(".ft-webcam-tab").show();
$(".ft-webcam-link-tab").hide();
$("#webcamImage").show();
$("#webcamImage").attr('src', feature.attributes.WEBCAM_INFO.replace('http:', 'https:'));
console.log("Webcam image embedded.")
}else{
} else{
$(".ft-webcam-tab").hide();
$(".ft-webcam-link-tab").hide();
console.log("No webcam")
Expand Down
2 changes: 1 addition & 1 deletion build/styles/main.css

Large diffs are not rendered by default.

Loading
Loading