mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #22330 from indoorway/add-LineUtil-isFlat
Add isFlat definition to Leaflet LineUtil + fix linter errors
This commit is contained in:
Vendored
+1
-4
@@ -18,18 +18,15 @@ export class Class {
|
||||
|
||||
export class Transformation {
|
||||
constructor(a: number, b: number, c: number, d: number);
|
||||
|
||||
transform(point: Point, scale?: number): Point;
|
||||
|
||||
untransform(point: Point, scale?: number): Point;
|
||||
}
|
||||
|
||||
export namespace LineUtil {
|
||||
function simplify(points: Point[], tolerance: number): Point[];
|
||||
|
||||
function pointToSegmentDistance(p: Point, p1: Point, p2: Point): number;
|
||||
|
||||
function closestPointOnSegment(p: Point, p1: Point, p2: Point): Point;
|
||||
function isFlat(latlngs: LatLngExpression[]): boolean;
|
||||
}
|
||||
|
||||
export namespace PolyUtil {
|
||||
|
||||
Vendored
+4
-1
@@ -42,7 +42,7 @@ declare module 'leaflet' {
|
||||
|
||||
class GeoJSON extends L.GeoJSON {}
|
||||
|
||||
const geoJson: (geojson?: geojson.GeoJsonObject, options?: GeoJSONOptions) => GeoJSON;
|
||||
const geoJson: (geojson?: Proj4GeoJSONFeature, options?: GeoJSONOptions) => GeoJSON;
|
||||
|
||||
class ImageOverlay extends L.ImageOverlay {}
|
||||
|
||||
@@ -57,3 +57,6 @@ declare module 'leaflet' {
|
||||
}
|
||||
}
|
||||
}
|
||||
export type Proj4GeoJSONFeature = geojson.Feature<geojson.GeometryObject> & {
|
||||
crs?: { type: string; properties: { name: string } }
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as L from 'leaflet';
|
||||
import 'proj4leaflet';
|
||||
|
||||
import * as proj4leaflet from "proj4leaflet";
|
||||
import * as proj4 from 'proj4';
|
||||
|
||||
import LatLngBoundsExpression = L.LatLngBoundsExpression;
|
||||
@@ -43,12 +42,13 @@ const crs3 = new L.Proj.CRS('EPSG:3006',
|
||||
// geoJson
|
||||
proj4.defs("urn:ogc:def:crs:EPSG::26915", "+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs");
|
||||
|
||||
const geojson = {
|
||||
const geojson: proj4leaflet.Proj4GeoJSONFeature = {
|
||||
type: "Feature",
|
||||
geometry: {
|
||||
type: "Point",
|
||||
coordinates: [481650, 4980105]
|
||||
},
|
||||
properties: {},
|
||||
crs: {
|
||||
type: "name",
|
||||
properties: {
|
||||
|
||||
Reference in New Issue
Block a user