Merge pull request #22330 from indoorway/add-LineUtil-isFlat

Add isFlat definition to Leaflet LineUtil + fix linter errors
This commit is contained in:
Paul van Brenk
2017-12-28 11:53:08 -08:00
committed by GitHub
3 changed files with 8 additions and 8 deletions
+1 -4
View File
@@ -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 {
+4 -1
View File
@@ -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 } }
};
+3 -3
View File
@@ -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: {