mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
[leaflet.js] fix typings for Polyline.addLatLng() (#40719)
* [leaflet.js] fix typings for Polyline.addLatLng() * removed comment
This commit is contained in:
parent
dcd8b22cf8
commit
2be9faffbb
3
types/leaflet/index.d.ts
vendored
3
types/leaflet/index.d.ts
vendored
@ -6,6 +6,7 @@
|
||||
// Roni Karilkar <https://github.com/ronikar>
|
||||
// Sandra Frischmuth <https://github.com/sanfrisc>
|
||||
// Vladimir Dashukevich <https://github.com/life777>
|
||||
// Henry Thasler <https://github.com/henrythasler>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@ -986,7 +987,7 @@ export class Polyline<T extends geojson.GeometryObject = geojson.LineString | ge
|
||||
isEmpty(): boolean;
|
||||
getCenter(): LatLng;
|
||||
getBounds(): LatLngBounds;
|
||||
addLatLng(latlng: LatLngExpression | LatLngExpression[]): this;
|
||||
addLatLng(latlng: LatLngExpression | LatLngExpression[], latlngs?: LatLng[]): this;
|
||||
closestLayerPoint(p: Point): Point;
|
||||
|
||||
feature?: geojson.Feature<T, P>;
|
||||
|
||||
@ -592,6 +592,7 @@ const simplePolylineLatLngs: L.LatLngExpression[] = [[45.51, -122.68], [37.77, -
|
||||
polyline = L.polyline(simplePolylineLatLngs);
|
||||
polyline = new L.Polyline(simplePolylineLatLngs);
|
||||
polyline.setLatLngs(simplePolylineLatLngs);
|
||||
polyline.addLatLng([45.51, -122.68]);
|
||||
const simplePolylineLatLngs2: L.LatLng[] = polyline.getLatLngs() as L.LatLng[];
|
||||
|
||||
// multi polyline
|
||||
@ -602,6 +603,8 @@ const multiPolylineLatLngs: L.LatLngExpression[][] = [
|
||||
polyline = L.polyline(multiPolylineLatLngs);
|
||||
polyline = new L.Polyline(multiPolylineLatLngs);
|
||||
polyline.setLatLngs(multiPolylineLatLngs);
|
||||
const segment = polyline.getLatLngs() as L.LatLng[][];
|
||||
polyline.addLatLng([40.78, -73.91], segment[1]);
|
||||
const multiPolylineLatLngs2: L.LatLng[][] = polyline.getLatLngs() as L.LatLng[][];
|
||||
|
||||
const obj1 = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user