[build] - initial commit

This commit is contained in:
tobrun
2019-10-09 13:19:56 +02:00
commit a3ef1ac2d0
1061 changed files with 403354 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
package com.mapbox.mapboxsdk.maps;
import android.graphics.RectF;
import android.support.annotation.NonNull;
import android.support.v4.util.LongSparseArray;
import com.mapbox.mapboxsdk.annotations.Annotation;
import java.util.ArrayList;
import java.util.List;
class ShapeAnnotationContainer implements ShapeAnnotations {
private final NativeMap nativeMapView;
private final LongSparseArray<Annotation> annotations;
ShapeAnnotationContainer(NativeMap nativeMapView, LongSparseArray<Annotation> annotations) {
this.nativeMapView = nativeMapView;
this.annotations = annotations;
}
@NonNull
@Override
public List<Annotation> obtainAllIn(@NonNull RectF rectangle) {
RectF rect = nativeMapView.getDensityDependantRectangle(rectangle);
long[] annotationIds = nativeMapView.queryShapeAnnotations(rect);
return getAnnotationsFromIds(annotationIds);
}
@NonNull
private List<Annotation> getAnnotationsFromIds(long[] annotationIds) {
List<Annotation> shapeAnnotations = new ArrayList<>();
for (long annotationId : annotationIds) {
Annotation annotation = annotations.get(annotationId);
if (annotation != null) {
shapeAnnotations.add(annotation);
}
}
return shapeAnnotations;
}
}