protomaps-leaflet
Version:
Vector tile rendering and labeling for [Leaflet](https://github.com/Leaflet/Leaflet).
60 lines (59 loc) • 2.04 kB
TypeScript
import Point from "@mapbox/point-geometry";
import { PMTiles } from "pmtiles";
import { LabelRule } from "../labeler";
import { PaintRule } from "../painter";
import { SourceOptions, View } from "../view";
export declare const getZoom: (degreesLng: number, cssPixels: number) => number;
interface StaticOptions {
debug?: string;
lang?: string;
maxDataZoom?: number;
url?: PMTiles | string;
sources?: Record<string, SourceOptions>;
paintRules?: PaintRule[];
labelRules?: LabelRule[];
language?: string[];
backgroundColor?: string;
theme?: string;
}
export declare class Static {
paintRules: PaintRule[];
labelRules: LabelRule[];
views: Map<string, View>;
debug?: string;
backgroundColor?: string;
constructor(options: StaticOptions);
drawContext(ctx: CanvasRenderingContext2D, width: number, height: number, latlng: Point, displayZoom: number): Promise<{
elapsed: number;
project: (latlng: Point) => Point;
unproject: (point: Point) => {
lat: number;
lng: number;
};
}>;
drawCanvas(canvas: HTMLCanvasElement, latlng: Point, displayZoom: number, options?: StaticOptions): Promise<{
elapsed: number;
project: (latlng: Point) => Point;
unproject: (point: Point) => {
lat: number;
lng: number;
};
} | undefined>;
drawContextBounds(ctx: CanvasRenderingContext2D, topLeft: Point, bottomRight: Point, width: number, height: number): Promise<{
elapsed: number;
project: (latlng: Point) => Point;
unproject: (point: Point) => {
lat: number;
lng: number;
};
}>;
drawCanvasBounds(canvas: HTMLCanvasElement, topLeft: Point, bottomRight: Point, width: number, options?: StaticOptions): Promise<{
elapsed: number;
project: (latlng: Point) => Point;
unproject: (point: Point) => {
lat: number;
lng: number;
};
} | undefined>;
}
export {};