Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UK Airpace layers #13

Closed
wants to merge 1 commit into from
Closed
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
35 changes: 35 additions & 0 deletions html/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function createBaseLayers() {

var world = new ol.Collection();
var us = new ol.Collection();
var uk = new ol.Collection();
var custom = new ol.Collection();

if (localStorage['customTiles'] != undefined) {
Expand Down Expand Up @@ -219,7 +220,33 @@ function createBaseLayers() {
window.setInterval(refreshDwd, 4 * 60000);
}

var createGeoJsonLayer = function (title, name, url, fill, stroke) {
return new ol.layer.Vector({
type: 'overlay',
title: title,
name: name,
source: new ol.source.Vector({
url: url,
format: new ol.format.GeoJSON({
defaultDataProjection :'EPSG:4326',
projection: 'EPSG:3857'
})
}),
style: new ol.style.Style({
fill: new ol.style.Fill({
color : fill
}),
stroke: new ol.style.Stroke({
color: stroke,
width: 1
}),
})
});
}

// Taken from https://github.com/alkissack/Dump1090-OpenLayers3-html
uk.push(createGeoJsonLayer('Radar Corridors', 'ukradarcorridors', 'layers/UK_Mil_RC.geojson', 'rgba(22, 171, 22, 0.3)', 'rgba(22, 171, 22, 1)'));
uk.push(createGeoJsonLayer('A2A Refuleing', 'uka2arefueling', 'layers/UK_Mil_AAR_Zones.geojson', 'rgba(52, 50, 168, 0.3)', 'rgba(52, 50, 168, 1)'));

if (custom.getLength() > 0) {
layers.push(new ol.layer.Group({
Expand All @@ -245,6 +272,14 @@ function createBaseLayers() {
}));
}

if (uk.getLength() > 0) {
layers.push(new ol.layer.Group({
name: 'uk',
title: 'UK',
layers: new ol.Collection(uk.getArray())
}));
}

layers.push(new ol.layer.Tile({
source: new ol.source.XYZ({
"url" : "https://map.adsbexchange.com/mapproxy/tiles/1.0.0/openaip/ul_grid/{z}/{x}/{y}.png",
Expand Down
21 changes: 21 additions & 0 deletions html/layers/UK_Mil_AAR_Zones.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "id": 1 }, "geometry": { "type": "Polygon", "coordinates": [ ] } },
{ "type": "Feature", "properties": { "id": 7 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 1.272194965444774, 55.432271193080879 ], [ 2.981004479153495, 55.002651035410231 ], [ 2.747163949550223, 54.706050815046268 ], [ 1.026489842043924, 55.137705793609207 ], [ 1.272194965444774, 55.432271193080879 ] ] ] } },
{ "type": "Feature", "properties": { "id": 6 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.888979216020673, 54.685946295198093 ], [ 0.182428715729185, 55.273420859516349 ], [ 0.615963571344907, 55.000071180741919 ], [ -0.42298296504882, 54.399497542849417 ], [ -0.888979216020673, 54.685946295198093 ] ] ] } },
{ "type": "Feature", "properties": { "id": 5 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 1.648983233398319, 55.700676076537725 ], [ -0.266887922167109, 55.716078010470717 ], [ -0.249117785975959, 56.05038664738899 ], [ 1.662807756310284, 56.034020637899118 ], [ 1.648983233398319, 55.700676076537725 ] ] ] } },
{ "type": "Feature", "properties": { "id": 3 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 2.763000169003503, 56.410619614838616 ], [ 2.209197365754767, 56.279540764525699 ], [ 0.833059793352215, 57.887285079580522 ], [ 1.399380500103327, 58.016976192554168 ], [ 2.763000169003503, 56.410619614838616 ] ] ] } },
{ "type": "Feature", "properties": { "id": 2 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 0.076165363129638, 59.471475898875568 ], [ 1.249977565369342, 58.216920064522611 ], [ 0.683275823963647, 58.065557613164508 ], [ -0.510337170153988, 59.318757432483984 ], [ 0.076165363129638, 59.471475898875568 ] ] ] } },
{ "type": "Feature", "properties": { "id": 4 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 0.009888430453203, 58.265001156921009 ], [ 0.245796401944195, 57.962325382630432 ], [ -1.48364629778834, 57.586930017142379 ], [ -1.713880123074511, 57.885253852909756 ], [ 0.009888430453203, 58.265001156921009 ] ] ] } },
{ "type": "Feature", "properties": { "id": 8 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 0.646941706944172, 53.267412628917178 ], [ 0.712941143792015, 53.601038264679062 ], [ 2.49380611035347, 53.451909143285022 ], [ 2.43027881134743, 53.115238166804289 ], [ 0.646941706944172, 53.267412628917178 ] ] ] } },
{ "type": "Feature", "properties": { "id": 9 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 1.829801445849836, 52.351593506021096 ], [ 1.832409169093755, 52.668276984034001 ], [ 2.930839086765627, 52.668728995449065 ], [ 2.662423325481778, 52.346988817527794 ], [ 1.829801445849836, 52.351593506021096 ] ] ] } },
{ "type": "Feature", "properties": { "id": 12 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -7.923778253456494, 50.47642087194707 ], [ -6.494485147102645, 50.79708351437867 ], [ -4.920935599925038, 51.113438376857083 ], [ -4.767679676475997, 50.796877478848963 ], [ -6.194606322717566, 50.508514434236638 ], [ -7.747809022378675, 50.164036885157806 ], [ -7.923778253456494, 50.47642087194707 ] ] ] } },
{ "type": "Feature", "properties": { "id": 11 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -7.880583842363537, 50.022940834503068 ], [ -5.679004826372461, 50.38118279720608 ], [ -5.554682505855889, 50.051300064529627 ], [ -7.750727229788486, 49.698193576565941 ], [ -7.880583842363537, 50.022940834503068 ] ] ] } },
{ "type": "Feature", "properties": { "id": 10 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -6.970582353354921, 49.930187391178599 ], [ -5.103551287431372, 50.50873700417862 ], [ -3.874332370448257, 50.866775646014553 ], [ -2.37767324305086, 51.281683706901582 ], [ -2.085079378774364, 50.997600428328148 ], [ -3.970074063135879, 50.462998998344311 ], [ -5.028174846663031, 50.156055342535147 ], [ -6.737269651042581, 49.619307493381363 ], [ -6.970582353354921, 49.930187391178599 ] ] ] } },
{ "type": "Feature", "properties": { "id": 13 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -4.401595340401299, 54.633188384147367 ], [ -4.112366634756508, 54.703326969135802 ], [ -3.721158207149685, 53.986234093288466 ], [ -3.988165775285808, 53.93397357863104 ], [ -4.401595340401299, 54.633188384147367 ] ] ] } },
{ "type": "Feature", "properties": { "id": 14 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -7.079642619439505, 57.419213963635116 ], [ -6.485810132507429, 57.314292297450301 ], [ -7.289368481965108, 55.775330773683073 ], [ -7.884826433877417, 55.874332245930304 ], [ -7.079642619439505, 57.419213963635116 ] ] ] } },
{ "type": "Feature", "properties": { "id": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -5.088365074181951, 56.352238138492652 ], [ -5.083764117213293, 58.198396030948764 ], [ -4.498163476713844, 58.199659308641031 ], [ -4.501404626758562, 56.353744806541627 ], [ -5.088365074181951, 56.352238138492652 ] ] ] } }
]
}
15 changes: 15 additions & 0 deletions html/layers/UK_Mil_RC.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "FeatureCollection",
"name": "UK_Mil_RC",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "id": null }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -1.943391510334662, 52.016174839296383 ], [ -0.374845191409936, 52.440469296598714 ], [ -0.019169710413417, 52.437057585775513 ], [ -0.293085904525605, 52.323910056107621 ], [ -1.832512477436734, 51.914044218660408 ], [ -1.943391510334662, 52.016174839296383 ] ] ] } },
{ "type": "Feature", "properties": { "id": null }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.019248292974662, 52.437055515890599 ], [ 0.319688750770139, 52.435007120509624 ], [ -0.487824205991536, 52.088147217081534 ], [ -1.630634238246315, 51.727124890944125 ], [ -1.83258247682619, 51.914068246326664 ], [ -1.576314712028643, 51.897115005078568 ], [ -0.29350590086234, 52.323738922164729 ], [ -0.019248292974662, 52.437055515890599 ] ] ] } },
{ "type": "Feature", "properties": { "id": null }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -2.577725977582781, 52.614221592040991 ], [ -1.140218515719243, 52.963714669626533 ], [ -0.96550003963766, 52.784238935622412 ], [ -2.409727442888951, 52.441152021001905 ], [ -2.577725977582781, 52.614221592040991 ] ] ] } },
{ "type": "Feature", "properties": { "id": null }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -2.005970964508113, 51.7600650700236 ], [ -1.836292444467345, 51.714289058961008 ], [ -1.698533646018404, 51.697978828736055 ], [ -2.160949612763172, 51.359174988220531 ], [ -2.387747634599842, 51.378053885193026 ], [ -2.001771001140768, 51.66290928696359 ], [ -2.005970964508113, 51.7600650700236 ] ] ] } },
{ "type": "Feature", "properties": { "id": null }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.758231847459147, 53.60897618156821 ], [ -0.509034020996632, 53.537317520402759 ], [ -0.741291995210852, 53.22432996065735 ], [ -1.03024947488424, 53.274924280991513 ], [ -0.758231847459147, 53.60897618156821 ] ] ] } },
{ "type": "Feature", "properties": { "id": null }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -1.983781158050637, 54.729411355682728 ], [ -1.984411152555738, 54.741899322791149 ], [ -1.608584430567749, 54.693623558325278 ], [ -1.608584430567749, 54.693623558325278 ], [ -1.608584430567749, 54.693623558325278 ], [ -1.608584430567749, 54.693623558325278 ], [ -1.608584430567749, 54.695241767599114 ], [ -1.648344083778623, 54.539761646483321 ], [ -2.035580706247901, 54.576131355763955 ], [ -1.983781158050637, 54.729411355682728 ] ] ] } },
{ "type": "Feature", "properties": { "id": null }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -3.882777094748654, 54.838520346884088 ], [ -2.361930232394216, 54.808589858263105 ], [ -2.302256867523139, 54.638343625178528 ], [ -3.658779048490214, 54.667237646943114 ], [ -3.882777094748654, 54.838520346884088 ] ] ] } },
{ "type": "Feature", "properties": { "id": null }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -4.76196942631303, 53.372425615906685 ], [ -4.103415170313216, 53.900997135452783 ], [ -3.832377534340504, 53.797929234429795 ], [ -4.385652708598851, 53.361733095147272 ], [ -4.76196942631303, 53.372425615906685 ] ] ] } }
]
}