leaflet
Version:
JavaScript library for mobile-friendly interactive maps
40 lines (39 loc) • 1.66 kB
TypeScript
import { LatLng } from '../geo/LatLng.js';
import type { Feature, FeatureCollection, GeoJsonObject, Geometry, Point, Position } from 'geojson';
import type { LatLngExpression, NestedCoords } from '../types.js';
/** @import {Feature, FeatureCollection, GeoJsonObject, Geometry, Point, Position} from 'geojson' */
/** @import {LatLngExpression, NestedCoords} from '../types.js' */
/**
* @param {LatLngExpression} latlng
* @param {number | false} [precision]
* @returns {Position}
*/
export declare function latLngToCoords(latlng: LatLngExpression, precision?: number | false): Position;
/**
* @param {NestedCoords<LatLngExpression>} latlngs
* @param {number} [levelsDeep]
* @param {boolean} [close]
* @param {number | false} [precision]
* @returns {NestedCoords<Position>}
*/
export declare function latLngsToCoords(latlngs: NestedCoords<LatLngExpression>, levelsDeep?: number, close?: boolean, precision?: number | false): NestedCoords<Position>;
/**
* @template {Geometry} G
* @param {{feature?: Feature}} layer
* @param {G} newGeometry
* @returns {Feature<G>}
*/
export declare function getFeature<G extends Geometry>(layer: {
feature?: Feature;
}, newGeometry: G): Feature<G>;
export declare function asFeature<G extends Geometry>(geojson: G | Feature<G>): Feature<G>;
export declare function asFeature(geojson: GeoJsonObject): Feature | FeatureCollection;
/**
* @param {{feature?: Feature, getLatLng(): LatLng}} layer
* @param {number | false} [precision]
* @returns {Feature<Point>}
*/
export declare function pointToGeoJSON(layer: {
feature?: Feature;
getLatLng(): LatLng;
}, precision?: number | false): Feature<Point>;