Coder Social home page Coder Social logo

Comments (13)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
Issue 19 has been merged into this issue.

Original comment by [email protected] on 13 Jun 2013 at 5:52

from android-maps-extensions.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
[deleted comment]

from android-maps-extensions.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
Issue 22 has been merged into this issue.

Original comment by [email protected] on 21 Jun 2013 at 10:08

from android-maps-extensions.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024

Original comment by [email protected] on 12 Aug 2013 at 1:07

  • Changed state: Fixed

from android-maps-extensions.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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)

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.