Skip to content

Latest commit

 

History

History
123 lines (87 loc) · 8.07 KB

README.md

File metadata and controls

123 lines (87 loc) · 8.07 KB

Overlays and map controls for Virtual Radar Server (VRS) using Leaflet maps.

This JavaScript code is a plugin for the ADSB aircraft tracking Virtual Radar Server software. The Javascript files need to be used with the Virtual Radar Server Custom Content plugin.

This repo brings together and updates several scripts (EndOfHead.html and EndOfBody.html) written by others as well as adds new scripts (Scale.html and Fullscreen.html)

Features:

  1. 8 different base layer maps
  2. OpenAIP Airspace layer
  3. Funtional weather layers
  4. Moving Day/Night Terminator
  5. Airport information (depending if you region has been added)
  6. OpenSea and Open Train layers
  7. TFR (Temp Flt. Restrictions) - US only

 

EndOfHead.html and EndOfBody.html

These two files work in tandem to insert a icon with pop up at the bottom left of the map and allows the user to select airspace layers, weather layers and UK specific overlays which will be added to the base Leaflet map used in VRS.

API Keys

Users will need to sign up for API keys for some of the functionalty of this script to work properly.

  1. Open Weather 1.0 API key Please note: if you do not enter an API key the Pressure, Temperature and Wind layer will not show in the menu.
  2. OpenAIP Key Please note: if you do not enter an API key the Airspace layer will not show on the map.
  3. Thunderforest Please note: if you do not enter an API key the Spinal Map will not display if selected.
  4. Stadiamaps Please note: if you do not enter an API key the Terrain map will not display.

This script is set up to work with VRS as a baremetal install (installed directly onto the OS, either windows or linux) and also to work with SDR-Enthusiasts docker container for VRS. For those working with a baremetal install of VRS the keys need to be inserted into the script here: (around line 50 ish) (Skip this if using the docker container VRS as these are all part of the compose for the container)

 // Add API Keys here
 var OPENWXAPIKEY     = `##OPENWXAPIKEY##`;     // replace ##OPENWXAPIKEY## with your key and KEEP the ` `
 var OPENAIPKEY       = `##OPENAIPKEY##`;       // replace ##OPENAIPKEY##  with your key and KEEP the ` `
 var THUNDERFORESTKEY = `##THUNDERFORESTKEY##`; // replace ##THUNDERFORESTKEY##  with your key and KEEP the ` `
 var STADIAKEY        = `##STADIAKEY##`;        // replace ##STADIAKEY##  with your key and KEEP the ` `

Default Options

The user can set default options from within the script to allow a specific map and your choice of layers to be enabled by default. Just set the map number to which ever one you want, and for the layers change those that you want on start up from a 0 to a 1. These options can be found near the top of the script.

                    // Configuration
                    var config =
                    {
                        /* Map Config */
                        defaultMap: 1,                      // 1: OpenStreetMap, 2: OpenStreetMap Dark, 3: OpenTopoMap, 4: WaterColour, 5: CartoDark, 6: Terrain, 7: Satellite, 8: Spinal Map
                        layerMenuPosition: `bottomleft`,    // Valid positions: `topleft`, `topright`, `bottomleft` or `bottomright`

                        /* Enable Layers */
                        airspace: 1,
                        navAids: 0,
                        tfrUSA: 0,
                        seaMarkers: 1,
                        trainMap: 0,
                        clouds: 0,
                        rain: 1,
                        temps: 0,
                        wind: 0,
                        pressure: 0,
                        dayNight: 1,
                        civilAirfields: 0,
                        militaryAirfields: 0,
                        heliports: 0,
                        glidingSpots: 0
                    };

The above options are set to show the OpenStreetMap and show the OpenAIP Airspace layer, the OpenSea layer, the Rainviewer layer and the day/night terminator as default.

 

Fullscreen.html

Adds a full screen button to the VRS map under the zoom +/- buttons and moves the +/- buttons to the top right of the screen.

 

Scale.html

Adds a distance scale next to the VRS menu in the top left of the map

 

Installation

Ensure Custom Content Plugin installed (Yellow Arrow). Enable Custom content plugin (Blue box) Put the HTML files in the required folder for the Custom Content plugin as per Custom Content plugin instructions (Red Box) and the entire contents of Put these files in VRS root folder folder into the root folder referenced by the Custom Content plugin (Green Box) and then set up the files injections as per the bottom 4 lines in the below image (Red Box again):

Screenshot

Localisation

Defaults to GB airports etc. If you wish to change to airports for your country remove the country code e.g. DE from the end of the .geojson files in the Put these files in VRS root folder before placing them in the root folder for your VRS

airportsDE.geojson --> airports.geojson

Countries added on request - please open an issue to request

IMPORTANT NOTICE: These overlays contain aviation airscape, weather, navigational aids, airfield information, etc. All of these are purely for entertainment / hobby use and MUST NEVER be relied upon to any extent for real world aviation / flying. You should always use the latest legal airspace charts and weather information as published by official sources. This is not an official source. By using this code you agree to make users of your webpage aware of this, and agree that the publisher is not responsible for any loss or damage resulting from the use of this code. The airspace charts, navigational aids,aerodrome information, weather, etc will not be 100% complete or accurate and will contain errors.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

I am very grateful for the following resources which have been used in this code:

Screenshot of working example:

Screenshot

Also can be seen working on my VRS page - cornwallvrs.com/VirtualRadar.