Ugly hack: draw a polygon in dump1090-fa

Discussion in 'Other technical not related to ADSBx Feeding' started by hmsaar, Dec 16, 2018.

  1. hmsaar

    hmsaar New Member

    I'd like to suggest that military training airspaces will show up in adsbx.

    As an intermediate solution I made an ugly hack in my piaware's dump1090-fa that shows the polygon of the German training airspace TRA LAUTER aka ED-R 205/305 in Germany's southwest. You can easily change the coordinates and create your own polygon.

    it's tested with dump1090-fa 3.6.3

    Just edit /usr/share/dump1090-fa/html/layers.js. It's the part from "hm start" to "hm end":

    // -*- mode: javascript; indent-tabs-mode: nil; c-basic-offset: 8 -*-
    "use strict";

    // Base layers configuration

    function createBaseLayers() {
    var layers = [];

    var world = [];
    var us = [];

    world.push(new ol.layer.Tile({
    source: new ol.source.OSM(),
    name: 'osm',
    title: 'OpenStreetMap',
    type: 'base',
    }));

    //-- hm start ----------------
    var traFeature = new ol.Feature({
    geometry: new ol.geom.Polygon([[
    [6.60888888888889,49.9344444],
    [6.89888888888889,49.9427778],
    [8.39416666666667,49.7108333],
    [8.44888888888889,49.6697222],
    [8.37416666666667,49.0763889],
    [8.34833333333333,49.0044444],
    [8.29166666666667,48.9677778],
    [7.51583333333333,49.105],
    [6.70194444444444,49.2183333],
    [6.42527777777778,49.6297222],
    [6.50277777777778,49.8091667]
    ]])
    });
    traFeature.getGeometry().transform('EPSG:4326','EPSG:3857');

    var traSource= new ol.source.Vector({
    features: [traFeature]
    });

    world.push(new ol.layer.Vector({
    source: traSource,
    style: new ol.style.Style({
    stroke: new ol.style.Stroke({
    color: 'blue',
    width: 0.5
    }),
    fill: new ol.style.Fill({
    color: [0,0,255,0.05]
    })
    })
    }));
    //-- hm end ------------------

    if (BingMapsAPIKey) {
    world.push(new ol.layer.Tile({
    [...]
     
    James likes this.
  2. Ed Itor

    Ed Itor Member

    cool. can we have that in the global public map, too?