Skip to content

Commit ea53c3b

Browse files
Merge pull request DefinitelyTyped#30665 from Kimahriman/react-leaflet-markercluster
Added types for react-leaflet-markercluster
2 parents 9414e3c + 8734181 commit ea53c3b

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Type definitions for react-leaflet-markercluster 2.0
2+
// Project: https://github.com/YUzhva/react-leaflet-markercluster
3+
// Definitions by: Adam Binford <https://github.com/Kimahriman>
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
// TypeScript Version: 2.8
6+
7+
/// <reference types="leaflet.markercluster" />
8+
import * as Leaflet from 'leaflet';
9+
import * as ReactLeaflet from 'react-leaflet';
10+
11+
export type MarkerClusterGroupProps = ReactLeaflet.MapLayerProps & Leaflet.MarkerClusterGroupOptions;
12+
13+
export default class MarkerClusterGroup<P extends MarkerClusterGroupProps = MarkerClusterGroupProps> extends ReactLeaflet.MapLayer<P> { }
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import * as React from 'react';
2+
import * as Leaflet from 'leaflet';
3+
import MarkerClusterGroup from 'react-leaflet-markercluster';
4+
5+
const MarkerCluster = (
6+
<MarkerClusterGroup
7+
showCoverageOnHover
8+
zoomToBoundsOnClick
9+
spiderfyOnMaxZoom
10+
removeOutsideVisibleBounds
11+
animate
12+
animateAddingMarkers
13+
singleMarkerMode
14+
chunkedLoading
15+
chunkDelay={ 500 }
16+
disableClusteringAtZoom={ 4 }
17+
maxClusterRadius={ 0 }
18+
spiderfyDistanceMultiplier={ 2 }
19+
polygonOptions={ {
20+
stroke: true,
21+
color: 'blue',
22+
opacity: 0.5
23+
} }
24+
spiderLegPolylineOptions={ {
25+
stroke: true,
26+
color: 'blue',
27+
opacity: 0.5
28+
} }
29+
iconCreateFunction={ cluster => Leaflet.divIcon({ html: `<b>${cluster.getChildCount()}</b>` }) }/>
30+
);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"lib": [
5+
"es6"
6+
],
7+
"noImplicitAny": true,
8+
"noImplicitThis": true,
9+
"strictNullChecks": true,
10+
"strictFunctionTypes": true,
11+
"baseUrl": "../",
12+
"jsx": "react",
13+
"typeRoots": [
14+
"../"
15+
],
16+
"types": [],
17+
"noEmit": true,
18+
"forceConsistentCasingInFileNames": true
19+
},
20+
"files": [
21+
"index.d.ts",
22+
"react-leaflet-markercluster-tests.tsx"
23+
]
24+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "extends": "dtslint/dt.json" }

0 commit comments

Comments
 (0)