Comments (13)
Sounds reasonable.
To make it more general such an interface can be introduced:
interface ClusterGrouper {
int getClusterGroup(Marker marker);
}
When implemented and added to ClusteringSettings its method is called when
Marker is added and returned value indicates the group in which markers are
clustered together. Negative value indicates it shouldn't be clustered at all.
Any improvements to this API?
Original comment by [email protected]
on 17 Apr 2013 at 3:25
- Changed state: Accepted
- Added labels: Type-Enhancement
from android-maps-extensions.
Or simply setClusterGroup() directly on the Marker class.
I also found that possible workaround is simpy use getMap().addMarker().
Original comment by [email protected]
on 18 Apr 2013 at 12:17
from android-maps-extensions.
Yes. That's a good workaround.
setClusterGroup would imply changing group is possible. If that is useful,
probably should be added to MarkerOptions too. Any thought on when would it be
useful to change that?
Original comment by [email protected]
on 18 Apr 2013 at 12:40
from android-maps-extensions.
You have right. So. What about add it only to MarkerOptions, because it is not
necessary change it after was added. MarkerOptions is used only to build new
marker.
Original comment by [email protected]
on 18 Apr 2013 at 2:17
from android-maps-extensions.
After thinking about this for a bit, I believe changing clustering group can be
very useful.
For example one could have marker appearing from top of the screen to target
location (like this:
http://stackoverflow.com/questions/16604206/drop-marker-slowly-from-top-of-scree
n-to-location-on-android-map-v2) and during this animation marker would not be
clustered, but after animation ends it joins cluster.
Original comment by [email protected]
on 22 May 2013 at 8:52
from android-maps-extensions.
Can u please provide some detailed explanation or procedure.I didnt get how to
avoid a marker from getting clustered.I tried with the code mentioned in first
comment.I created an interface in clustering settings.And I overrided the
method in that interface in newly created class by implementing
clusterGrouper.I passed the marker which I want,not to be clustered as an
argument in the constructor of the class and comapred the marker passed from
the constructor with the marker from overrided method.If they were the same
then I passed a negative value else returned some positive value.
Please help me with this code
import pl.mg6.android.maps.extensions.ClusteringSettings.ClusterGrouper;
import pl.mg6.android.maps.extensions.Marker;
public class ImplementClusterGrouper implements ClusterGrouper {
Marker mainmarker;
public ImplementClusterGrouper(Marker mark) {
// TODO Auto-generated constructor stub
mainmarker=mark;
}
@Override
public int getClusterGroup(Marker marker) {
// TODO Auto-generated method stub
if(marker==mainmarker){
return -1;
}
else{
return marker.getMarkers().size();
}
}
}
Original comment by [email protected]
on 9 Jun 2013 at 11:16
from android-maps-extensions.
This is not yet implemented with such an interface.
A workaround for now is to use getMap().addMarker() instead of getExtendedMap()
on SupportMapFragment or MapView.
This will work ok for a single marker, but can be problematic for more, because
you will get null Marker in onMarkerClick, onInfoWindowClick and other
callbacks.
Original comment by [email protected]
on 9 Jun 2013 at 12:10
from android-maps-extensions.
Issue 19 has been merged into this issue.
Original comment by [email protected]
on 13 Jun 2013 at 5:52
from android-maps-extensions.
[deleted comment]
from android-maps-extensions.
Issue 22 has been merged into this issue.
Original comment by [email protected]
on 21 Jun 2013 at 10:08
from android-maps-extensions.
Hello everybody,
I have just pushed few commits that resolve this issue into develop branch.
If you don't use git, you may get it from:
https://github.com/mg6maciej/android-maps-extensions/archive/develop.zip
The function added is Marker.setClusterGroup(int) like suggested by Tomas at
the beginning.
Check out ClusterGroupsActivity.java in demo for a simple example and let me
know how it works for you if you integrate it in your apps.
Original comment by [email protected]
on 9 Aug 2013 at 8:21
- Changed state: FixedNotReleased
from android-maps-extensions.
Original comment by [email protected]
on 12 Aug 2013 at 1:07
- Changed state: Fixed
from android-maps-extensions.
Issue 39 has been merged into this issue.
Original comment by [email protected]
on 4 Dec 2013 at 6:22
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.