Repository navigation
Marker Cluster Plugin - #49
Conversation
zugaldia
left a comment
There was a problem hiding this comment.
Just small notes. I realize there're a bunch of TODO and UNSUPPORTED that probably come from the original library. I'd check which ones are worth ticketing. Otherwise, let's at least add a note saying something like "This TODO item was part of the original library (http://...), we welcome contributions if you want to work on it. See https://github.com/mapbox/mapbox-plugins-android#contributing for details."
| compile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.0-beta.3@aar') { | ||
| transitive = true | ||
| } | ||
| // javadocDeps 'com.mapbox.mapboxsdk:mapbox-android-sdk:5.0.2' |
There was a problem hiding this comment.
Was this left commented on purpose? Should we remove it instead?
There was a problem hiding this comment.
This setup was copied from the traffic plugin and will be required for release. Since there is a need for a final 5.1.0 of the map SDK (dependency on new OnCameraIdle API). I would leave this untouched until the release of this plugin.
| package="com.mapbox.mapboxsdk.plugins.cluster" | ||
| > | ||
|
|
||
| <application android:allowBackup="true" |
There was a problem hiding this comment.
I believe we can remove the application tag from here.
| import java.util.Map; | ||
| import java.util.Set; | ||
|
|
||
| // TODO: add OnMarkerDragListener |
There was a problem hiding this comment.
| } | ||
|
|
||
| private Bounds createBoundsFromSpan(Point p, double span) { | ||
| // TODO: Use a span that takes into account the visual size of the marker, not just its |
There was a problem hiding this comment.
This is a todo from the original implementation
|
|
||
| private final Algorithm<T> algorithm; | ||
|
|
||
| // TODO: evaluate maxSize parameter for LruCache. |
There was a problem hiding this comment.
this is a todo from the original implementation
| * | ||
| * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
| */ | ||
| public class ExampleUnitTest { |
There was a problem hiding this comment.
Looks like we can remove this file.
|
|
||
| final Set<MarkerWithPosition> markersToRemove = markers; | ||
| final LatLngBounds visibleBounds = mProjection.getVisibleRegion().latLngBounds; | ||
| // TODO: Add some padding, so that markers can animate in from off-screen. |
There was a problem hiding this comment.
this is a todo from the original implementation
| for (final MarkerWithPosition marker : markersToRemove) { | ||
| boolean onScreen = visibleBounds.contains(marker.position); | ||
| // Don't animate when zooming out more than 3 zoom levels. | ||
| // TODO: drop animation based on speed of device & number of markers to animate. |
There was a problem hiding this comment.
this is a todo from the original implementation
| return null; | ||
| } | ||
|
|
||
| // TODO: make this configurable. |
There was a problem hiding this comment.
this is a todo from the original implementation
| private static final TimeInterpolator ANIMATION_INTERP = new DecelerateInterpolator(); | ||
|
|
||
| /** | ||
| * Animates a markerWithPosition from one position to another. TODO: improve performance for |
There was a problem hiding this comment.
this is a todo from the original implementation
|
@zugaldia I was able to make the code work with a configurable flag for MarkerView though the performance wasn't great. I'm thinking on punting on Markers as we aim to deprecate MarkerView in upcoming releases in mapbox/mapbox-gl-native#9365. |
|
Small issue with this plugin is there is no option to disable clustering at certain zoom level, say we need to plot 5 markers in 5 mtrs radius even at last zoom level we are not able to see all markers. Is there any workaround for this? |
👍 on reducing the scope to markers for now. |
a06a718 to
6bcfc42
Compare
|
Is there a timeframe on getting this PR merged? I'm currently in the process of migrating from Google Maps and this is one of the main features missing on MapBox for my usage. |
cace667 to
167d01c
Compare
|
@simon-the-canadian I'm working on rebasing this PR on latest changes of master. cc @lilykaiser |
|
@tobrun Are you guys planning on releasing an artifact to maven soonish? |
|
When I run this code. Not working for me. |
This PR ports 2 open-source clustering algorithms from googlemaps/android-maps-utils.
cc @mapbox/android