use of com.mapbox.mapboxsdk.style.layers.CircleLayer in project androidApp by InspectorIncognito.
the class BusStopLayer method setupAllLayers.
public void setupAllLayers(MapboxMap mapboxMap, Context context, String busStopsSource) {
Bitmap icon = BitmapFactory.decodeResource(context.getResources(), R.drawable.paradero);
mapboxMap.addImage("busStopIcon", icon);
// LOADING LAYER
mapboxMap.addLayer(new CircleLayer(BUS_STOP_LOADING_LAYER_ID, busStopsSource).withProperties(circleRadius(property(BusStopMarker.PROPERTY_LOADING_PROGRESS, exponential(getLoadingAnimationStops()))), PropertyFactory.circlePitchAlignment(Property.CIRCLE_PITCH_ALIGNMENT_MAP), PropertyFactory.iconRotationAlignment(Property.ICON_ROTATION_ALIGNMENT_MAP), circleColor(ContextCompat.getColor(context, R.color.green_button)), circleOpacity(0.6f)).withFilter(eq(BusStopMarker.PROPERTY_LOADING, true)));
// MARKER LAYER
Layer layer = new SymbolLayer(BUS_STOP_MARKER_LAYER_ID, busStopsSource).withProperties(iconImage("busStopIcon"), iconSize(0.8f), /* allows show all icons */
iconAllowOverlap(true), iconOffset(new Float[] { BusStopMarker.MARKER_DX_OFFSET, BusStopMarker.MARKER_DY_OFFSET })).withFilter(eq(BusStopMarker.PROPERTY_SELECTED, false));
layer.setMinZoom(15);
mapboxMap.addLayer(layer);
// SELECTED MARKER LAYER
mapboxMap.addLayer(new SymbolLayer(BUS_STOP_SELECTED_MARKER_LAYER_ID, busStopsSource).withProperties(iconImage("busStopIcon"), iconSize(0.8f), /* allows show all icons */
iconAllowOverlap(true), iconOffset(new Float[] { BusStopMarker.MARKER_DX_OFFSET, BusStopMarker.MARKER_DY_OFFSET })).withFilter(eq(BusStopMarker.PROPERTY_SELECTED, true)));
// MIN INFO WINDOW LAYER
mapboxMap.addLayer(new SymbolLayer(BUS_STOP_INFO_WINDOW_LAYER_ID_MIN, busStopsSource).withProperties(/* show image with id title based on the value of the maximized feature property */
iconImage("{ID}-min"), /* set anchor of icon to bottom-left */
iconAnchor("bottom-left"), /* offset icon slightly to match bubble layout */
iconOffset(new Float[] { BusStopMarker.MIN_DX_OFFSET, BusStopMarker.MIN_DY_OFFSET })).withFilter(all(eq(BusStopMarker.PROPERTY_SELECTED, true), eq(BusStopMarker.PROPERTY_LOADING, false), eq(BusStopMarker.PROPERTY_MAXIMIZED, false))));
// MAX INFO WINDOW LAYER
mapboxMap.addLayer(new SymbolLayer(BUS_STOP_INFO_WINDOW_LAYER_ID_MAX, busStopsSource).withProperties(/* show image with id title based on the value of the maximized feature property */
iconImage("{ID}-max"), /* set anchor of icon to bottom-left */
iconAnchor("bottom-left"), /* offset icon slightly to match bubble layout */
iconOffset(new Float[] { BusStopMarker.MAX_DX_OFFSET, BusStopMarker.MAX_DY_OFFSET })).withFilter(all(eq(BusStopMarker.PROPERTY_SELECTED, true), eq(BusStopMarker.PROPERTY_LOADING, false), eq(BusStopMarker.PROPERTY_MAXIMIZED, true))));
}
use of com.mapbox.mapboxsdk.style.layers.CircleLayer in project mapbox-plugins-android by mapbox.
the class LocationLayer method addAccuracyLayer.
private void addAccuracyLayer() {
CircleLayer locationAccuracyLayer = new CircleLayer(ACCURACY_LAYER, LOCATION_SOURCE).withProperties(circleRadius(0f));
addLayerToMap(locationAccuracyLayer, BACKGROUND_LAYER);
}
Aggregations