Coder Social home page Coder Social logo

Comments (11)

craig8two avatar craig8two commented on May 23, 2024 5

This would be an extremely useful feature.

from react-native-map-clustering.

thanhluantl2304 avatar thanhluantl2304 commented on May 23, 2024 3

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.

venits avatar venits commented on May 23, 2024 2

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.

Jacob-Allen avatar Jacob-Allen commented on May 23, 2024

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.

bl0ck3man avatar bl0ck3man commented on May 23, 2024

Same situation. Is there an example of using several clusters with different datasets.

from react-native-map-clustering.

venits avatar venits commented on May 23, 2024

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.

bl0ck3man avatar bl0ck3man commented on May 23, 2024

@venits
Hi. It was 6 months ago. If nobody didn't release it then, that situation is still alive.

from react-native-map-clustering.

venits avatar venits commented on May 23, 2024

@blac3kman Hmm ok I will add this prop in free time and prepare some example code 💪

from react-native-map-clustering.

bl0ck3man avatar bl0ck3man commented on May 23, 2024

@venits Oh thanks man=)) It's great to read it!

from react-native-map-clustering.

craig8two avatar craig8two commented on May 23, 2024

+1

from react-native-map-clustering.

alexis-regnaud avatar alexis-regnaud commented on May 23, 2024

Is there any solution for that one ?

from react-native-map-clustering.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.