import { LatLng, LatLngBounds, type LatLngBoundsLike, type LatLngLike } from "../geo.js"; import type { QueryHit, ResolvedQueryOptions } from "../layer.js"; import type { Orihon } from "../map.js"; import type { OverlayContent, PopupOptions, TooltipOptions } from "../overlays/div-overlay.js"; import { Renderer, type RendererOptions } from "../renderer.js"; import { type RemovedLineStyleAliases } from "../style-contract.js"; export interface PathOptions extends RendererOptions, RemovedLineStyleAliases { stroke?: string; strokeWidth?: number; strokeOpacity?: number; fill?: string; fillOpacity?: number; lineCap?: CanvasLineCap; lineJoin?: CanvasLineJoin; dashArray?: string | number[] | null; dashOffset?: number; geodesic?: boolean; arrow?: boolean | "end" | "start" | "both"; arrowSize?: number; interactive?: boolean; smoothFactor?: number; noClip?: boolean; clipPadding?: number; } type ResolvedPathOptions = Required> & Pick; export declare class SvgLayer extends Renderer { svg: SVGSVGElement | null; group: SVGGElement | null; protected createContainer(): SVGSVGElement; onAdd(map: Orihon): void; onRemove(): void; render(): void; } export interface PathEventMap { click: { originalEvent: MouseEvent | PointerEvent; latlng: LatLng; }; mouseover: { originalEvent: PointerEvent; latlng: LatLng; }; mouseout: { originalEvent: PointerEvent; latlng: LatLng; }; } export declare class PathLayer extends SvgLayer { #private; path: SVGPathElement | SVGCircleElement | null; readonly _pathUnsub: Array<() => void>; protected supportsArrows: boolean; private arrowMarker; private arrowMarkerId; constructor(options?: PathOptions); protected createPathElement(): SVGPathElement | SVGCircleElement; onAdd(map: Orihon): void; onRemove(): void; setStyle(style: PathOptions): this; bindPopup(content: OverlayContent, options?: PopupOptions): this; bindTooltip(content: OverlayContent, options?: TooltipOptions): this; setInteractive(interactive: boolean): this; protected interactionPointerEvents(): "all" | "visiblePainted"; } export declare function normalizeDashArray(value: PathOptions["dashArray"]): number[]; export declare function densifyLatLngs(points: LatLng[], closed?: boolean, maxSegmentMeters?: number): LatLng[]; interface ProjectedBounds { minX: number; minY: number; maxX: number; maxY: number; } interface PointLikeXY { x: number; y: number; } export declare function projectedBounds(points: PointLikeXY[]): ProjectedBounds; export declare function projectedBoundsIntersectsViewport(map: Orihon, bounds: ProjectedBounds, padding?: number): boolean; export declare function simplifyProjectedPoints(points: PointLikeXY[], tolerance?: number): PointLikeXY[]; export declare function projectedPointsToPath(points: PointLikeXY[], close?: boolean): string; export declare class Polyline extends PathLayer { #private; points: LatLng[]; protected supportsArrows: boolean; private geodesicPoints; constructor(points: LatLngLike[], options?: PathOptions); setLatLngs(points: LatLngLike[]): this; getLatLngs(): LatLng[] | LatLng[][]; getBounds(): LatLngBounds; queryHit(target: PointLikeXY, options: ResolvedQueryOptions): QueryHit | null; render(): void; } export declare class Polygon extends Polyline { rings: LatLng[][]; constructor(points: LatLngLike[] | LatLngLike[][], options?: PathOptions); protected interactionPointerEvents(): "all"; setLatLngs(points: LatLngLike[] | LatLngLike[][]): this; getLatLngs(): LatLng[][]; getBounds(): LatLngBounds; queryHit(target: PointLikeXY, options: ResolvedQueryOptions): QueryHit | null; render(): void; } export declare class Rectangle extends Polygon { rectangleBounds: LatLngBounds; constructor(value: LatLngBoundsLike, options?: PathOptions); setBounds(value: LatLngBoundsLike): this; getBounds(): LatLngBounds; } /** Exactly one explicit radius unit; map units are supported only by CRS.Simple. */ export type CircleRadius = { readonly radiusMeters: number; readonly radiusMapUnits?: never; } | { readonly radiusMapUnits: number; readonly radiusMeters?: never; }; export declare class Circle extends PathLayer { #private; center: LatLng; constructor(center: LatLngLike, radius: CircleRadius, options?: PathOptions); onAdd(map: Orihon): void; protected interactionPointerEvents(): "all"; getLatLng(): LatLng; getRadius(): CircleRadius; getRadiusMeters(): number; getRadiusMapUnits(): number; getBounds(): LatLngBounds; queryHit(target: PointLikeXY, options: ResolvedQueryOptions): QueryHit | null; setLatLng(value: LatLngLike): this; setRadius(radius: CircleRadius): this; setRadiusMeters(radiusMeters: number): this; setRadiusMapUnits(radiusMapUnits: number): this; render(): void; } export interface CircleMarkerOptions extends PathOptions { /** Radius in CSS pixels, independent of zoom. Default 10. */ radiusPixels?: number; } export declare class CircleMarker extends PathLayer { #private; center: LatLng; get radiusPixels(): number; constructor(center: LatLngLike, options?: CircleMarkerOptions); protected createPathElement(): SVGCircleElement; protected interactionPointerEvents(): "all"; getLatLng(): LatLng; getRadiusPixels(): number; setLatLng(value: LatLngLike): this; setRadiusPixels(radiusPixels: number): this; getBounds(): LatLngBounds; queryHit(target: PointLikeXY, options: ResolvedQueryOptions): QueryHit | null; render(): void; } export declare function polyline(points: LatLngLike[], options?: PathOptions): Polyline; export declare function polygon(points: LatLngLike[] | LatLngLike[][], options?: PathOptions): Polygon; export declare function rectangle(value: LatLngBoundsLike, options?: PathOptions): Rectangle; export declare function circle(center: LatLngLike, radius: CircleRadius, options?: PathOptions): Circle; export declare function circleMarker(center: LatLngLike, options?: CircleMarkerOptions): CircleMarker; export {}; //# sourceMappingURL=vector.d.ts.map