Skip to content

Commit

Permalink
Leaflet markercluster update (DefinitelyTyped#9672)
Browse files Browse the repository at this point in the history
* maxClusterRadius can be a function

* Add chunk parameters
Add zoomToShowLayer function

* typescript class should have a 'constructor' function not 'initialize' function

* forgot newline

* fix the tests
  • Loading branch information
hagai26 authored and vvakame committed Jun 19, 2016
1 parent b50ccc2 commit b8c3b83
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions leaflet-markercluster/leaflet-markercluster.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ declare namespace L {

/*
* The maximum radius that a cluster will cover from the central marker (in pixels). Default 80.
* Decreasing will make more, smaller clusters.
* Decreasing will make more, smaller clusters. You can also use a function that accepts
* the current map zoom and returns the maximum cluster radius in pixels
*/
maxClusterRadius?: number;
maxClusterRadius?: number | ((zoom: number) => number);

/*
* Options to pass when creating the L.Polygon(points, options) to show the bounds of a cluster.
Expand Down Expand Up @@ -82,11 +83,21 @@ declare namespace L {
* Function used to create the cluster icon
*/
iconCreateFunction?: any;

/*
* Boolean to split the addLayers processing in to small intervals so that the page does not freeze.
*/
chunkedLoading?: boolean;

/*
* Time delay (in ms) between consecutive periods of processing for addLayers. Default to 50ms.
*/
chunkDelay?: number;
}

export class MarkerClusterGroup extends FeatureGroup<ILayer> {
initialize(): void;
initialize(options: MarkerClusterGroupOptions): void;
constructor();
constructor(options: MarkerClusterGroupOptions);

/*
* Bulk methods for adding and removing markers and should be favoured over the
Expand Down Expand Up @@ -121,5 +132,11 @@ declare namespace L {
* Returns the array of total markers contained within that cluster.
*/
getAllChildMarkers(): Marker[];

/*
* Zooms to show the given marker (spiderfying if required),
* calls the callback when the marker is visible on the map.
*/
zoomToShowLayer(layer: any, callback: () => void): void;
}
}

0 comments on commit b8c3b83

Please sign in to comment.