twotoasters / clusterkraf Goto Github PK
View Code? Open in Web Editor NEWA clustering library for the Google Maps Android API v2
License: Apache License 2.0
A clustering library for the Google Maps Android API v2
License: Apache License 2.0
Hi,
Any plans to support MapBox integration?
Thanks
Either no loading spinner is shown at all, or the loading spinner is only visible very briefly (substantially less than one second)
The loading spinner is shown forever, or until the camera position is changed
OK, let me describe step by step how to archive it.
In advanced mode
Thank you for great mapping cluster library.
I have two pins really near to each other and I set a bit larger "distance to join cluster". Than I tap on a cluster consisting of these two pins. It zooms, but pins stay clustered. It would be great that when zoom reaches max level, all clusters would be expanded.
java.lang.NullPointerException
at android.graphics.Bitmap.copy(Bitmap.java:400)
at com.twotoasters.clusterkraf.sample.ToastedMarkerOptionsChooser.getClusterBitmap(ToastedMarkerOptionsChooser.java:95)
at com.twotoasters.clusterkraf.sample.ToastedMarkerOptionsChooser.choose(ToastedMarkerOptionsChooser.java:67)
at com.twotoasters.clusterkraf.ClusterTransitionsAnimation.addMarker(ClusterTransitionsAnimation.java:243)
at com.twotoasters.clusterkraf.ClusterTransitionsAnimation.onAnimationStart(ClusterTransitionsAnimation.java:201)
at com.nineoldandroids.animation.ValueAnimator.start(ValueAnimator.java:937)
at com.nineoldandroids.animation.ValueAnimator.start(ValueAnimator.java:951)
at com.nineoldandroids.animation.ObjectAnimator.start(ObjectAnimator.java:385)
at com.twotoasters.clusterkraf.ClusterTransitionsAnimation.animate(ClusterTransitionsAnimation.java:52)
at com.twotoasters.clusterkraf.Clusterkraf.transitionClusters(Clusterkraf.java:175)
at com.twotoasters.clusterkraf.Clusterkraf.access$16(Clusterkraf.java:173)
at com.twotoasters.clusterkraf.Clusterkraf$ClusterTransitionsBuildingTaskHost.onClusterTransitionsBuildingTaskPostExecute(Clusterkraf.java:506)
at com.twotoasters.clusterkraf.ClusterTransitionsBuildingTask.onPostExecute(ClusterTransitionsBuildingTask.java:53)
at com.twotoasters.clusterkraf.ClusterTransitionsBuildingTask.onPostExecute(ClusterTransitionsBuildingTask.java:1)
at android.os.AsyncTask.finish(AsyncTask.java:417)
at android.os.AsyncTask.access$300(AsyncTask.java:127)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4914)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Is there any ability to filter the markers currently being shown? I need to filter the markers that are shown/clustered, with the ability to also remove that filter and show every marker. Is that possible in the library? I tried to add a delete method to the library in order to remove markers from the clusters (to go in hand with the add method), but the clustering didn't seem to update at all.
I got the project running with Android Studio but it seems there are some references missing :
java.lang.NoClassDefFoundError: com.twotoasters.clusterkraf.ClusterTransitionsAnimation
at com.twotoasters.clusterkraf.Clusterkraf.(Clusterkraf.java:56)
My build.gradle file
apply plugin: 'android-library'
repositories {
mavenCentral()
}
dependencies {
compile group: 'com.google.android.gms', name: 'play-services', version: '3.1.36'
compile files('libs/nineoldandroids-2.4.0.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
Would be great to get some Feedback :)
Hi,
My question is about the possibility of multiple icons in clusters, based on data.
Example: I have POI -s on map, base on it's types it can have different types of icons. But I couldn't find out how to do that in ClusterKraf. As I know we can customise the icon in overrided "choose" function in extended MarkerOptionsChooser. But there I do not have which POI is under customisation. InputPoints can be only reached by index, cannot get the container array list itself, so if i iterate it with index (getInputPointAtOffset(index)) it can easily overrun. I have no other idea how to get current InputPoint, which can hold the type of the input point.
Thanks,
peter
Hi,
I just tried to add this library to my project which has more than two thousands markers and it works good except that when I zoom to see my single markers outside of the clusters, it shows the single marker but it seem that it still is inside the cluster and shows the clustered icon and also '2' number on the icon which indicates it has 2 markers but I'm sure it is just one marker.
Do you have any clue why this may happen ?
Thanks in advance
Instead of showing the ClusteredPoint's marker on the initialPoint's location, it would be nice to show it on the centroid of the collective points.
I'm trying to implement X different clusters which are loaded asynchronously, i'm doing it fine so far but i just encountered a problem with the Cluster click animation behavior. When the first category cluster is loaded on map the click listener works fine but when i add two different categories the animation binds only on the first while the second stop working properly
Readme says not to use and is no longer supported as v3 has clustering support. This is not true, there is no V3 for Android.
Also worth mentioning that google does have a utility lib to support clustering, it is however crazy slow.
I need to set OnCameraChangeListener on map, which is currently impossible without changing the library internals.
You should make it available to set a custom listener in Options.
As the main application will already have application icon and theme in place. While building the app fails with following
Error:(39, 9) Attribute application@icon value=(@drawable/launcher_icon) from AndroidManifest.xml:39:9
Error:(41, 9) Attribute application@theme value=(@style/Theme.rctheme) from AndroidManifest.xml:41:9
is also present at com.twotoasters.clusterkraf:library:1.0.2:5:115 value=(@style/AppTheme)
Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:37:5 to override
Error:Execution failed for task ':handset:processDebugManifest'.
Manifest merger failed with multiple errors, see logs
Possible Resolution
replace the manifest
current one
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
</application>
new one
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
I noticed that calling clear on Clusterkraf doesn't always clear the markers. This behavior is observed on 2.33 device.
Clusterkraf ctor and addAll method unnecessarily require a ArrayList instead of just a Collection.
Hello
I use this library and it is really great.
I have not found a way to initialize default cursors to display a tooltip with showInfoWindow() method
Is there the possibility to do so?
Thank you in advance,
It seems that a cluster transition is started whenever the map is panned, regardless of whether clusters need to be transitioned, leading to a call to clusterkaf.removePreviousMarkers() which removes the markers. This means that if someone clicks on a marker to show its info-window, and then tries to pan the map to see more of the info-window, the info-window will dissapear.
I've been looking at trying to fix this issue. I'm not sure it's an easy one. So I'm reporting it.
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:299)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
at java.util.concurrent.FutureTask.run(FutureTask.java:239)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)
Caused by: java.util.ConcurrentModificationException
at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:569)
at com.twotoasters.clusterkraf.ClustersBuilder.addAll(ClustersBuilder.java:54)
at com.twotoasters.clusterkraf.ClusteringTask.doInBackground(ClusteringTask.java:34)
at com.twotoasters.clusterkraf.ClusteringTask.doInBackground(ClusteringTask.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
... 3 more
Hi great work on this project - I really like it. I was just wondering in order to avoid recalculating clusters each time the map is initialised could the clusters be serialized in some manner? I'm working on a app that has over 4K locations and the calculation of the initial clusters means it can take over 30 seconds for anything to appear on the map.
I'm thinking this is from calling add() multiple times back to back... instead of using addAll()
java.util.ConcurrentModificationException
at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:569)
at com.twotoasters.clusterkraf.ClustersBuilder.addAll(ClustersBuilder.java:54)
at com.twotoasters.clusterkraf.ClusteringTask.doInBackground(ClusteringTask.java:34)
at com.twotoasters.clusterkraf.ClusteringTask.doInBackground(ClusteringTask.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.