React-leaflet: Leaflet.markercluster support

Created on 18 Jun 2015  路  4Comments  路  Source: PaulLeCam/react-leaflet

I'm interested in using https://github.com/Leaflet/Leaflet.markercluster with react-leaflet. What's the best way to go about this?

Most helpful comment

@treydavis react-leaflet-markercluster looks nice...

All you need to do, it's grab all react-leaflet Markers inside that plugin:

import MarkerClusterGroup from 'react-leaflet-markercluster';

// ...

<MarkerClusterGroup wrapperOptions={{enableDefaultStyle: true}}>
    <Marker position={[49.8397, 24.0297]} />
    <Marker position={[52.2297, 21.0122]} />
    <Marker position={[51.5074, -0.0901]} />
</MarkerClusterGroup>

All 4 comments

You can take a look at the version I created for my geoshare project here.

@troutowicz's example is a good one, you can also have a look at this discussion: https://github.com/PaulLeCam/react-leaflet/issues/37 for more information

@treydavis react-leaflet-markercluster looks nice...

All you need to do, it's grab all react-leaflet Markers inside that plugin:

import MarkerClusterGroup from 'react-leaflet-markercluster';

// ...

<MarkerClusterGroup wrapperOptions={{enableDefaultStyle: true}}>
    <Marker position={[49.8397, 24.0297]} />
    <Marker position={[52.2297, 21.0122]} />
    <Marker position={[51.5074, -0.0901]} />
</MarkerClusterGroup>

@treydavis MarkerClusterGroup does have markers.refreshCluster() is the same functionality available for react?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lambdakris picture lambdakris  路  3Comments

benzen picture benzen  路  4Comments

ballwood picture ballwood  路  5Comments

diligiant picture diligiant  路  3Comments

thenickcox picture thenickcox  路  4Comments