use of com.mapbox.mapboxsdk.style.layers.LineLayer in project mapbox-plugins-android by mapbox.
the class TrafficPlugin method addPrimaryLayer.
/**
* Add primary layer to the map.
*/
private void addPrimaryLayer() {
LineLayer primary = TrafficLayer.getLineLayer(Primary.BASE_LAYER_ID, Primary.ZOOM_LEVEL, Primary.FILTER, Primary.FUNCTION_LINE_COLOR, Primary.FUNCTION_LINE_WIDTH, Primary.FUNCTION_LINE_OFFSET);
LineLayer primaryCase = TrafficLayer.getLineLayer(Primary.CASE_LAYER_ID, Primary.ZOOM_LEVEL, Primary.FILTER, Primary.FUNCTION_LINE_COLOR_CASE, Primary.FUNCTION_LINE_WIDTH_CASE, Primary.FUNCTION_LINE_OFFSET, Primary.FUNCTION_LINE_OPACITY_CASE);
addTrafficLayersToMap(primaryCase, primary, getLastAddedLayerId());
}
use of com.mapbox.mapboxsdk.style.layers.LineLayer 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