Skip to content

Commit

Permalink
disable chartbundle layers; add special use airspace layer
Browse files Browse the repository at this point in the history
  • Loading branch information
dziban303 authored and wiedehopf committed Mar 3, 2024
1 parent 6624e19 commit fd5665c
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions html/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function createBaseLayers() {
}));
}

if (ChartBundleLayers) {
/* if (ChartBundleLayers) {
let chartbundleTypesDirect = {
sec: "Sectional Charts",
Expand Down Expand Up @@ -395,7 +395,7 @@ function createBaseLayers() {
type: 'base',
group: 'chartbundle'}));
}
}
} */

world.push(new ol.layer.Tile({
source: new ol.source.XYZ({
Expand Down Expand Up @@ -439,6 +439,46 @@ function createBaseLayers() {
}));
}

us.push(new ol.layer.Vector({
type: 'overlay',
title: 'Special Use Airspace',
name: 'sua',
zIndex: 99,
visible: false,
source: new ol.source.Vector({
url: 'https://opendata.arcgis.com/datasets/dd0d1b726e504137ab3c41b21835d05b_0.geojson',
transition: tileTransition,
format: new ol.format.GeoJSON({
defaultDataProjection: 'EPSG:4326',
projection: 'EPSG:3857'
})
}),
style: function style(feature) {
let type = feature.getProperties().TYPE_CODE;
if (type == "P" || type == "R" || type == "W") {
return new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'rgba(72, 149, 239, 1)',
width: 2
}),
fill: new ol.style.Fill({
color: 'rgba(72, 149, 239, 0.3)',
})
})
} else if (type == "A" || type == "MOA") {
return new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'rgba(133, 45, 69, 1)',
width: 2
}),
fill: new ol.style.Fill({
color : 'rgba(133, 45, 69, 0.3)'
})
});
}
}
}));

// nexrad and noaa stuff
const bottomLeft = ol.proj.fromLonLat([-171.0,9.0]);
const topRight = ol.proj.fromLonLat([-51.0,69.0]);
Expand Down

0 comments on commit fd5665c

Please sign in to comment.