View as Markdown

API reference: @salmonui/charts/geo-map

GeoMapApiinterface

import type { GeoMapApi } from '@salmonui/charts/geo-map';
interface GeoMapApi {
    readonly element: HTMLElement | null;
    fitBounds(bounds: readonly [
        LatLon,
        LatLon
    ] | 'markers'): void;
    panBy(direction: 'up' | 'down' | 'left' | 'right', fraction?: number): void;
    toCoordinates(point: {
        readonly x: number;
        readonly y: number;
    }): {
        latitude: number;
        longitude: number;
    };
    toPoint(position: LatLon): {
        x: number;
        y: number;
    };
    export(options?: {
        readonly format?: 'png' | 'jpeg' | 'svg' | undefined;
        readonly fileName?: string | undefined;
        readonly scale?: number | undefined;
    }): Promise<void>;
    toBlob(format?: 'png' | 'jpeg' | 'svg'): Promise<Blob>;
    toDataURL(format?: 'png' | 'jpeg' | 'svg'): Promise<string>;
    toSVGString(): string;
    print(): Promise<void>;
    focus(): void;
}
GeoMapApi members (11)
NameSignatureDescription
elementreadonly element: HTMLElement | null;
fitBoundsfitBounds(bounds: readonly [ LatLon, LatLon ] | 'markers'): void;

Fits the view to [[lat, lon], [lat, lon]] bounds or to every marker.

panBypanBy(direction: 'up' | 'down' | 'left' | 'right', fraction?: number): void;
toCoordinatestoCoordinates(point: { readonly x: number; readonly y: number; }): { latitude: number; longitude: number; };

Drawing coordinates (px) to { latitude, longitude }.

toPointtoPoint(position: LatLon): { x: number; y: number; };

[latitude, longitude] to drawing coordinates (px).

exportexport(options?: { readonly format?: 'png' | 'jpeg' | 'svg' | undefined; readonly fileName?: string | undefined; readonly scale?: number | undefined; }): Promise<void>;
toBlobtoBlob(format?: 'png' | 'jpeg' | 'svg'): Promise<Blob>;
toDataURLtoDataURL(format?: 'png' | 'jpeg' | 'svg'): Promise<string>;
toSVGStringtoSVGString(): string;
printprint(): Promise<void>;
focusfocus(): void;