Skip to content

Commit dceae2e

Browse files
added aprs.fi coverage overlay (selfhost tiles)
1 parent 066472f commit dceae2e

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ js/mobile.js
44
js/init_plot.js
55
css/mobile.css
66
cache.manifest
7+
tiles/

index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ <h4>Overlays</h4>
153153
<input type="checkbox" id="opt_daylight">
154154
</div>
155155
</div>
156+
<div class="row option">
157+
<span><b>APRS coverage</b></span>
158+
<div class="switch off" id="sw_layers_aprs">
159+
<span class="thumb"></span>
160+
<input type="checkbox" id="opt_layers_aprs">
161+
</div>
162+
</div>
156163
<div class="row option">
157164
<span><b>Cloud layer</b></span>
158165
<div class="switch off" id="sw_layers_clouds">

js/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ $(window).ready(function() {
574574
// list of all switches
575575
var opts = [
576576
"#sw_layers_clouds",
577+
"#sw_layers_aprs",
577578
"#sw_offline",
578579
"#sw_station",
579580
"#sw_imperial",
@@ -640,6 +641,10 @@ $(window).ready(function() {
640641
$('#lookanglesbox').css({top:'40px'});
641642
}
642643
break;
644+
case "opt_layers_aprs":
645+
if(on) map.overlayMapTypes.setAt("1", overlayAPRS);
646+
else map.overlayMapTypes.setAt("1", null);
647+
break;
643648
case "opt_layers_clouds":
644649
if(on) { layers_clouds.setMap(map); }
645650
else { layers_clouds.setMap(null); }

js/tracker.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ var plot_options = {
8585
]
8686
};
8787

88+
// aprs overlay
89+
var overlayAPRS = new google.maps.ImageMapType({
90+
getTileUrl: function(coord, zoom) {
91+
var n = Math.pow(2,zoom);
92+
return (coord.y<0 || coord.y>=n || zoom > 5) ? null : "tiles/aprs/tile_"+zoom+"_"+wrapTiles(coord.x,zoom)+"_"+coord.y+".png";
93+
},
94+
tileSize: new google.maps.Size(256,256)
95+
});
96+
8897
// weather
8998
var weatherOverlayId = "nexrad-n0q-900913";
9099
var weatherOverlay = new google.maps.ImageMapType({
@@ -384,6 +393,9 @@ function load() {
384393
// initialize clouds layer
385394
layers_clouds = new google.maps.weather.CloudLayer();
386395
if(offline.get('opt_layers_clouds')) layers_clouds.setMap(map);
396+
397+
// load if aprs layer, if selected
398+
if(offline.get('opt_layers_aprs')) map.overlayMapTypes.setAt("1", overlayAPRS);
387399
}
388400

389401
function unload() {

0 commit comments

Comments
 (0)