Search in sources :

Example 1 with LineLayer

use of com.mapbox.mapboxsdk.style.layers.LineLayer in project mapbox-plugins-android by mapbox.

the class TrafficPlugin method addTrunkLayer.

/**
 * Add trunk layer to the map.
 */
private void addTrunkLayer() {
    LineLayer trunk = TrafficLayer.getLineLayer(Trunk.BASE_LAYER_ID, Trunk.ZOOM_LEVEL, Trunk.FILTER, Trunk.FUNCTION_LINE_COLOR, Trunk.FUNCTION_LINE_WIDTH, Trunk.FUNCTION_LINE_OFFSET);
    LineLayer trunkCase = TrafficLayer.getLineLayer(Trunk.CASE_LAYER_ID, Trunk.ZOOM_LEVEL, Trunk.FILTER, Trunk.FUNCTION_LINE_COLOR_CASE, Trunk.FUNCTION_LINE_WIDTH_CASE, Trunk.FUNCTION_LINE_OFFSET);
    addTrafficLayersToMap(trunkCase, trunk, getLastAddedLayerId());
}
Also used : LineLayer(com.mapbox.mapboxsdk.style.layers.LineLayer)

Example 2 with LineLayer

use of com.mapbox.mapboxsdk.style.layers.LineLayer in project mapbox-plugins-android by mapbox.

the class TrafficPlugin method addSecondaryLayer.

/**
 * Add secondary layer to the map.
 */
private void addSecondaryLayer() {
    LineLayer secondary = TrafficLayer.getLineLayer(Secondary.BASE_LAYER_ID, Secondary.ZOOM_LEVEL, Secondary.FILTER, Secondary.FUNCTION_LINE_COLOR, Secondary.FUNCTION_LINE_WIDTH, Secondary.FUNCTION_LINE_OFFSET);
    LineLayer secondaryCase = TrafficLayer.getLineLayer(Secondary.CASE_LAYER_ID, Secondary.ZOOM_LEVEL, Secondary.FILTER, Secondary.FUNCTION_LINE_COLOR_CASE, Secondary.FUNCTION_LINE_WIDTH_CASE, Secondary.FUNCTION_LINE_OFFSET, Secondary.FUNCTION_LINE_OPACITY_CASE);
    addTrafficLayersToMap(secondaryCase, secondary, getLastAddedLayerId());
}
Also used : LineLayer(com.mapbox.mapboxsdk.style.layers.LineLayer)

Example 3 with LineLayer

use of com.mapbox.mapboxsdk.style.layers.LineLayer in project mapbox-plugins-android by mapbox.

the class TrafficPlugin method addMotorwayLayer.

/**
 * Add motorway layer to the map.
 */
private void addMotorwayLayer() {
    LineLayer motorWay = TrafficLayer.getLineLayer(MotorWay.BASE_LAYER_ID, MotorWay.ZOOM_LEVEL, MotorWay.FILTER, MotorWay.FUNCTION_LINE_COLOR, MotorWay.FUNCTION_LINE_WIDTH, MotorWay.FUNCTION_LINE_OFFSET);
    LineLayer motorwayCase = TrafficLayer.getLineLayer(MotorWay.CASE_LAYER_ID, MotorWay.ZOOM_LEVEL, MotorWay.FILTER, MotorWay.FUNCTION_LINE_COLOR_CASE, MotorWay.FUNCTION_LINE_WIDTH_CASE, MotorWay.FUNCTION_LINE_OFFSET);
    addTrafficLayersToMap(motorwayCase, motorWay, getLastAddedLayerId());
}
Also used : LineLayer(com.mapbox.mapboxsdk.style.layers.LineLayer)

Example 4 with LineLayer

use of com.mapbox.mapboxsdk.style.layers.LineLayer in project mapbox-plugins-android by mapbox.

the class TrafficPlugin method addLocalLayer.

/**
 * Add local layer to the map.
 */
private void addLocalLayer() {
    LineLayer local = TrafficLayer.getLineLayer(Local.BASE_LAYER_ID, Local.ZOOM_LEVEL, Local.FILTER, Local.FUNCTION_LINE_COLOR, Local.FUNCTION_LINE_WIDTH, Local.FUNCTION_LINE_OFFSET);
    LineLayer localCase = TrafficLayer.getLineLayer(Local.CASE_LAYER_ID, Local.ZOOM_LEVEL, Local.FILTER, Local.FUNCTION_LINE_COLOR_CASE, Local.FUNCTION_LINE_WIDTH_CASE, Local.FUNCTION_LINE_OFFSET, Local.FUNCTION_LINE_OPACITY_CASE);
    addTrafficLayersToMap(localCase, local, placeLayerBelow());
}
Also used : LineLayer(com.mapbox.mapboxsdk.style.layers.LineLayer)

Example 5 with LineLayer

use of com.mapbox.mapboxsdk.style.layers.LineLayer in project mapbox-navigation-android by mapbox.

the class NavigationMapRoute method addRouteLayer.

/**
 * Add the route layer to the map either using the custom style values or the default.
 */
private void addRouteLayer(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(4f, PropertyFactory.lineWidth(3f * scale)), stop(10f, PropertyFactory.lineWidth(4f * scale)), stop(13f, PropertyFactory.lineWidth(6f * scale)), stop(16f, PropertyFactory.lineWidth(10f * scale)), stop(19f, PropertyFactory.lineWidth(14f * scale)), stop(22f, PropertyFactory.lineWidth(18f * scale))).withBase(1.5f))), PropertyFactory.lineColor(Function.property(CONGESTION_KEY, categorical(stop("moderate", PropertyFactory.lineColor(index == primaryRouteIndex ? routeModerateColor : alternativeRouteModerateColor)), stop("heavy", PropertyFactory.lineColor(index == primaryRouteIndex ? routeSevereColor : alternativeRouteSevereColor)), stop("severe", PropertyFactory.lineColor(index == primaryRouteIndex ? routeSevereColor : alternativeRouteSevereColor)))).withDefaultValue(PropertyFactory.lineColor(index == primaryRouteIndex ? routeDefaultColor : alternativeRouteDefaultColor))));
    MapUtils.addLayerToMap(mapboxMap, routeLayer, belowLayer);
}
Also used : LineLayer(com.mapbox.mapboxsdk.style.layers.LineLayer) Layer(com.mapbox.mapboxsdk.style.layers.Layer) SymbolLayer(com.mapbox.mapboxsdk.style.layers.SymbolLayer) LineLayer(com.mapbox.mapboxsdk.style.layers.LineLayer)

Aggregations

LineLayer (com.mapbox.mapboxsdk.style.layers.LineLayer)7 Layer (com.mapbox.mapboxsdk.style.layers.Layer)2 SymbolLayer (com.mapbox.mapboxsdk.style.layers.SymbolLayer)2