summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationContainer.java
diff options
context:
space:
mode:
authortobrun <tobrun.van.nuland@gmail.com>2019-11-25 18:48:05 +0100
committerTobrun <tobrun.van.nuland@gmail.com>2019-12-03 17:10:31 +0100
commit29bbfcccdecde7d3570dff418d10e460043ed409 (patch)
treefac2e23574b16d7245709af2024f0d2e72265aa1 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationContainer.java
parent41324842b294d9d38eb42f1b8726e270510614e0 (diff)
downloadqtlocation-mapboxgl-29bbfcccdecde7d3570dff418d10e460043ed409.tar.gz
[android] remove platform specific Android code, migrate project to mapbox-gl-native-android
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationContainer.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationContainer.java87
1 files changed, 0 insertions, 87 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationContainer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationContainer.java
deleted file mode 100644
index e5bf512791..0000000000
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationContainer.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.mapbox.mapboxsdk.maps;
-
-
-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;
-
-/**
- * Encapsulates {@link Annotation}'s functionality..
- */
-class AnnotationContainer implements Annotations {
-
- private final NativeMap nativeMap;
- private final LongSparseArray<Annotation> annotations;
-
- AnnotationContainer(NativeMap nativeMap, LongSparseArray<Annotation> annotations) {
- this.nativeMap = nativeMap;
- this.annotations = annotations;
- }
-
- @Override
- public Annotation obtainBy(long id) {
- return annotations.get(id);
- }
-
- @NonNull
- @Override
- public List<Annotation> obtainAll() {
- List<Annotation> annotations = new ArrayList<>();
- for (int i = 0; i < this.annotations.size(); i++) {
- annotations.add(this.annotations.get(this.annotations.keyAt(i)));
- }
- return annotations;
- }
-
- @Override
- public void removeBy(long id) {
- if (nativeMap != null) {
- nativeMap.removeAnnotation(id);
- }
- annotations.remove(id);
- }
-
- @Override
- public void removeBy(@NonNull Annotation annotation) {
- long id = annotation.getId();
- removeBy(id);
- }
-
- @Override
- public void removeBy(@NonNull List<? extends Annotation> annotationList) {
- int count = annotationList.size();
- long[] ids = new long[count];
- for (int i = 0; i < count; i++) {
- ids[i] = annotationList.get(i).getId();
- }
-
- removeNativeAnnotations(ids);
-
- for (long id : ids) {
- annotations.remove(id);
- }
- }
-
- @Override
- public void removeAll() {
- int count = annotations.size();
- long[] ids = new long[count];
- for (int i = 0; i < count; i++) {
- ids[i] = annotations.keyAt(i);
- }
-
- removeNativeAnnotations(ids);
-
- annotations.clear();
- }
-
- private void removeNativeAnnotations(long[] ids) {
- if (nativeMap != null) {
- nativeMap.removeAnnotations(ids);
- }
- }
-} \ No newline at end of file