You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libsdr/cmd/shared/index.html

72 lines
2.2 KiB
HTML

<html>
<head>
<title>sdr-aprs &mdash; An APRS receiver using libsdr.</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script>
var map;
var connections = {};
var qth = null;
function onSetQTH (lon, lat) {
// Center map at QTH
map.setCenter(new google.maps.LatLng(lat, lon));
// Add or update the marker at QTH
if (null == qth) {
qth = new google.maps.Marker({
position: new google.maps.LatLng(lat, lon),
title: "QTH", map: map});
} else {
qth.setPosition(new google.maps.LatLng(lat, lon));
}
}
function onAddConnection (callsign, lon, lat, snr) {
// Check if connection exists
if (callsign in connections) {
// If connection exists, update SNR
connections[callsign].line.setOptions(options={
clickable: false, draggable: false, geodesic: true,
path: [qth.getPosition(), new google.maps.LatLng(lat, lon)],
strokeColor: '#0000FF', strokeOpacity: (1.0 + Math.min(0, snr/40)), strokeWeight: 2 } );
connections[callsign].marker.setPosition(new google.maps.LatLng(lat, lon));
} else {
// otherwise, add marker at location with label callsign and line from QTH to location
var marker = new google.maps.Marker({
position: new google.maps.LatLng(lat, lon), title: callsign, map: map});
var line = new google.maps.Polyline({
clickable: false, draggable: false, geodesic: true,
path: [qth.getPosition(), new google.maps.LatLng(lat, lon)],
strokeColor: '#0000FF', strokeOpacity: (1.0 + Math.min(0, snr/40)), strokeWeight: 2 });
line.setMap(map);
connections[callsign] = { marker: marker, line: line };
}
}
function initialize() {
// Create Map object
map = new google.maps.Map(
document.getElementById('map-canvas'),
{zoom:2, center: new google.maps.LatLng(0,0), streetViewControl:false});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas">
<p>Can not load Google Maps view. Check your internet conenction!</p>
</div>
</body>
</html>