Comments (11)
This would be an extremely useful feature.
from react-native-map-clustering.
That should not be closed. I want to group by markers's type. But the superCluster was automatically group any markers. renderCluster can not solve it. Please give me the solution!
from react-native-map-clustering.
I added new prop called renderCluster that allows you to control logic and style of cluster.
Upgrade module to version "3.0.3".
Here is code example of how it works:
const renderCluster = cluster => {
const { id, geometry, onPress, properties } = cluster;
const points = properties.point_count;
return (
<Marker
key={`cluster-${id}`}
coordinate={{
longitude: geometry.coordinates[0],
latitude: geometry.coordinates[1]
}}
onPress={onPress}
>
<View>
<Text>{points}</Text>
</View>
</Marker>
);
};
return (
<MapView
renderCluster={renderCluster}
>
// markers
</MapView>
);
I don't know it will fully solve this problem but at least it gives some control over clustering logic.
I don't want to add grouping clusters by type because it will take a lot of code and I want to maintain my codebase clear and easy.
I would personally recommend forking this repo and adding types on your own. It should be quite easy :) If any one has problems with setting it up, please contact me and we will figure something out together 💪
from react-native-map-clustering.
I am interested in this as well. Did you ever solve getting different data sets to cluster independently from one another?
from react-native-map-clustering.
Same situation. Is there an example of using several clusters with different datasets.
from react-native-map-clustering.
Hmm is this issue still relevant?
It could be handled by additional prop renderCluster but it will require you to write whole cluster view from scratch.
On the other hand you will have full control over cluster logic.
Let me know if that is still needed.
from react-native-map-clustering.
@venits
Hi. It was 6 months ago. If nobody didn't release it then, that situation is still alive.
from react-native-map-clustering.
@blac3kman Hmm ok I will add this prop in free time and prepare some example code 💪
from react-native-map-clustering.
@venits Oh thanks man=)) It's great to read it!
from react-native-map-clustering.
+1
from react-native-map-clustering.
Is there any solution for that one ?
from react-native-map-clustering.
Related Issues (20)
- onRegionChangeComplete wrong second parameter HOT 2
- `mapRef` typing is not accurate HOT 2
- Click on cluster doesn't zoom in and show markers HOT 4
- How to change cluster border? HOT 3
- react-native-map-clustering can not cluster with child component HOT 2
- On iOS, after pressing a cluster and zooming the first time, pressing a marker shows it and then quickly hides it HOT 1
- is there a way to get any meta data from the original data in a cluster? HOT 2
- is there a way to dynamically set calster=false to exclude a specific marker from the cluster without breaking the library logic?
- animationEnabled not working HOT 2
- Map Data is not stable on zoom in/out, Incorrect data showing using react-native-map-clustering HOT 2
- On iOS, the app freezes when I use modal
- RNMaps beta support
- On Android, this library is not optimized HOT 3
- Android crash on latest Expo HOT 1
- Marker are hidden until i move the map HOT 10
- clustering on Apple maps does not render all markers
- when we zoom on markers then we are seeing some red lines HOT 3
- Enable `spiralEnabled` without enabling `clusteringEnabled`
- Clicking on the cluster zooms to the wrong location
- Inconsistency in Cluster Rendering between Google and Apple maps in react-native-map-clustering HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-map-clustering.