expose LocationIndicatorLayer and an alternative rendering mode based on it

This commit is contained in:
Łukasz Paczos
2020-04-08 15:07:47 +02:00
parent d7161fca1f
commit 6bb456882a
39 changed files with 2479 additions and 635 deletions

View File

@@ -1,14 +1,20 @@
package com.mapbox.mapboxsdk.location;
import androidx.annotation.NonNull;
import com.mapbox.geojson.Feature;
import com.mapbox.mapboxsdk.style.layers.CircleLayer;
import com.mapbox.mapboxsdk.style.layers.Layer;
import com.mapbox.mapboxsdk.style.layers.LocationIndicatorLayer;
import com.mapbox.mapboxsdk.style.layers.Property;
import com.mapbox.mapboxsdk.style.layers.PropertyFactory;
import com.mapbox.mapboxsdk.style.layers.SymbolLayer;
import com.mapbox.mapboxsdk.style.sources.GeoJsonOptions;
import com.mapbox.mapboxsdk.style.sources.GeoJsonSource;
import java.util.HashSet;
import java.util.Set;
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.ACCURACY_LAYER;
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BACKGROUND_LAYER;
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BEARING_LAYER;
@@ -108,4 +114,17 @@ class LayerSourceProvider {
circlePitchAlignment(Property.CIRCLE_PITCH_ALIGNMENT_MAP)
);
}
Set<String> getEmptyLayerSet() {
return new HashSet<>();
}
LocationIndicatorLayer generateLocationComponentLayer() {
LocationIndicatorLayer layer = new LocationIndicatorLayer(FOREGROUND_LAYER);
layer.setProperties(
PropertyFactory.perspectiveCompensation(0.9f),
PropertyFactory.imageTiltDisplacement(4f)
);
return layer;
}
}