Code Monkey home page Code Monkey logo

clusterer's People

Contributors

haocherhong avatar intrications avatar mrmans0n avatar quentin23soleil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

clusterer's Issues

The cluster gone after update data

Hello,
i m using your library in my project and when the camera of my cluster change position, i made an update of data and i draw again my cluster but sometimes the cluster gone with no reason

Crash when adding a POI

My app displays a map, and it dynamically loads the POIs as the user browses/scrolls the map.
Then if it checks if the POIs in the result list are already in the map or not. If not, add them to the map:

// Class vars
private ArrayList<MyPoi> markerList;
private Clusterer<MyPoi> clusterer;

// ...

clusterer = new Clusterer<MyPoi>(this, googleMap);
clusterer.setOnCameraChangeListener(new Clusterer.OnCameraChangeListener() {
    @Override
    public void onCameraChange(CameraPosition cameraPosition) {
        // Async call API to get POI
        call(new Handler<List<MyPoi>>() {
            @Override
            public void handle(List<MyPoi> result) {
                // Run this when call is done

                // For each POI in the POI list
                for (MyPoi poi : result) {
                    // Check if POI is not in the map already
                    boolean newMarker = true;
                    for (Clusterable marker : markerList) {
                        if (marker.getPosition().equals(poi.getPosition())) {
                            newMarker = false;
                            break;
                        }
                    }

                    // Add POI to map if new
                    if (newMarker) {
                        markerList.add(poi);
                        clusterer.add(poi); // Crash here!
                    }
                }
            }
        });
    }
});

However, the app crashes when I try to add the POI (see the commented line).
This is what the Logcat registers: https://gist.github.com/anonymous/e5c5314ed91d8f52cd9c
The message is truncated at the end, and then the app restarts.

I am using version 1.0.2, tested on a device and Genymotion emulator.

Execution failed for task ':app:dexDebug'

hi, i'm trying to use your library but when i add compile 'io.nlopez.clusterer:library:1.0.5' in my build.gradle file, i got this error:

Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

In the dependencies i have only this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.0.0'
compile 'io.nlopez.clusterer:library:1.0.5'

}

Have you please have a fix for that error?

Regards

Stackoverflow error on basic lib setup

I followed the guide in the readme.md and get a stackoverflow error in the lib when using it:

   java.lang.StackOverflowError
            at io.nlopez.clusterer.QuadTree.insertData(QuadTree.java:23)
            at io.nlopez.clusterer.QuadTree.insertData(QuadTree.java:23)
            at io.nlopez.clusterer.QuadTree.insertData(QuadTree.java:23)
            at io.nlopez.clusterer.QuadTree.insertData(QuadTree.java:23)
            at io.nlopez.clusterer.QuadTree.insertData(QuadTree.java:23)
            at io.nlopez.clusterer.QuadTree.insertData(QuadTree.java:23)

Clustering on max zoom

For some reason library is clustering markers even on max zoom. It's will be great if you add some threshold param that we can set when initing Clusterer.

Method addAll in Clusterer

It will be more logical if you replace this implementation

    public void addAll(List<T> markers) {
        this.markers = markers;
    }

to this one

    public void addAll(List<T> markers) {
        this.markers.addAll(markers);
    }

Remove default custom marker and control zoom of map

Hi, i was able to use your library and create in my android maps application the Cluster, everything works like a charm, thanks.

I trieed then to customize the icon of each markers, using my own icons added in the map, but i have two problems:
1- When zoom in the map and show each marker, behind my own icon appears the default icon of GMaps marker, and i don't know how to hide it in the code (because i haven't added somewhere).

2- When i zoom out the map, and the cluster start to group the markers, my own icons stay visible. (if i don't add my own icons everything works).

Does anyone know how to fix this problems?

Add some rules/number of items before cluster

Feature request again.
Adding some number threshold before the markers are clustered would be interesting. "If I have only 2 markers, then don't cluster. Cluster only when I have more than 5" something like that.

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.