Merge pull request #30665 from Kimahriman/react-leaflet-markercluster

Added types for react-leaflet-markercluster
This commit is contained in:
Benjamin Lichtman
2018-11-21 21:12:52 -08:00
committed by GitHub
4 changed files with 68 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for react-leaflet-markercluster 2.0
// Project: https://github.com/YUzhva/react-leaflet-markercluster
// Definitions by: Adam Binford <https://github.com/Kimahriman>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
/// <reference types="leaflet.markercluster" />
import * as Leaflet from 'leaflet';
import * as ReactLeaflet from 'react-leaflet';
export type MarkerClusterGroupProps = ReactLeaflet.MapLayerProps & Leaflet.MarkerClusterGroupOptions;
export default class MarkerClusterGroup<P extends MarkerClusterGroupProps = MarkerClusterGroupProps> extends ReactLeaflet.MapLayer<P> { }
@@ -0,0 +1,30 @@
import * as React from 'react';
import * as Leaflet from 'leaflet';
import MarkerClusterGroup from 'react-leaflet-markercluster';
const MarkerCluster = (
<MarkerClusterGroup
showCoverageOnHover
zoomToBoundsOnClick
spiderfyOnMaxZoom
removeOutsideVisibleBounds
animate
animateAddingMarkers
singleMarkerMode
chunkedLoading
chunkDelay={ 500 }
disableClusteringAtZoom={ 4 }
maxClusterRadius={ 0 }
spiderfyDistanceMultiplier={ 2 }
polygonOptions={ {
stroke: true,
color: 'blue',
opacity: 0.5
} }
spiderLegPolylineOptions={ {
stroke: true,
color: 'blue',
opacity: 0.5
} }
iconCreateFunction={ cluster => Leaflet.divIcon({ html: `<b>${cluster.getChildCount()}</b>` }) }/>
);
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"jsx": "react",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"react-leaflet-markercluster-tests.tsx"
]
}
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }