Comments (7)
Original comment by [email protected]
on 18 May 2013 at 4:44
- Added labels: Type-Enhancement
from android-maps-extensions.
Splitting is possible. Just need to disable clustering when hitting certain
zoom level (see code below).
private boolean clusteringEnabled;
in onCameraChange:
if (cameraPosition.zoom > 20.7) {
if (clusteringEnabled) {
map.setClustering(new ClusteringSettings().enabled(false).addMarkersDynamically(true));
clusteringEnabled = false;
}
} else {
if (!clusteringEnabled) {
// your normal clustering settings
clusteringEnabled = true;
}
}
Original comment by [email protected]
on 18 May 2013 at 4:59
from android-maps-extensions.
It wokrs great! Thanks!
Original comment by [email protected]
on 20 May 2013 at 8:45
from android-maps-extensions.
Now it is also possible to achieve spliting a single cluster into markers by
setting different cluster group on each marker (or just -1 in the next release
after 1.5.1).
This was resolved as part of Issue 10.
Original comment by [email protected]
on 25 Aug 2013 at 1:43
- Changed state: FixedNotReleased
from android-maps-extensions.
To split specific cluster use
Marker cluster = ...
for (Marker marker : cluster.getMarkers()) {
marker.setClusterGroup(ClusterGroup.NOT_CLUSTERED);
}
Original comment by [email protected]
on 31 Aug 2013 at 4:06
- Changed state: Fixed
from android-maps-extensions.
Just wanted to point that when using the proposed solution for disabling
clustering when zooming in to a certain zoom level, you may also want to change
this in DelegatingOnCameraChangeListener:
From:
@Override
public void onCameraChange(CameraPosition cameraPosition) {
markerManager.onCameraChange(cameraPosition);
if (onCameraChangeListener != null) {
onCameraChangeListener.onCameraChange(cameraPosition);
}
}
To:
@Override
public void onCameraChange(CameraPosition cameraPosition) {
if (onCameraChangeListener != null) {
onCameraChangeListener.onCameraChange(cameraPosition);
}
markerManager.onCameraChange(cameraPosition);
}
Otherwise, if you zoom out the map very quickly to a very little zoom level
after being in a non-clustered zoom level, first all the markers are drawn to
the map, becoming unresponsive for a while, and later clustering is reapplied.
Original comment by [email protected]
on 29 Dec 2013 at 12:47
from android-maps-extensions.
@#6 eereza
That's a good idea for a custom modification in your code when implementing my
suggestion from comment #2, but I can't do that in the code, because it would
be inconsistent, e.g. when trying to use GoogleMap.getDisplayedMarkers in
onCameraChange, you would get a list of markers before clustering is applied.
If I were to use my #2 suggestion, I would probably add
BeforeCameraChangeListener and make the code look like:
@Override
public void onCameraChange(CameraPosition cameraPosition) {
if (beforeCameraChangeListener != null) {
beforeCameraChangeListener.beforeCameraChange(cameraPosition);
}
markerManager.onCameraChange(cameraPosition);
if (onCameraChangeListener != null) {
onCameraChangeListener.onCameraChange(cameraPosition);
}
}
and put code from #2 into beforeCameraChange... or just hardcode it before
markerManager is called.
Original comment by [email protected]
on 29 Dec 2013 at 10:28
from android-maps-extensions.
Related Issues (20)
- NullPointerException when no IconDataProvider implementation specified HOT 3
- Markers with the same position always appear clustered HOT 3
- IndexOutOfBoundsException om markers remove HOT 1
- Markers are not visible. HOT 7
- cannot use snapshot() method ,how to do screenshot on googlemap v2 HOT 3
- Crashes LazyMarker.java HOT 1
- Crashes LazyMarker.java HOT 8
- Map is unresponsive after adding a lot of markers until suspend/resume HOT 2
- Cluster ClusterMarker if they are very close together HOT 1
- GoogleMap.onMapLoadedCallback() HOT 6
- Swtich to android support library v13 HOT 3
- Extend MapFragment HOT 3
- Restructure project HOT 4
- Inhibit clustering of marker HOT 1
- NPE in calculateDistanceBetweenMarkers() HOT 2
- Draw text on markers in onCameraChange HOT 3
- Make this library work with the Google Maps for Business SDK HOT 1
- IllegalArgumentException when try to execute marker.setIcon in the onMarkerClick callback HOT 12
- getMarkers() getting different results HOT 1
- Google maps extensions does not find fragment R.id.map
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 android-maps-extensions.