use of com.mapbox.mapboxsdk.style.layers.Layer in project androidApp by InspectorIncognito.
the class OnBusEngine method setupBusStopRouteLayer.
private void setupBusStopRouteLayer() {
busStopSource = new GeoJsonSource(SOURCE_BUS_STOPS, FeatureCollection.fromFeatures(new Feature[] {}));
mapboxMap.addSource(busStopSource);
Layer routeLayer = new SymbolLayer("BUS_STOP_ROUTE_ID", SOURCE_BUS_STOPS).withProperties(iconImage("routeBusIcon"), iconSize(0.8f), /* allows show all icons */
iconAllowOverlap(true), iconOffset(new Float[] { BusStopMarker.MARKER_DX_OFFSET, BusStopMarker.MARKER_DY_OFFSET }));
routeLayer.setMinZoom(15);
mapboxMap.addLayerAbove(routeLayer, BUS_STOP_SELECTED_MARKER_LAYER_ID);
}
use of com.mapbox.mapboxsdk.style.layers.Layer in project mapbox-navigation-android by mapbox.
the class NavigationMapRoute method addRouteShieldLayer.
/**
* Add the route shield layer to the map either using the custom style values or the default.
*/
private void addRouteShieldLayer(String layerId, String sourceId, int index) {
float scale = index == primaryRouteIndex ? routeScale : alternativeRouteScale;
Layer routeLayer = new LineLayer(layerId, sourceId).withProperties(PropertyFactory.lineCap(Property.LINE_CAP_ROUND), PropertyFactory.lineJoin(Property.LINE_JOIN_ROUND), PropertyFactory.lineWidth(Function.zoom(exponential(stop(10f, PropertyFactory.lineWidth(7f)), stop(14f, PropertyFactory.lineWidth(10.5f * scale)), stop(16.5f, PropertyFactory.lineWidth(15.5f * scale)), stop(19f, PropertyFactory.lineWidth(24f * scale)), stop(22f, PropertyFactory.lineWidth(29f * scale))).withBase(1.5f))), PropertyFactory.lineColor(index == primaryRouteIndex ? routeShieldColor : alternativeRouteShieldColor));
MapUtils.addLayerToMap(mapboxMap, routeLayer, belowLayer);
}
Aggregations