NodeLocationMap: reduce default zoom by 1, add navigation controls

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel Pupius
2026-03-16 00:08:11 +00:00
parent 5242622107
commit 3ca73ae978

View File

@@ -33,7 +33,7 @@ export const NodeLocationMap: React.FC<NodeLocationMapProps> = ({
const mapRef = useRef<maplibregl.Map | null>(null); const mapRef = useRef<maplibregl.Map | null>(null);
const accuracyMeters = calculateAccuracyFromPrecisionBits(precisionBits); const accuracyMeters = calculateAccuracyFromPrecisionBits(precisionBits);
const effectiveZoom = zoom ?? calculateZoomFromAccuracy(accuracyMeters); const effectiveZoom = zoom ?? Math.max(1, calculateZoomFromAccuracy(accuracyMeters) - 1);
const markerGeoJSON = useMemo((): FeatureCollection => ({ const markerGeoJSON = useMemo((): FeatureCollection => ({
type: "FeatureCollection", type: "FeatureCollection",
@@ -62,6 +62,7 @@ export const NodeLocationMap: React.FC<NodeLocationMapProps> = ({
}); });
map.addControl(new maplibregl.AttributionControl({ compact: true })); map.addControl(new maplibregl.AttributionControl({ compact: true }));
map.addControl(new maplibregl.NavigationControl(), 'top-left');
map.on("load", () => { map.on("load", () => {
map.addSource("circle", { type: "geojson", data: circleGeoJSON }); map.addSource("circle", { type: "geojson", data: circleGeoJSON });