mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Leaflet: Polygon Constructor with Multi-Dimensional Array (#18260)
This commit is contained in:
parent
2b0f00ff27
commit
b50f4e4556
4
types/leaflet/index.d.ts
vendored
4
types/leaflet/index.d.ts
vendored
@ -615,13 +615,13 @@ declare namespace L {
|
||||
function polyline(latlngs: LatLngExpression[], options?: PolylineOptions): Polyline;
|
||||
|
||||
class Polygon extends InternalPolyline {
|
||||
constructor(latlngs: LatLngExpression[], options?: PolylineOptions);
|
||||
constructor(latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions);
|
||||
toGeoJSON(): GeoJSONFeature<GeoJSONPolygon | GeoJSONMultiPolygon>;
|
||||
|
||||
feature?: GeoJSONFeature<GeoJSONPolygon | GeoJSONMultiPolygon>;
|
||||
}
|
||||
|
||||
function polygon(latlngs: LatLngExpression[], options?: PolylineOptions): Polygon;
|
||||
function polygon(latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions): Polygon;
|
||||
|
||||
class Rectangle extends Polygon {
|
||||
constructor(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions);
|
||||
|
||||
@ -450,6 +450,16 @@ L.marker([1, 2], {
|
||||
className: 'my-div-icon'
|
||||
}));
|
||||
|
||||
const latLngs = [
|
||||
{ lat: 0, lng: 0 },
|
||||
{ lat: 1, lng: 1 }
|
||||
];
|
||||
let polygon = new L.Polygon(latLngs);
|
||||
let polygonExclusion = new L.Polygon([latLngs, latLngs]);
|
||||
|
||||
L.polygon(latLngs).addTo(map);
|
||||
L.polygon([latLngs, latLngs]).addTo(map);
|
||||
|
||||
L.Util.extend({});
|
||||
L.Util.create({});
|
||||
L.Util.bind(() => {}, {});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user