Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ public void run() {
}

for (final MarkerWithPosition marker : markersToRemove) {
boolean onScreen = visibleBounds.contains(marker.position);
boolean onScreen = marker.position != null && visibleBounds.contains(marker.position);
if (onScreen && mAnimate) {
final Point point = mSphericalMercatorProjection.toPoint(marker.position);
final Point closest = findClosestCluster(newClustersOnScreen, point);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public void run() {
if (DefaultAdvancedMarkersClusterRenderer.this.mClusters != null && mAnimate) {
existingClustersOnScreen = new ArrayList<>();
for (Cluster<T> c : DefaultAdvancedMarkersClusterRenderer.this.mClusters) {
if (shouldRenderAsCluster(c) && visibleBounds.contains(c.getPosition())) {
if (shouldRenderAsCluster(c) && c.getPosition() != null && visibleBounds.contains(c.getPosition())) {
Point point = mSphericalMercatorProjection.toPoint(c.getPosition());
existingClustersOnScreen.add(point);
}
Expand Down Expand Up @@ -492,7 +492,7 @@ public void run() {
if (mAnimate) {
newClustersOnScreen = new ArrayList<>();
for (Cluster<T> c : clusters) {
if (shouldRenderAsCluster(c) && visibleBounds.contains(c.getPosition())) {
if (shouldRenderAsCluster(c) && c.getPosition() != null && visibleBounds.contains(c.getPosition())) {
Point p = mSphericalMercatorProjection.toPoint(c.getPosition());
newClustersOnScreen.add(p);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ public void run() {

// Remove the old markers, animating them into clusters if zooming out.
for (final MarkerWithPosition marker : markersToRemove) {
boolean onScreen = visibleBounds.contains(marker.position);
boolean onScreen = marker.position != null && 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.
if (!zoomingIn && zoomDelta > -3 && onScreen && mAnimate) {
Expand Down
Loading