mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-11-02 05:51:30 +08:00
feat(geomap): set default position
This commit is contained in:
parent
a8e2c2901b
commit
9e2c592383
@ -74,6 +74,8 @@ const TPL = `\
|
||||
|
||||
const LOCATION_ATTRIBUTE = "geolocation";
|
||||
const CHILD_NOTE_ICON = "bx bx-pin";
|
||||
const DEFAULT_COORDINATES: [ number, number ] = [ 3.878638227135724, 446.6630455551659 ];
|
||||
const DEFAULT_ZOOM = 2;
|
||||
|
||||
interface MapData {
|
||||
view?: {
|
||||
@ -143,8 +145,8 @@ export default class GeoMapTypeWidget extends TypeWidget {
|
||||
}
|
||||
|
||||
// Restore viewport position & zoom
|
||||
const center = parsedContent.view?.center ?? [51.505, -0.09];
|
||||
const zoom = parsedContent.view?.zoom ?? 13;
|
||||
const center = parsedContent.view?.center ?? DEFAULT_COORDINATES;
|
||||
const zoom = parsedContent.view?.zoom ?? DEFAULT_ZOOM;
|
||||
map.setView(center, zoom);
|
||||
|
||||
// Restore markers.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user