Comments (2)
Your correct, I created a fix from outside the library, this gets triggered after onClusteringFishished(). You will need to change slightly to fit your MarkerModel system.
new Thread(new Runnable() {
@Override
public void run() {
ArrayList<ClusterPoint> clusters = mClusterkraf.getClusterPoints();
if (clusters == null){
return;
}
//Get selected item ID (not relying on cluster Library) You need to keep a reference yourself to the selected item
Item selectedItem = getSelectedItem();
if (selectedHotspot==null){
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
//Selected is null hide all
mClusterkraf.hideAllInfoWindows();
}
});
return;
}
ClusterPoint selectedCluster = null;
int markerOffset = 0;
//Find the selected cluster
for (ClusterPoint cluster :clusters){
int size = cluster.size();
//search each point within the cluster
for (int i = 0 ; i < size ; i++){
MapMarkerModel model = (MapMarkerModel) cluster.getPointAtOffset(i).getTag();
//If ID = selected hotspot ID
if (model.uid == selectedItem.getUID()){
selectedCluster = cluster;
//we found it so jump out of this loop
break;
}
}
if (selectedCluster!=null){
break;
}
markerOffset++;
}
final ClusterPoint finalCluster = selectedCluster;
Marker marker;
try{
//get the marker which contains the cluster
marker = mClusterkraf.getMarkers().get(markerOffset);
}catch(Exception e){
return;
}
final Marker finalMarker = marker;
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
//Show info window for this cluster
mClusterkraf.showInfoWindow(finalMarker, finalCluster);
}
});
}
}).start();
Obviously this isn't optimal however it works, make sure to do most of the looping on a background thread to avoid UI pauses.
from clusterkraf.
Seems rather heavy. I might try and figure out an easy way from inside the library to make this work, at some point. So far I have not been successful.
from clusterkraf.
Related Issues (20)
- Add function to Zoom to Bounds when click in Cluster which has Info Window shown already HOT 3
- Android Support Library needs to be updated
- Show ClusteredPoint's Marker on centroid of points
- Clustering on max zoom HOT 5
- Make clustering serializable? HOT 1
- ConcurrentModificationException from multiple add()'s HOT 2
- OnCameraChangeListener available outside the library HOT 3
- Multiple clusters groups HOT 1
- NoClassDefFoundError HOT 3
- Code to interface instead of class HOT 1
- Markers don't always clear
- Add Gradle build support
- Cursor and show tooltip default
- problem of showing clustered icon instead of a single marker icon
- Possibility of multiple Clusterized Icons HOT 1
- Make markers filterable based on title/credential? HOT 3
- Library is having application icon and theme HOT 5
- MapBox support
- Unsupported as v3 supports clustering is not true
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 clusterkraf.