2025-09-03 23:17:35 +03:00
|
|
|
import Map from "./map";
|
|
|
|
|
import "./index.css";
|
2025-09-03 23:35:29 +03:00
|
|
|
import { ViewModeProps } from "../interface";
|
|
|
|
|
import { useNoteLabel } from "../../react/hooks";
|
|
|
|
|
import { DEFAULT_MAP_LAYER_NAME } from "./map_layer";
|
2025-09-03 23:57:38 +03:00
|
|
|
import { LatLng } from "leaflet";
|
2025-09-03 23:17:35 +03:00
|
|
|
|
|
|
|
|
const DEFAULT_COORDINATES: [number, number] = [3.878638227135724, 446.6630455551659];
|
|
|
|
|
const DEFAULT_ZOOM = 2;
|
|
|
|
|
|
2025-09-03 23:57:38 +03:00
|
|
|
interface MapData {
|
|
|
|
|
view?: {
|
|
|
|
|
center?: LatLng | [number, number];
|
|
|
|
|
zoom?: number;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function GeoView({ note, viewStorage }: ViewModeProps<MapData>) {
|
2025-09-03 23:35:29 +03:00
|
|
|
const [ layerName ] = useNoteLabel(note, "map:style");
|
|
|
|
|
|
2025-09-03 23:17:35 +03:00
|
|
|
return (
|
|
|
|
|
<div className="geo-view">
|
|
|
|
|
<Map
|
|
|
|
|
coordinates={DEFAULT_COORDINATES}
|
|
|
|
|
zoom={DEFAULT_ZOOM}
|
2025-09-03 23:35:29 +03:00
|
|
|
layerName={layerName ?? DEFAULT_MAP_LAYER_NAME}
|
2025-09-03 23:17:35 +03:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|