Skip to content

Commit

Permalink
now adding hurr layers with real year, storm number avd advisory params
Browse files Browse the repository at this point in the history
  • Loading branch information
lstillwe committed Jul 18, 2023
1 parent 3b31ae5 commit e6b832a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/custom-ui/components/drawer/layers-list/layers-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ export const LayersList = ({ viewState, terria }) => {
// look for storm layers
// right now base identification on length of Advisory
// length should be 3 or less if it is a storm layer
if (item.infoAsObject.Advisory) {
//&& (item.infoAsObject.Advisory.length < 4)) {
// now retrieve storm layers associated with this storm, date and advisory
if (item.infoAsObject.Advisory && item.infoAsObject.Advisory.length < 4) {
// now add storm layers associated with this storm, date and advisory
addStormLayers(viewState, item);
}
});
Expand Down
8 changes: 7 additions & 1 deletion lib/custom-ui/components/utils/storm-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import GeoJsonCatalogItem from "terriajs/lib/Models/Catalog/CatalogItems/GeoJson
import CommonStrata from "terriajs/lib/Models/Definition/CommonStrata";

export function addStormLayers(viewState, item) {
//console.log(item)
const LAYER_TYPES = ["cone", "track", "points", "labels"];

// first see if hurricane layers have already been added for this model run
Expand All @@ -21,9 +22,14 @@ export function addStormLayers(viewState, item) {
);

if (!layer) {
getTrackData("2023", "3", "20").then((track) => {
// get year, storm number, and advisory for this storm
const year = "20" + item.infoAsObject["EventDate"].slice(0, 2);
const stormnumber = item.infoAsObject["StormNumber"];
const advisory = item.infoAsObject["Advisory"];
getTrackData(year, stormnumber, advisory).then((track) => {
const info_trait = item.info;
const track_geojson = getTrackGeojson(track, "utc");
//console.log(track_geojson)
// now add points, track, cone, and label
// geojson catalog items to the workbench
LAYER_TYPES.forEach((layer_type) => {
Expand Down

0 comments on commit e6b832a

Please sign in to comment.