2020-01-03 21:16:40 +01:00
// -*- mode: javascript; indent-tabs-mode: nil; c-basic-offset: 8 -*-
"use strict" ;
// Base layers configuration
// "url" : "https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png"
// "url" : "http://{a-c}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"
// "url" : "http://{a-c}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png"
// "url" : "https://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}"
// "url" : "https://korona.geog.uni-heidelberg.de/tiles/asterh/x={x}&y={y}&z={z}"
// "url" : "https://{a-c}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png"
// "url" : "http://{a-c}.tilessputnik.ru/tiles/kmt2/{z}/{x}/{y}.png"
// "url" : "https://{a-c}.tile.openstreetmap.se/hydda/full/{z}/{x}/{y}.png"
// "url" : "https://{a-c}.tile.openstreetmap.se/osm/{z}/{x}/{y}.png"
function createBaseLayers ( ) {
2020-03-27 08:45:56 +01:00
let layers = new ol . Collection ( ) ;
let layers _group = new ol . layer . Group ( {
2020-01-03 21:16:40 +01:00
layers : layers ,
} ) ;
2020-03-27 08:45:56 +01:00
let world = new ol . Collection ( ) ;
let us = new ol . Collection ( ) ;
let europe = new ol . Collection ( ) ;
2020-01-03 21:16:40 +01:00
2024-05-21 18:57:48 +02:00
const tileTransition = onMobile ? 0 : 0 ;
2022-07-31 16:16:24 +02:00
2021-09-05 20:50:34 +02:00
if ( loStore [ 'customTiles' ] != undefined ) {
2022-05-28 19:35:27 +02:00
custom _layers . push ( new ol . layer . Tile ( {
2020-02-08 20:32:04 +01:00
source : new ol . source . OSM ( {
2021-09-05 20:50:34 +02:00
"url" : loStore [ 'customTiles' ] ,
2025-03-28 12:24:54 -04:00
maxZoom : 20 ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2020-02-08 20:32:04 +01:00
} ) ,
name : 'custom_tiles' ,
title : 'Custom tiles' ,
type : 'base' ,
} ) ) ;
}
2020-02-08 19:38:42 +01:00
/ *
2020-01-03 21:16:40 +01:00
world . push ( new ol . layer . Tile ( {
source : new ol . source . OSM ( {
"url" : "https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png"
} ) ,
name : 'wikimedia' ,
title : 'OpenStreetMap Wikimedia' ,
type : 'base' ,
} ) ) ;
2020-02-08 19:38:42 +01:00
* /
2020-01-03 21:16:40 +01:00
2022-04-16 06:39:18 +02:00
if ( offlineMapDetail > 0 ) {
world . push ( new ol . layer . Tile ( {
source : new ol . source . OSM ( {
"url" : "osm_tiles_offline/{z}/{x}/{y}.png" ,
attributionsCollapsible : false ,
maxZoom : offlineMapDetail ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2022-04-16 06:39:18 +02:00
} ) ,
name : 'osm_tiles_offline' ,
title : 'OpenStreetMap offline' ,
type : 'base' ,
} ) ) ;
}
2020-01-03 21:16:40 +01:00
2024-08-20 22:07:27 +02:00
world . push ( new ol . layer . Tile ( {
source : new ol . source . OSM ( {
maxZoom : 17 ,
attributionsCollapsible : false ,
transition : tileTransition ,
} ) ,
name : 'osm' ,
title : 'OpenStreetMap' ,
type : 'base' ,
} ) ) ;
2020-01-03 21:16:40 +01:00
2022-04-29 02:23:50 +02:00
let basemap _id = "rastertiles/voyager" ;
world . push ( new ol . layer . Tile ( {
source : new ol . source . OSM ( {
"url" : "https://{a-d}.basemaps.cartocdn.com/" + basemap _id + "/{z}/{x}/{y}.png" ,
"attributions" : 'Powered by <a href="https://carto.com">CARTO.com</a>'
+ ' using data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.' ,
attributionsCollapsible : false ,
maxZoom : 15 ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2022-04-29 02:23:50 +02:00
} ) ,
name : "carto_" + basemap _id ,
title : 'CARTO.com English' ,
type : 'base' ,
} ) ) ;
2024-08-20 22:07:27 +02:00
world . push ( new ol . layer . Tile ( {
source : new ol . source . OSM ( {
"url" : "https://{a-d}.tile.openstreetmap.de/{z}/{x}/{y}.png" ,
attributionsCollapsible : false ,
maxZoom : 17 ,
transition : tileTransition ,
} ) ,
name : 'osm_de' ,
title : 'OpenStreetMap DE' ,
type : 'base' ,
} ) ) ;
2022-04-27 19:52:04 +02:00
2025-10-06 14:15:30 +00:00
if ( offlineMapDetailOFM > 0 ) {
world . push ( new ol . layer . VectorTile ( {
type : 'base' ,
2025-10-07 11:17:39 +00:00
name : 'OpenFreeMapOfflineBright' ,
title : 'OpenFreeMap Offl. Bright' ,
onVisible : ( layer ) => {
if ( ! layer . get ( 'styleApplied' ) ) {
ol . mapboxStyle . applyStyle ( layer , "./openfreemap_offline/bright" ) ;
ol . mapboxStyle . applyBackground ( layer , "./openfreemap_offline/bright" ) ;
layer . set ( 'styleApplied' , true ) ;
}
} ,
} ) ) ;
world . push ( new ol . layer . VectorTile ( {
type : 'base' ,
name : 'OpenFreeMapOfflineLiberty' ,
title : 'OpenFreeMap Offl. Lib.' ,
2025-10-06 14:15:30 +00:00
onVisible : ( layer ) => {
if ( ! layer . get ( 'styleApplied' ) ) {
2025-10-06 19:34:22 +00:00
ol . mapboxStyle . applyStyle ( layer , "./openfreemap_offline/liberty" ) ;
ol . mapboxStyle . applyBackground ( layer , "./openfreemap_offline/liberty" ) ;
2025-10-06 14:15:30 +00:00
layer . set ( 'styleApplied' , true ) ;
}
} ,
} ) ) ;
2025-10-07 11:17:39 +00:00
world . push ( new ol . layer . VectorTile ( {
type : 'base' ,
name : 'OpenFreeMapOfflinePositron' ,
title : 'OpenFreeMap Offl. Pos.' ,
onVisible : ( layer ) => {
if ( ! layer . get ( 'styleApplied' ) ) {
ol . mapboxStyle . applyStyle ( layer , "./openfreemap_offline/positron" ) ;
ol . mapboxStyle . applyBackground ( layer , "./openfreemap_offline/positron" ) ;
layer . set ( 'styleApplied' , true ) ;
}
} ,
} ) ) ;
2025-10-07 17:19:27 +00:00
world . push ( new ol . layer . VectorTile ( {
type : 'base' ,
name : 'OpenFreeMapOfflineDark' ,
title : 'OpenFreeMap Offl. Dark' ,
onVisible : ( layer ) => {
if ( ! layer . get ( 'styleApplied' ) ) {
ol . mapboxStyle . applyStyle ( layer , "./openfreemap_offline/dark" ) ;
ol . mapboxStyle . applyBackground ( layer , "./openfreemap_offline/dark" ) ;
layer . set ( 'styleApplied' , true ) ;
}
} ,
} ) ) ;
world . push ( new ol . layer . VectorTile ( {
type : 'base' ,
name : 'OpenFreeMapOfflineFiord' ,
title : 'OpenFreeMap Offl. Fiord' ,
onVisible : ( layer ) => {
if ( ! layer . get ( 'styleApplied' ) ) {
ol . mapboxStyle . applyStyle ( layer , "./openfreemap_offline/fiord" ) ;
ol . mapboxStyle . applyBackground ( layer , "./openfreemap_offline/fiord" ) ;
layer . set ( 'styleApplied' , true ) ;
}
} ,
} ) ) ;
2025-10-07 11:17:39 +00:00
}
if ( 1 ) {
world . push ( new ol . layer . VectorTile ( {
type : 'base' ,
name : 'OpenFreeMapBright' ,
title : 'OpenFreeMap Bright' ,
onVisible : ( layer ) => {
if ( ! layer . get ( 'styleApplied' ) ) {
ol . mapboxStyle . applyStyle ( layer , "https://tiles.openfreemap.org/styles/bright" ) ;
ol . mapboxStyle . applyBackground ( layer , "https://tiles.openfreemap.org/styles/bright" ) ;
layer . set ( 'styleApplied' , true ) ;
}
} ,
} ) ) ;
2025-10-06 14:15:30 +00:00
}
2025-02-27 11:56:30 +00:00
if ( 1 ) {
2025-02-27 12:23:48 +00:00
world . push ( new ol . layer . VectorTile ( {
2025-02-27 11:56:30 +00:00
type : 'base' ,
name : 'OpenFreeMapLiberty' ,
title : 'OpenFreeMap Liberty' ,
2025-02-27 12:23:48 +00:00
onVisible : ( layer ) => {
if ( ! layer . get ( 'styleApplied' ) ) {
ol . mapboxStyle . applyStyle ( layer , "https://tiles.openfreemap.org/styles/liberty" ) ;
ol . mapboxStyle . applyBackground ( layer , "https://tiles.openfreemap.org/styles/liberty" ) ;
layer . set ( 'styleApplied' , true ) ;
}
} ,
} ) ) ;
2025-02-27 11:56:30 +00:00
}
if ( 1 ) {
2025-02-27 12:23:48 +00:00
world . push ( new ol . layer . VectorTile ( {
2025-02-27 11:56:30 +00:00
type : 'base' ,
name : 'OpenFreeMapPositron' ,
title : 'OpenFreeMap Positron' ,
2025-02-27 12:23:48 +00:00
onVisible : ( layer ) => {
if ( ! layer . get ( 'styleApplied' ) ) {
ol . mapboxStyle . applyStyle ( layer , "https://tiles.openfreemap.org/styles/positron" ) ;
ol . mapboxStyle . applyBackground ( layer , "https://tiles.openfreemap.org/styles/positron" ) ;
layer . set ( 'styleApplied' , true ) ;
}
} ,
} ) ) ;
2025-02-27 11:56:30 +00:00
}
2025-10-07 17:19:27 +00:00
if ( 1 ) {
world . push ( new ol . layer . VectorTile ( {
type : 'base' ,
name : 'OpenFreeMapDark' ,
title : 'OpenFreeMap Dark' ,
onVisible : ( layer ) => {
if ( ! layer . get ( 'styleApplied' ) ) {
ol . mapboxStyle . applyStyle ( layer , "https://tiles.openfreemap.org/styles/dark" ) ;
ol . mapboxStyle . applyBackground ( layer , "https://tiles.openfreemap.org/styles/dark" ) ;
layer . set ( 'styleApplied' , true ) ;
}
} ,
} ) ) ;
}
if ( 1 ) {
world . push ( new ol . layer . VectorTile ( {
type : 'base' ,
name : 'OpenFreeMapFiord' ,
title : 'OpenFreeMap Fiord' ,
onVisible : ( layer ) => {
if ( ! layer . get ( 'styleApplied' ) ) {
ol . mapboxStyle . applyStyle ( layer , "https://tiles.openfreemap.org/styles/fiord" ) ;
ol . mapboxStyle . applyBackground ( layer , "https://tiles.openfreemap.org/styles/fiord" ) ;
layer . set ( 'styleApplied' , true ) ;
}
} ,
} ) ) ;
}
2025-02-27 11:56:30 +00:00
2024-08-20 22:07:27 +02:00
if ( 1 ) {
2022-04-21 20:48:08 +02:00
world . push ( new ol . layer . Tile ( {
source : new ol . source . XYZ ( {
url : "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}" ,
attributions : 'Powered by <a href="https://www.esri.com">Esri.com</a>' +
'— Sources: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' ,
attributionsCollapsible : false ,
maxZoom : 17 ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2022-04-21 20:48:08 +02:00
} ) ,
name : 'esri' ,
title : 'ESRI.com Sat.' ,
type : 'base' ,
} ) ) ;
world . push ( new ol . layer . Tile ( {
source : new ol . source . XYZ ( {
url : "https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}" ,
attributions : 'Powered by <a href="https://www.esri.com">Esri.com</a>' +
'— Sources: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' ,
attributionsCollapsible : false ,
maxZoom : 16 ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2022-04-21 20:48:08 +02:00
} ) ,
name : 'esri_gray' ,
title : 'ESRI.com Gray' ,
type : 'base' ,
} ) ) ;
world . push ( new ol . layer . Tile ( {
source : new ol . source . XYZ ( {
url : "https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}" ,
attributions : 'Powered by <a href="https://www.esri.com">Esri.com</a>' +
'— Sources: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' ,
attributionsCollapsible : false ,
maxZoom : 17 ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2022-04-21 20:48:08 +02:00
} ) ,
name : 'esri_streets' ,
title : 'ESRI.com Streets' ,
type : 'base' ,
} ) ) ;
}
2021-04-27 20:49:50 +02:00
2022-06-12 07:20:33 +02:00
// testing ...
if ( 0 ) {
let english _map = new ol . layer . VectorTile ( {
declutter : true ,
type : 'base' ,
name : 'english_map' ,
title : 'English Map' ,
} ) ;
// ol-mapbox-style plugin packed in with ol ... (kinda ugly)
//ol.applyStyle(english_map, "https://tiles.adsb.co/api/maps/basic/style.json");
world . push ( english _map ) ;
}
2021-04-27 20:49:50 +02:00
if ( 0 ) {
let vtlayer = new ol . layer . VectorTile ( {
source : new ol . source . VectorTile ( {
2024-08-20 22:07:27 +02:00
url : "http://test02.dev.adsf.com/tiles/{z}/{x}/{y}.pbf" ,
2021-04-27 20:49:50 +02:00
format : new ol . format . MVT ( ) ,
2021-05-02 17:17:10 +02:00
maxZoom : 9 ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2021-04-27 20:49:50 +02:00
} ) ,
name : 'vtlayer' ,
2021-05-02 17:17:10 +02:00
title : 'TEST VECTOR' ,
2021-04-27 20:49:50 +02:00
type : 'base' ,
renderMode : 'image' ,
} ) ;
2021-05-28 07:32:37 +02:00
jQuery . ajax ( {
2021-05-02 17:17:10 +02:00
url : 'osm-liberty/style.json' ,
dataType : 'json' ,
layer : vtlayer ,
cache : false ,
} ) . done ( function ( glStyle ) {
ol . mbApplyStyle ( this . layer , glStyle , 'openmaptiles' ) ;
2021-04-27 20:49:50 +02:00
} ) ;
world . push ( vtlayer ) ;
}
2020-01-03 21:16:40 +01:00
2025-08-15 05:37:49 +00:00
/ * s e e m s d e f u n c t
2022-04-25 19:22:48 +02:00
world . push ( new ol . layer . Tile ( {
source : new ol . source . OSM ( {
url : 'https://gibs-{a-c}.earthdata.nasa.gov/wmts/epsg3857/best/BlueMarble_ShadedRelief_Bathymetry/default/EPSG3857_500m/{z}/{y}/{x}.jpeg' ,
attributions : '<a href="https://terra.nasa.gov/about/terra-instruments/modis">MODIS Terra</a> ' +
2023-03-21 16:10:55 +02:00
'Provided by NASA\'s Global Imagery Browse Services (GIBS), part of NASA\'s Earth Observing System Data and Information System (EOSDIS)' ,
2022-04-25 19:22:48 +02:00
maxZoom : 8 ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2022-04-25 19:22:48 +02:00
} ) ,
2025-08-15 05:37:49 +00:00
name : 'gibs_relief' ,
2022-04-25 19:22:48 +02:00
title : 'GIBS Relief' ,
type : 'base' ,
} ) ) ;
2025-08-15 05:37:49 +00:00
* /
2022-04-25 19:22:48 +02:00
2021-04-28 16:11:24 +02:00
const date = new Date ( Date . now ( ) - 86400 * 1000 ) ;
const yesterday = date . getUTCFullYear ( ) + '-' + ( date . getUTCMonth ( ) + 1 ) . toString ( ) . padStart ( 2 , '0' ) + '-' + date . getUTCDate ( ) . toString ( ) . padStart ( 2 , '0' ) ;
2020-01-03 21:16:40 +01:00
world . push ( new ol . layer . Tile ( {
source : new ol . source . OSM ( {
url : 'https://gibs-{a-c}.earthdata.nasa.gov/wmts/epsg3857/best/' +
2021-04-28 16:11:24 +02:00
'MODIS_Terra_CorrectedReflectance_TrueColor/default/' +
yesterday + '/' +
2020-01-03 21:16:40 +01:00
'GoogleMapsCompatible_Level9/{z}/{y}/{x}.jpg' ,
2021-04-28 16:11:24 +02:00
attributions : '<a href="https://terra.nasa.gov/about/terra-instruments/modis">MODIS Terra</a> ' +
yesterday + ' Provided by NASA\'s Global Imagery Browse Services (GIBS), part of NASA\'s Earth Observing System Data and Information System (EOSDIS)' ,
2021-04-27 20:49:50 +02:00
maxZoom : 9 ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2020-01-03 21:16:40 +01:00
} ) ,
2020-04-15 10:20:38 +02:00
name : 'gibs' ,
2022-04-25 19:22:48 +02:00
title : 'GIBS Clouds ' + yesterday ,
2020-01-03 21:16:40 +01:00
type : 'base' ,
} ) ) ;
// carto.com basemaps, see the following URLs for details on them:
// http://basemaps.cartocdn.com
// https://github.com/CartoDB/cartodb/wiki/BaseMaps-available
2022-04-29 02:23:50 +02:00
let basemaps = [ "dark_all" , "dark_nolabels" ,
2020-01-03 21:16:40 +01:00
"light_all" , "light_nolabels"
]
2021-04-28 16:11:24 +02:00
if ( 1 ) {
2021-04-24 18:13:33 +02:00
for ( let i in basemaps ) {
let basemap _id = basemaps [ i ] ;
2020-01-03 21:16:40 +01:00
2021-04-24 18:13:33 +02:00
world . push ( new ol . layer . Tile ( {
source : new ol . source . OSM ( {
"url" : "https://{a-d}.basemaps.cartocdn.com/" + basemap _id + "/{z}/{x}/{y}.png" ,
2021-04-28 16:11:24 +02:00
"attributions" : 'Powered by <a href="https://carto.com">CARTO.com</a>'
2021-04-24 18:13:33 +02:00
+ ' using data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.' ,
2021-04-28 16:11:24 +02:00
attributionsCollapsible : false ,
maxZoom : 15 ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2021-04-24 18:13:33 +02:00
} ) ,
name : "carto_" + basemap _id ,
2022-04-29 01:59:22 +02:00
title : 'CARTO.com ' + basemap _id ,
2021-04-24 18:13:33 +02:00
type : 'base' ,
} ) ) ;
}
2020-01-03 21:16:40 +01:00
}
2021-09-05 20:50:34 +02:00
if ( loStore [ 'bingKey' ] != undefined )
BingMapsAPIKey = loStore [ 'bingKey' ] ;
2020-05-07 21:48:32 +02:00
2020-01-03 21:16:40 +01:00
if ( BingMapsAPIKey ) {
world . push ( new ol . layer . Tile ( {
source : new ol . source . BingMaps ( {
key : BingMapsAPIKey ,
2022-07-31 16:16:24 +02:00
imagerySet : 'Aerial' ,
transition : tileTransition ,
2020-01-03 21:16:40 +01:00
} ) ,
name : 'bing_aerial' ,
title : 'Bing Aerial' ,
type : 'base' ,
} ) ) ;
world . push ( new ol . layer . Tile ( {
source : new ol . source . BingMaps ( {
key : BingMapsAPIKey ,
2022-07-31 16:16:24 +02:00
imagerySet : 'RoadOnDemand' ,
transition : tileTransition ,
2020-01-03 21:16:40 +01:00
} ) ,
name : 'bing_roads' ,
title : 'Bing Roads' ,
type : 'base' ,
} ) ) ;
}
2024-07-31 20:20:43 +02:00
if ( loStore [ 'mapboxKey' ] != undefined )
MapboxAPIKey = loStore [ 'mapboxKey' ] ;
if ( MapboxAPIKey ) {
2025-08-31 10:30:36 +02:00
world . push ( new ol . mapboxStyle . MapboxVectorLayer ( {
2024-07-31 20:20:43 +02:00
styleUrl : 'mapbox://styles/mapbox/streets-v10' ,
accessToken : MapboxAPIKey ,
properties : {
name : 'mapbox_streets' ,
title : 'Mapbox Streets' ,
type : 'base' ,
} ,
} ) ) ;
2025-08-31 10:30:36 +02:00
world . push ( new ol . mapboxStyle . MapboxVectorLayer ( {
2024-07-31 20:20:43 +02:00
styleUrl : 'mapbox://styles/mapbox/light-v11' ,
accessToken : MapboxAPIKey ,
properties : {
name : 'mapbox_light' ,
title : 'Mapbox Light' ,
type : 'base' ,
} ,
} ) ) ;
2025-08-31 10:30:36 +02:00
world . push ( new ol . mapboxStyle . MapboxVectorLayer ( {
2024-07-31 20:20:43 +02:00
styleUrl : 'mapbox://styles/mapbox/dark-v11' ,
accessToken : MapboxAPIKey ,
properties : {
name : 'mapbox_dark' ,
title : 'Mapbox Dark' ,
type : 'base' ,
} ,
} ) ) ;
2025-08-31 10:30:36 +02:00
world . push ( new ol . mapboxStyle . MapboxVectorLayer ( {
2024-07-31 20:20:43 +02:00
styleUrl : 'mapbox://styles/mapbox/outdoors-v10' ,
accessToken : MapboxAPIKey ,
properties : {
name : 'mapbox_outdoors' ,
title : 'Mapbox Outdoors' ,
type : 'base' ,
} ,
} ) ) ;
}
2024-05-05 14:53:09 +02:00
if ( 1 ) {
2024-05-04 15:07:14 +02:00
us . push ( new ol . layer . Tile ( {
source : new ol . source . XYZ ( {
url : "https://tiles.arcgis.com/tiles/ssFJjBXIUyZDrSYZ/arcgis/rest/services/VFR_Sectional/MapServer/tile/{z}/{y}/{x}" ,
2024-05-04 15:16:15 +02:00
attributions : 'Tiles courtesy of <a href="http://tiles.arcgis.com/">arcgis.com</a>' ,
attributionsCollapsible : false ,
minZoom : 8 ,
maxZoom : 12 ,
transition : tileTransition ,
2024-05-04 15:07:14 +02:00
} ) ,
name : 'VFR_Sectional' ,
title : 'VFR Sectional Chart' ,
type : 'base'
} ) ) ;
2024-04-26 04:10:34 -04:00
2024-05-04 15:07:14 +02:00
us . push ( new ol . layer . Tile ( {
source : new ol . source . XYZ ( {
url : "https://tiles.arcgis.com/tiles/ssFJjBXIUyZDrSYZ/arcgis/rest/services/VFR_Terminal/MapServer/tile/{z}/{y}/{x}" ,
2024-05-04 15:16:15 +02:00
attributions : 'Tiles courtesy of <a href="http://tiles.arcgis.com/">arcgis.com</a>' ,
attributionsCollapsible : false ,
minZoom : 10 ,
maxZoom : 12 ,
transition : tileTransition ,
2024-05-04 15:07:14 +02:00
} ) ,
name : 'VFR_Terminal' ,
title : 'VFR Terminal Chart' ,
type : 'base'
} ) ) ;
2024-04-26 04:10:34 -04:00
2024-05-04 15:07:14 +02:00
us . push ( new ol . layer . Tile ( {
source : new ol . source . XYZ ( {
url : "https://tiles.arcgis.com/tiles/ssFJjBXIUyZDrSYZ/arcgis/rest/services/IFR_AreaLow/MapServer/tile/{z}/{y}/{x}" ,
2024-05-04 15:16:15 +02:00
attributions : 'Tiles courtesy of <a href="http://tiles.arcgis.com/">arcgis.com</a>' ,
attributionsCollapsible : false ,
minZoom : 8 ,
maxZoom : 11 ,
transition : tileTransition ,
2024-05-04 15:07:14 +02:00
} ) ,
name : 'IFR_AreaLow' ,
2024-09-12 14:52:12 -05:00
title : 'IFR Enroute Chart Low' ,
2024-05-04 15:07:14 +02:00
type : 'base'
} ) ) ;
2024-04-26 04:10:34 -04:00
2024-05-04 15:07:14 +02:00
us . push ( new ol . layer . Tile ( {
source : new ol . source . XYZ ( {
url : "https://tiles.arcgis.com/tiles/ssFJjBXIUyZDrSYZ/arcgis/rest/services/IFR_High/MapServer/tile/{z}/{y}/{x}" ,
2024-05-04 15:16:15 +02:00
attributions : 'Tiles courtesy of <a href="http://tiles.arcgis.com/">arcgis.com</a>' ,
attributionsCollapsible : false ,
minZoom : 7 ,
maxZoom : 11 ,
transition : tileTransition ,
2024-05-04 15:07:14 +02:00
} ) ,
name : 'IFR_High' ,
2024-09-12 14:52:12 -05:00
title : 'IFR Enroute Chart High' ,
2024-05-04 15:07:14 +02:00
type : 'base'
} ) ) ;
2024-04-26 04:10:34 -04:00
}
2024-02-24 18:07:47 -06:00
/ * i f ( C h a r t B u n d l e L a y e r s ) {
2020-01-03 21:16:40 +01:00
2023-05-02 10:48:05 +02:00
let chartbundleTypesDirect = {
2020-01-03 21:16:40 +01:00
sec : "Sectional Charts" ,
2022-04-01 17:45:24 +02:00
enrh : "IFR Enroute High Charts" ,
tac : "Terminal Area Charts" ,
hel : "Helicopter Charts" ,
enrl : "IFR Enroute Low Charts" ,
enra : "IFR Area Charts" ,
2023-05-02 10:48:05 +02:00
secgrids : "Sect. w/ SAR grid" ,
} ;
2020-01-03 21:16:40 +01:00
2023-05-02 10:48:05 +02:00
for ( let type in chartbundleTypesDirect ) {
2020-01-03 21:16:40 +01:00
us . push ( new ol . layer . Tile ( {
source : new ol . source . TileWMS ( {
2020-03-31 00:03:53 +02:00
url : 'https://wms.chartbundle.com/wms' ,
2020-01-03 21:16:40 +01:00
params : { LAYERS : type } ,
projection : 'EPSG:3857' ,
2021-04-27 20:49:50 +02:00
attributions : 'Tiles courtesy of <a href="http://www.chartbundle.com/">ChartBundle</a>' ,
2021-04-28 16:11:24 +02:00
attributionsCollapsible : false ,
2021-04-27 20:49:50 +02:00
maxZoom : 12 , // doesn't work for WMS
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2020-01-03 21:16:40 +01:00
} ) ,
name : 'chartbundle_' + type ,
2023-05-02 10:48:05 +02:00
title : chartbundleTypesDirect [ type ] ,
2020-01-03 21:16:40 +01:00
type : 'base' ,
group : 'chartbundle' } ) ) ;
}
2024-02-24 18:07:47 -06:00
} * /
2020-01-03 21:16:40 +01:00
2020-03-02 13:20:12 +01:00
world . 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" ,
"attributions" : "openAIP.net" ,
2021-04-28 16:11:24 +02:00
attributionsCollapsible : false ,
2021-05-19 18:21:07 +02:00
maxZoom : 12 ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2020-03-02 13:20:12 +01:00
} ) ,
name : 'openaip' ,
title : 'openAIP TMS' ,
type : 'overlay' ,
2024-03-28 13:39:46 +01:00
opacity : openAIPOpacity ,
2020-03-02 13:20:12 +01:00
visible : false ,
zIndex : 99 ,
2021-05-19 18:21:07 +02:00
maxZoom : 13 ,
2020-03-02 13:20:12 +01:00
} ) ) ;
2023-10-14 09:11:05 +02:00
if ( true ) {
2025-05-05 16:20:38 +00:00
let tfrLayer = new ol . layer . Vector ( {
2025-05-05 16:08:57 +00:00
style : {
'stroke-width' : 2 ,
'stroke-color' : 'red' ,
'fill-color' : [ 255 , 0 , 0 , 0.08 ] ,
'text-value' : [
'concat' ,
[ 'get' , 'NOTAM_KEY' ] ,
'\n' ,
[ 'get' , 'LEGAL' ]
] ,
'text-font' : '14px sans-serif' ,
'text-stroke-width' : 2 ,
'text-stroke-color' : 'black'
} ,
2023-10-14 09:11:05 +02:00
name : 'tfrs' ,
2020-11-12 21:55:28 +01:00
title : 'TFRs' ,
type : 'overlay' ,
2024-03-28 13:39:46 +01:00
opacity : tfrOpacity ,
2023-10-14 09:11:05 +02:00
visible : false ,
2020-11-12 21:55:28 +01:00
zIndex : 99 ,
2025-05-05 16:20:38 +00:00
} ) ;
us . push ( tfrLayer ) ;
let refreshTFR = function ( ) {
let source = new ol . source . Vector ( {
url : 'https://raw.githubusercontent.com/wiedehopf/tar1090-aux/master/tfrs.geojson' ,
format : new ol . format . GeoJSON ( ) ,
attributions : 'TFRs via FAA hosted on github: <a href="https://github.com/wiedehopf/tar1090-aux" target="_blank">tar1090-aux</a>.'
} ) ;
tfrLayer . setSource ( source ) ;
} ;
refreshTFR ( ) ;
window . setInterval ( refreshTFR , 5 * 60 * 1000 ) ;
2020-11-12 21:55:28 +01:00
}
2020-11-12 20:09:36 +01:00
2024-02-24 18:07:47 -06:00
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)'
} )
} ) ;
}
}
} ) ) ;
2023-10-14 08:22:29 +02:00
// nexrad and noaa stuff
const bottomLeft = ol . proj . fromLonLat ( [ - 171.0 , 9.0 ] ) ;
const topRight = ol . proj . fromLonLat ( [ - 51.0 , 69.0 ] ) ;
const naExtent = [ bottomLeft [ 0 ] , bottomLeft [ 1 ] , topRight [ 0 ] , topRight [ 1 ] ] ;
2021-07-14 09:34:31 +02:00
if ( true ) {
let nexrad = new ol . layer . Tile ( {
name : 'nexrad' ,
title : 'NEXRAD' ,
type : 'overlay' ,
2024-03-28 13:39:46 +01:00
opacity : nexradOpacity ,
2021-07-14 09:34:31 +02:00
visible : false ,
zIndex : 99 ,
2024-08-03 22:11:50 +02:00
//extent: naExtent,
// this somehow seems to cause webgl errors.
// workaround by just not using this, it's not important
2021-07-14 09:34:31 +02:00
} ) ;
let refreshNexrad = function ( ) {
// re-build the source to force a refresh of the nexrad tiles
let now = new Date ( ) . getTime ( ) ;
2022-07-28 12:52:42 +02:00
let nexradSource = new ol . source . XYZ ( {
2021-07-14 09:34:31 +02:00
url : 'https://mesonet{1-3}.agron.iastate.edu/cache/tile.py/1.0.0/nexrad-n0q-900913/{z}/{x}/{y}.png?_=' + now ,
attributions : 'NEXRAD courtesy of <a href="https://mesonet.agron.iastate.edu/">IEM</a>' ,
attributionsCollapsible : false ,
maxZoom : 8 ,
2022-07-28 12:52:42 +02:00
} ) ;
nexrad . setSource ( nexradSource ) ;
2021-07-14 09:34:31 +02:00
} ;
refreshNexrad ( ) ;
window . setInterval ( refreshNexrad , 2 * 60 * 1000 ) ;
2020-01-03 21:16:40 +01:00
2023-10-14 08:22:29 +02:00
us . push ( nexrad ) ;
}
if ( true ) {
2023-08-26 14:12:38 -05:00
let noaaSatSource = new ol . source . ImageWMS ( {
2021-07-14 09:34:31 +02:00
attributions : [ 'NOAA' ] ,
2021-04-28 16:11:24 +02:00
attributionsCollapsible : false ,
2023-08-26 14:12:38 -05:00
url : 'https://nowcoast.noaa.gov/geoserver/satellite/wms' ,
params : { 'LAYERS' : 'global_longwave_imagery_mosaic' } ,
2021-07-14 09:34:31 +02:00
projection : 'EPSG:3857' ,
2022-07-28 12:52:42 +02:00
resolutions : [ 156543.03392804097 , 78271.51696402048 , 39135.75848201024 , 19567.87924100512 , 9783.93962050256 , 4891.96981025128 , 2445.98490512564 , 1222.99245256282 ] ,
ratio : 1 ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2021-07-14 09:34:31 +02:00
} ) ;
2023-10-14 08:22:29 +02:00
2023-08-26 14:12:38 -05:00
let noaaSat = new ol . layer . Image ( {
title : 'NOAA Infrared Sat' ,
name : 'noaa_sat' ,
2021-07-14 09:34:31 +02:00
zIndex : 99 ,
type : 'overlay' ,
visible : false ,
2023-08-26 14:12:38 -05:00
source : noaaSatSource ,
2024-03-28 13:39:46 +01:00
opacity : noaaInfraredOpacity ,
2023-10-14 08:22:29 +02:00
extent : naExtent ,
2021-07-14 09:34:31 +02:00
} ) ;
2023-10-14 08:22:29 +02:00
2023-08-26 14:33:53 -05:00
let refreshNoaaSat = function ( ) {
noaaSatSource . refresh ( ) ;
}
2023-10-14 08:22:29 +02:00
2023-08-26 14:33:53 -05:00
// Refresh sat layer every 15 minutes
refreshNoaaSat ( ) ;
window . setInterval ( refreshNoaaSat , 15 * 60 * 1000 ) ;
2021-07-14 09:34:31 +02:00
2023-08-26 14:12:38 -05:00
us . push ( noaaSat ) ;
2021-07-14 09:34:31 +02:00
}
2023-10-14 08:22:29 +02:00
if ( true ) {
let noaaRadarSource = new ol . source . ImageWMS ( {
attributions : [ 'NOAA' ] ,
attributionsCollapsible : false ,
url : 'https://nowcoast.noaa.gov/geoserver/weather_radar/wms' ,
params : { 'LAYERS' : 'base_reflectivity_mosaic' } ,
projection : 'EPSG:3857' ,
resolutions : [ 156543.03392804097 , 78271.51696402048 , 39135.75848201024 , 19567.87924100512 , 9783.93962050256 , 4891.96981025128 , 2445.98490512564 , 1222.99245256282 ] ,
ratio : 1 ,
transition : tileTransition ,
} ) ;
let noaaRadar = new ol . layer . Image ( {
title : 'NOAA Radar' ,
name : 'noaa_radar' ,
zIndex : 99 ,
type : 'overlay' ,
visible : false ,
source : noaaRadarSource ,
2024-03-28 13:39:46 +01:00
opacity : noaaRadarOpacity ,
2023-10-14 08:22:29 +02:00
extent : naExtent ,
} ) ;
us . push ( noaaRadar ) ;
}
2020-12-30 03:12:17 +01:00
2020-01-23 20:45:54 +01:00
if ( enableDWD ) {
2021-07-14 09:34:31 +02:00
const bottomLeft = ol . proj . fromLonLat ( [ 1.9 , 46.2 ] ) ;
const topRight = ol . proj . fromLonLat ( [ 16.0 , 55.0 ] ) ;
2023-10-14 08:22:29 +02:00
const dwdExtent = [ bottomLeft [ 0 ] , bottomLeft [ 1 ] , topRight [ 0 ] , topRight [ 1 ] ] ;
2022-07-28 12:52:42 +02:00
let dwdSource = new ol . source . TileWMS ( {
url : 'https://maps.dwd.de/geoserver/wms' ,
params : { LAYERS : dwdLayers , validtime : ( new Date ( ) ) . getTime ( ) } ,
projection : 'EPSG:3857' ,
attributions : 'Deutscher Wetterdienst (DWD)' ,
attributionsCollapsible : false ,
tileGrid : ol . tilegrid . createXYZ ( {
extent : ol . tilegrid . extentFromProjection ( 'EPSG:3857' ) ,
maxResolution : 156543.03392804097 ,
2021-04-27 20:49:50 +02:00
maxZoom : 8 ,
2022-07-28 12:52:42 +02:00
minZoom : 0 ,
2025-04-15 15:31:19 +00:00
tileSize : 512 ,
2020-01-23 20:45:54 +01:00
} ) ,
2022-07-31 16:16:24 +02:00
transition : tileTransition ,
2022-07-28 12:52:42 +02:00
} ) ;
let dwd = new ol . layer . Tile ( {
source : dwdSource ,
2020-01-23 20:45:54 +01:00
name : 'radolan' ,
title : 'DWD RADOLAN' ,
type : 'overlay' ,
2024-03-28 13:39:46 +01:00
opacity : dwdRadolanOpacity ,
2020-03-02 13:20:12 +01:00
visible : false ,
zIndex : 99 ,
2024-08-03 22:11:50 +02:00
//extent: dwdExtent,
// extent somehow bugged
2020-01-23 20:45:54 +01:00
} ) ;
2025-04-15 15:31:19 +00:00
let dwdValidtime = "" ;
2020-01-23 20:45:54 +01:00
2020-03-27 08:45:56 +01:00
let refreshDwd = function ( ) {
2025-04-15 15:31:19 +00:00
let ms = Date . now ( ) ;
let validtime = ( ms - ms % ( 5 * 60 * 1000 ) ) / 1000 ;
if ( validtime != dwdValidtime ) {
//console.log(`dwd validtime ${zuluTime(new Date(validtime * 1000))}`);
dwd . getSource ( ) . updateParams ( { validtime : validtime } ) ;
dwdValidtime = validtime ;
}
2020-01-23 20:45:54 +01:00
} ;
refreshDwd ( ) ;
2025-04-15 15:31:19 +00:00
window . setInterval ( refreshDwd , 15 * 1000 ) ;
2020-03-02 13:20:12 +01:00
europe . push ( dwd ) ;
2020-01-23 20:45:54 +01:00
}
2023-08-26 14:12:38 -05:00
if ( true ) {
2023-10-14 09:30:57 +02:00
g . getRainviewerLayers = async function ( key ) {
2023-08-26 14:12:38 -05:00
const response = await fetch ( "https://api.rainviewer.com/public/weather-maps.json" , { credentials : "omit" , } ) ;
const jsonData = await response . json ( ) ;
return jsonData [ key ] ;
}
const rainviewerRadar = new ol . layer . Tile ( {
name : 'rainviewer_radar' ,
title : 'RainViewer Radar' ,
type : 'overlay' ,
2024-03-28 13:39:46 +01:00
opacity : rainViewerRadarOpacity ,
2023-08-26 14:12:38 -05:00
visible : false ,
zIndex : 99 ,
} ) ;
2023-10-14 09:30:57 +02:00
g . refreshRainviewerRadar = async function ( ) {
const latestLayer = await g . getRainviewerLayers ( 'radar' ) ;
2023-08-26 14:12:38 -05:00
const rainviewerRadarSource = new ol . source . XYZ ( {
url : 'https://tilecache.rainviewer.com/v2/radar/' + latestLayer . past [ latestLayer . past . length - 1 ] . time + '/512/{z}/{x}/{y}/6/1_1.png' ,
attributions : '<a href="https://www.rainviewer.com/api.html" target="_blank">RainViewer.com</a>' ,
attributionsCollapsible : false ,
2025-10-22 15:34:23 +00:00
maxZoom : 7 ,
2023-08-26 14:12:38 -05:00
} ) ;
rainviewerRadar . setSource ( rainviewerRadarSource ) ;
} ;
2023-10-14 08:22:29 +02:00
2023-10-14 09:30:57 +02:00
rainviewerRadar . on ( 'change:visible' , function ( evt ) {
if ( evt . target . getVisible ( ) ) {
g . refreshRainviewerRadar ( ) ;
g . refreshRainviewerRadarInterval = window . setInterval ( g . refreshRainviewerRadar , 2 * 60 * 1000 ) ;
} else {
clearInterval ( g . refreshRainviewerRadarInterval ) ;
}
} ) ;
2023-08-26 14:12:38 -05:00
world . push ( rainviewerRadar ) ;
2025-10-10 06:20:06 +00:00
}
2023-10-14 08:22:29 +02:00
2020-03-27 08:45:56 +01:00
let createGeoJsonLayer = function ( title , name , url , fill , stroke , showLabel = true ) {
2020-03-01 23:12:41 +00:00
return new ol . layer . Vector ( {
type : 'overlay' ,
title : title ,
name : name ,
2020-03-02 13:20:12 +01:00
zIndex : 99 ,
visible : false ,
2020-03-01 23:12:41 +00:00
source : new ol . source . Vector ( {
2022-07-31 16:16:24 +02:00
url : url ,
transition : tileTransition ,
format : new ol . format . GeoJSON ( {
defaultDataProjection : 'EPSG:4326' ,
2020-03-01 23:12:41 +00:00
projection : 'EPSG:3857'
2022-07-31 16:16:24 +02:00
} )
2020-03-01 23:12:41 +00:00
} ) ,
2021-04-27 20:49:50 +02:00
style : function style ( feature ) {
2020-03-02 23:13:36 +00:00
return new ol . style . Style ( {
2020-03-02 20:14:40 +01:00
fill : new ol . style . Fill ( {
2020-03-02 23:13:36 +00:00
color : fill
2020-03-02 20:14:40 +01:00
} ) ,
stroke : new ol . style . Stroke ( {
2020-03-02 23:13:36 +00:00
color : stroke ,
width : 1
} ) ,
text : new ol . style . Text ( {
2020-03-09 23:31:04 +01:00
text : showLabel ? feature . get ( "name" ) : "" ,
2020-03-02 23:13:36 +00:00
overflow : OLMap . getView ( ) . getZoom ( ) > 5 ,
scale : 1.25 ,
fill : new ol . style . Fill ( {
color : '#000000'
} ) ,
stroke : new ol . style . Stroke ( {
color : '#FFFFFF' ,
width : 2
} )
2020-03-02 20:14:40 +01:00
} )
2020-03-02 23:13:36 +00:00
} ) ;
}
2020-03-01 23:12:41 +00:00
} ) ;
2020-03-02 20:14:40 +01:00
} ;
2023-01-19 07:58:03 +01:00
2023-01-19 06:48:49 +00:00
// Taken from https://www.ais.pansa.pl/mil/pliki/EP_ENR_2_4_en.pdf
europe . push ( createGeoJsonLayer ( 'PL AWACS Orbits' , 'plawacsorbits' , 'geojson/PL_Mil_AWACS_Orbits.geojson' , 'rgba(252, 186, 3, 0.3)' , 'rgba(252, 186, 3, 1)' , false ) ) ;
2020-01-03 21:16:40 +01:00
2023-01-19 06:51:10 +00:00
// Taken from https://english.defensie.nl/binaries/defence/documenten/publications/2022/12/14/milaip-01-23-part-1-gen-part-2-enr/MILAIP_01_2023split_GEN_ENR.pdf
europe . push ( createGeoJsonLayer ( 'NL AWACS Orbits' , 'nlawacsorbits' , 'geojson/NL_Mil_AWACS_Orbits.geojson' , 'rgba(252, 186, 3, 0.3)' , 'rgba(252, 186, 3, 1)' , false ) ) ;
// Taken from https://github.com/olithissen/AwacsOrbitsDE
europe . push ( createGeoJsonLayer ( 'DE AWACS Orbits' , 'deawacsorbits' , 'geojson/DE_Mil_AWACS_Orbits.geojson' , 'rgba(252, 186, 3, 0.3)' , 'rgba(252, 186, 3, 1)' , false ) ) ;
2023-01-19 07:58:03 +01:00
2020-03-01 23:12:41 +00:00
// Taken from https://github.com/alkissack/Dump1090-OpenLayers3-html
2020-03-02 13:20:12 +01:00
europe . push ( createGeoJsonLayer ( 'UK Radar Corridors' , 'ukradarcorridors' , 'geojson/UK_Mil_RC.geojson' , 'rgba(22, 171, 22, 0.3)' , 'rgba(22, 171, 22, 1)' ) ) ;
2020-06-18 08:12:10 +02:00
europe . push ( createGeoJsonLayer ( 'UK A2A Refueling' , 'uka2arefueling' , 'geojson/UK_Mil_AAR_Zones.geojson' , 'rgba(52, 50, 168, 0.3)' , 'rgba(52, 50, 168, 1)' ) ) ;
2023-01-19 06:45:48 +00:00
europe . push ( createGeoJsonLayer ( 'UK AWACS Orbits' , 'ukawacsorbits' , 'geojson/UK_Mil_AWACS_Orbits.geojson' , 'rgba(252, 186, 3, 0.3)' , 'rgba(252, 186, 3, 1)' , false ) ) ;
2020-03-09 22:21:00 +01:00
2020-03-12 17:46:13 +01:00
us . push ( createGeoJsonLayer ( 'US A2A Refueling' , 'usa2arefueling' , 'geojson/US_A2A_refueling.geojson' , 'rgba(52, 50, 168, 0.3)' , 'rgba(52, 50, 168, 1)' ) ) ;
2020-01-03 21:16:40 +01:00
2020-05-23 16:37:47 -04:00
us . push ( createGeoJsonLayer ( 'US ARTCC Boundaries' , 'usartccboundaries' , 'geojson/US_ARTCC_boundaries.geojson' , 'rgba(255, 0, 255, 0.3)' , 'rgba(255, 0, 255, 1)' , false ) ) ;
2022-04-06 21:20:38 +02:00
if ( uk _advisory ) {
europe . push ( createGeoJsonLayer ( 'uka_airports' , 'uka_airports' , 'geojson/uk_advisory/airports.geojson' , 'rgba(255, 255, 255, 1)' , 'rgba(255, 255, 255, 1)' ) ) ;
2025-05-05 16:54:53 +00:00
europe . push ( createGeoJsonLayer ( 'uka_airspaces' , 'uka_airspaces' ,
'https://raw.githubusercontent.com/wiedehopf/tar1090-aux/master/uk_advisory/airspaces.geojson' ,
'rgba(0, 0, 0, 0.1)' , 'rgba(0, 30, 255, 0.2)' ) ) ;
2022-04-06 21:20:38 +02:00
//europe.push(createGeoJsonLayer('hotspots', 'hotspots', 'geojson/uk_advisory/hotspots.geojson', 'rgba(255, 255, 255, 1)', 'rgba(255, 255, 255, 1)'));
//europe.push(createGeoJsonLayer('navaids', 'navaids', 'geojson/uk_advisory/navaids.geojson', 'rgba(0, 0, 0, 1)', 'rgba(0, 0, 0, 1)'));
europe . push ( createGeoJsonLayer ( 'uka_runways' , 'uka_runways' , 'geojson/uk_advisory/runways.geojson' , 'rgba(0, 0, 0, 0.5)' , 'rgba(0, 0, 0, 0.5)' ) ) ;
europe . push ( createGeoJsonLayer ( 'uka_shoreham' , 'uka_shoreham' , 'geojson/uk_advisory/shoreham.geojson' , 'rgba(0, 0, 0, 0.5)' , 'rgba(0, 0, 0, 0.5)' ) ) ;
}
2020-05-08 21:55:20 +02:00
if ( l3harris ) {
2021-04-23 17:01:56 +02:00
let files = [ 'IFT_NAV_Routes.geojson' , 'IFT_Training_Areas.geojson' , 'USAFA_Training_Areas.geojson' ] ;
for ( let i in files ) {
let name = files [ i ] . split ( '.' ) [ 0 ] ;
us . push ( createGeoJsonLayer ( name , 'ift' + i , 'geojson/IFT/' + files [ i ] , 'rgba(52, 50, 168, 0.3)' , 'rgba(52, 50, 168, 1)' ) ) ;
}
2020-05-08 21:55:20 +02:00
}
2024-05-06 19:52:38 +02:00
if ( usp . has ( 'aiscatcher_server' ) ) { aiscatcher _server = usp . get ( 'aiscatcher_server' ) ; }
2024-05-08 14:50:15 +02:00
if ( aiscatcher _server == 'disable' || heatmap || replay ) {
aiscatcher _server = "" ;
}
2024-05-05 21:19:56 +02:00
if ( aiscatcher _server ) {
g . aiscatcher _source = new ol . source . Vector ( {
2024-05-06 00:53:57 +02:00
format : new ol . format . GeoJSON ( ) ,
2024-05-05 21:19:56 +02:00
} ) ;
const aiscatcher _mapping = {
0 : { size : [ 20 , 20 ] , offset : [ 120 , 20 ] , comment : 'CLASS_OTHER' } ,
1 : { size : [ 20 , 20 ] , offset : [ 120 , 20 ] , comment : 'CLASS_UNKNOWN' } ,
2 : { size : [ 20 , 20 ] , offset : [ 0 , 20 ] , comment : 'CLASS_CARGO' } ,
3 : { size : [ 20 , 20 ] , offset : [ 20 , 20 ] , comment : 'CLASS_B' } ,
4 : { size : [ 20 , 20 ] , offset : [ 40 , 20 ] , comment : 'CLASS_PASSENGER' } ,
5 : { size : [ 20 , 20 ] , offset : [ 60 , 20 ] , comment : 'CLASS_SPECIAL' } ,
6 : { size : [ 20 , 20 ] , offset : [ 80 , 20 ] , comment : 'CLASS_TANKER' } ,
7 : { size : [ 20 , 20 ] , offset : [ 100 , 20 ] , comment : 'CLASS_HIGHSPEED' } ,
8 : { size : [ 20 , 20 ] , offset : [ 140 , 20 ] , comment : 'CLASS_FISHING' } ,
9 : { size : [ 25 , 25 ] , offset : [ 0 , 60 ] , comment : 'CLASS_PLANE' } ,
10 : { size : [ 25 , 25 ] , offset : [ 0 , 85 ] , comment : 'CLASS_HELICOPTER' } ,
11 : { size : [ 20 , 20 ] , offset : [ 20 , 40 ] , comment : 'CLASS_STATION' } ,
12 : { size : [ 20 , 20 ] , offset : [ 0 , 40 ] , comment : 'CLASS_ATON' } ,
13 : { size : [ 20 , 20 ] , offset : [ 40 , 40 ] , comment : 'CLASS_SARTEPIRB' }
} ;
2024-05-06 00:22:12 +02:00
g . aiscatcherLayer = new ol . layer . Vector ( {
2024-05-05 21:19:56 +02:00
type : 'overlay' ,
title : "aiscatcher" ,
name : "aiscatcher" ,
zIndex : 99 ,
source : g . aiscatcher _source ,
style : function ( feature ) {
const cog = feature . get ( 'cog' ) ;
const rotation = ( cog || 0 ) * ( Math . PI / 180 ) ;
const shipclass = feature . get ( 'shipclass' ) ;
const speed = feature . get ( 'speed' ) ;
const ofs = aiscatcher _mapping [ shipclass ] . offset ;
const size = aiscatcher _mapping [ shipclass ] . size ;
let o ;
if ( speed && speed > 0.5 ) {
o = [ ofs [ 0 ] , 0 ] ;
2024-05-05 21:18:53 +02:00
} else {
2024-05-05 21:19:56 +02:00
o = ofs ;
2024-05-05 21:18:53 +02:00
}
2024-05-05 19:11:02 +02:00
2024-05-05 21:19:56 +02:00
return new ol . style . Style ( {
image : new ol . style . Icon ( {
src : aiscatcher _server + '/icons.png' ,
anchor : [ 0.5 , 0.5 ] ,
rotation : rotation ,
size : size ,
offset : o
} )
} ) ;
}
} ) ;
2024-05-06 00:22:12 +02:00
world . push ( g . aiscatcherLayer ) ;
2024-05-05 21:19:56 +02:00
}
2024-05-05 19:11:02 +02:00
2022-05-28 19:35:27 +02:00
layers . push ( new ol . layer . Group ( {
name : 'custom' ,
title : 'Custom' ,
layers : custom _layers ,
} ) ) ;
2020-03-02 13:20:12 +01:00
if ( europe . getLength ( ) > 0 ) {
layers . push ( new ol . layer . Group ( {
name : 'europe' ,
title : 'Europe' ,
layers : new ol . Collection ( europe . getArray ( ) . reverse ( ) ) ,
2021-10-29 21:14:01 +02:00
fold : 'open' ,
2020-02-08 20:32:04 +01:00
} ) ) ;
}
2020-01-03 21:16:40 +01:00
if ( us . getLength ( ) > 0 ) {
layers . push ( new ol . layer . Group ( {
name : 'us' ,
title : 'US' ,
2020-03-02 13:20:12 +01:00
layers : new ol . Collection ( us . getArray ( ) . reverse ( ) ) ,
2021-10-29 21:14:01 +02:00
fold : 'open' ,
2020-01-03 21:16:40 +01:00
} ) ) ;
}
2020-01-23 20:45:54 +01:00
2020-01-03 21:16:40 +01:00
if ( world . getLength ( ) > 0 ) {
layers . push ( new ol . layer . Group ( {
name : 'world' ,
title : 'Worldwide' ,
2020-03-02 13:20:12 +01:00
layers : new ol . Collection ( world . getArray ( ) . reverse ( ) ) ,
//fold: 'open',
2020-03-01 23:12:41 +00:00
} ) ) ;
}
2020-02-29 17:51:42 +01:00
2020-01-23 20:45:54 +01:00
2020-01-03 21:16:40 +01:00
return layers _group ;
}