mirror of
https://github.com/dpup/meshstream.git
synced 2026-03-28 17:42:37 +01:00
NodeLocationMap: reduce default zoom by 1, add navigation controls
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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 });
|
||||||
|
|||||||
Reference in New Issue
Block a user