Added Maglink RTK GNSS receiver integration with correct BLE UUIDs and device name filtering (ML-* prefix). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
65 lines
2.2 KiB
HTML
65 lines
2.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<style>
|
|
html, body, #map { height: 100%; margin: 0; padding: 0; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="map"></div>
|
|
<script>
|
|
let map;
|
|
let markers = [];
|
|
let infoWindow;
|
|
|
|
function initMap() {
|
|
map = new google.maps.Map(document.getElementById('map'), {
|
|
center: { lat: 39.5, lng: -98.35 },
|
|
zoom: 4,
|
|
mapTypeId: 'hybrid'
|
|
});
|
|
infoWindow = new google.maps.InfoWindow();
|
|
}
|
|
|
|
// Called from the app with an array of point objects.
|
|
function setPoints(points) {
|
|
markers.forEach(m => m.setMap(null));
|
|
markers = [];
|
|
if (!map || !points || points.length === 0) return;
|
|
|
|
const bounds = new google.maps.LatLngBounds();
|
|
points.forEach(p => {
|
|
const pos = { lat: p.lat, lng: p.lng };
|
|
const marker = new google.maps.Marker({
|
|
position: pos,
|
|
map: map,
|
|
title: '#' + p.id + ' ' + p.utility
|
|
});
|
|
marker.addListener('click', () => {
|
|
infoWindow.setContent(
|
|
'<b>#' + p.id + ' · ' + p.utility + '</b><br/>' +
|
|
'Depth: ' + p.depth + ' · Current: ' + p.current + '<br/>' +
|
|
'Frequency: ' + p.frequency + ' Hz<br/>' +
|
|
'Fix: ' + p.fix + ' (±' + p.hrms.toFixed(3) + ' m)<br/>' +
|
|
p.time);
|
|
infoWindow.open(map, marker);
|
|
});
|
|
markers.push(marker);
|
|
bounds.extend(pos);
|
|
});
|
|
|
|
if (points.length === 1) {
|
|
map.setCenter(bounds.getCenter());
|
|
map.setZoom(19);
|
|
} else {
|
|
map.fitBounds(bounds, 60);
|
|
}
|
|
}
|
|
</script>
|
|
<script async
|
|
src="https://maps.googleapis.com/maps/api/js?key=%%GOOGLE_MAPS_API_KEY%%&callback=initMap"></script>
|
|
</body>
|
|
</html>
|