Class LineManager
- java.lang.Object
-
- com.mapbox.mapboxsdk.plugins.annotation.AnnotationManager<com.mapbox.mapboxsdk.style.layers.LineLayer,Line,LineOptions,OnLineDragListener,OnLineClickListener,OnLineLongClickListener>
-
- com.mapbox.mapboxsdk.plugins.annotation.LineManager
-
public class LineManager extends AnnotationManager<com.mapbox.mapboxsdk.style.layers.LineLayer,Line,LineOptions,OnLineDragListener,OnLineClickListener,OnLineLongClickListener>
The line manager allows to add lines to a map.
-
-
Field Summary
-
Fields inherited from class com.mapbox.mapboxsdk.plugins.annotation.AnnotationManager
annotations, coreElementProvider, geoJsonSource, layer, mapboxMap
-
-
Constructor Summary
Constructors Constructor Description LineManager(com.mapbox.mapboxsdk.maps.MapView mapView, com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap, com.mapbox.mapboxsdk.maps.Style style)Create a line manager, used to manage lines.LineManager(com.mapbox.mapboxsdk.maps.MapView mapView, com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap, com.mapbox.mapboxsdk.maps.Style style, java.lang.String belowLayerId, java.lang.String aboveLayerId)Create a line manager, used to manage lines.LineManager(com.mapbox.mapboxsdk.maps.MapView mapView, com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap, com.mapbox.mapboxsdk.maps.Style style, java.lang.String belowLayerId, java.lang.String aboveLayerId, com.mapbox.mapboxsdk.style.sources.GeoJsonOptions geoJsonOptions)Create a line manager, used to manage lines.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Line>create(com.mapbox.geojson.FeatureCollection featureCollection)Create a list of lines on the map.java.util.List<Line>create(java.lang.String json)Create a list of lines on the map.com.mapbox.mapboxsdk.style.expressions.ExpressiongetFilter()Get filter of the managed lines.java.lang.StringgetLineCap()Get the LineCap propertyjava.lang.Float[]getLineDasharray()Get the LineDasharray propertyjava.lang.FloatgetLineMiterLimit()Get the LineMiterLimit propertyjava.lang.FloatgetLineRoundLimit()Get the LineRoundLimit propertyjava.lang.Float[]getLineTranslate()Get the LineTranslate propertyjava.lang.StringgetLineTranslateAnchor()Get the LineTranslateAnchor propertyprotected voidsetDataDrivenPropertyIsUsed(java.lang.String property)voidsetFilter(com.mapbox.mapboxsdk.style.expressions.Expression expression)Set filter on the managed lines.voidsetLineCap(java.lang.String value)Set the LineCap propertyvoidsetLineDasharray(java.lang.Float[] value)Set the LineDasharray propertyvoidsetLineMiterLimit(java.lang.Float value)Set the LineMiterLimit propertyvoidsetLineRoundLimit(java.lang.Float value)Set the LineRoundLimit propertyvoidsetLineTranslate(java.lang.Float[] value)Set the LineTranslate propertyvoidsetLineTranslateAnchor(java.lang.String value)Set the LineTranslateAnchor property-
Methods inherited from class com.mapbox.mapboxsdk.plugins.annotation.AnnotationManager
addClickListener, addDragListener, addLongClickListener, create, create, delete, delete, deleteAll, getAnnotations, getLayerId, onDestroy, removeClickListener, removeDragListener, removeLongClickListener, update, update, updateSource
-
-
-
-
Constructor Detail
-
LineManager
@UiThread public LineManager(@NonNull com.mapbox.mapboxsdk.maps.MapView mapView, @NonNull com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap, @NonNull com.mapbox.mapboxsdk.maps.Style style)Create a line manager, used to manage lines.- Parameters:
mapboxMap- the map object to add lines tostyle- a valid a fully loaded style object
-
LineManager
@UiThread public LineManager(@NonNull com.mapbox.mapboxsdk.maps.MapView mapView, @NonNull com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap, @NonNull com.mapbox.mapboxsdk.maps.Style style, @Nullable java.lang.String belowLayerId, @Nullable java.lang.String aboveLayerId)Create a line manager, used to manage lines.- Parameters:
mapboxMap- the map object to add lines tostyle- a valid a fully loaded style objectbelowLayerId- the id of the layer above the line layeraboveLayerId- the id of the layer below the line layer
-
LineManager
@UiThread public LineManager(@NonNull com.mapbox.mapboxsdk.maps.MapView mapView, @NonNull com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap, @NonNull com.mapbox.mapboxsdk.maps.Style style, @Nullable java.lang.String belowLayerId, @Nullable java.lang.String aboveLayerId, @Nullable com.mapbox.mapboxsdk.style.sources.GeoJsonOptions geoJsonOptions)Create a line manager, used to manage lines.- Parameters:
mapboxMap- the map object to add lines tostyle- a valid a fully loaded style objectbelowLayerId- the id of the layer above the line layeraboveLayerId- the id of the layer below the line layergeoJsonOptions- options for the internal source
-
-
Method Detail
-
setDataDrivenPropertyIsUsed
protected void setDataDrivenPropertyIsUsed(@NonNull java.lang.String property)- Specified by:
setDataDrivenPropertyIsUsedin classAnnotationManager<com.mapbox.mapboxsdk.style.layers.LineLayer,Line,LineOptions,OnLineDragListener,OnLineClickListener,OnLineLongClickListener>
-
create
@UiThread public java.util.List<Line> create(@NonNull java.lang.String json)
Create a list of lines on the map.Lines are going to be created only for features with a matching geometry.
All supported properties are:
LineOptions.PROPERTY_LINE_JOIN - String
LineOptions.PROPERTY_LINE_OPACITY - Float
LineOptions.PROPERTY_LINE_COLOR - String
LineOptions.PROPERTY_LINE_WIDTH - Float
LineOptions.PROPERTY_LINE_GAP_WIDTH - Float
LineOptions.PROPERTY_LINE_OFFSET - Float
LineOptions.PROPERTY_LINE_BLUR - Float
LineOptions.PROPERTY_LINE_PATTERN - String
Learn more about above properties in the Style specification.Out of spec properties:
"is-draggable" - Boolean, true if the line should be draggable, false otherwise- Parameters:
json- the GeoJSON defining the list of lines to build- Returns:
- the list of built lines
-
create
@UiThread public java.util.List<Line> create(@NonNull com.mapbox.geojson.FeatureCollection featureCollection)
Create a list of lines on the map.Lines are going to be created only for features with a matching geometry.
All supported properties are:
LineOptions.PROPERTY_LINE_JOIN - String
LineOptions.PROPERTY_LINE_OPACITY - Float
LineOptions.PROPERTY_LINE_COLOR - String
LineOptions.PROPERTY_LINE_WIDTH - Float
LineOptions.PROPERTY_LINE_GAP_WIDTH - Float
LineOptions.PROPERTY_LINE_OFFSET - Float
LineOptions.PROPERTY_LINE_BLUR - Float
LineOptions.PROPERTY_LINE_PATTERN - String
Learn more about above properties in the Style specification.Out of spec properties:
"is-draggable" - Boolean, true if the line should be draggable, false otherwise- Parameters:
featureCollection- the featureCollection defining the list of lines to build- Returns:
- the list of built lines
-
getLineCap
public java.lang.String getLineCap()
Get the LineCap propertyThe display of line endings.
- Returns:
- property wrapper value around String
-
setLineCap
public void setLineCap(java.lang.String value)
Set the LineCap propertyThe display of line endings.
- Parameters:
value- property wrapper value around String
-
getLineMiterLimit
public java.lang.Float getLineMiterLimit()
Get the LineMiterLimit propertyUsed to automatically convert miter joins to bevel joins for sharp angles.
- Returns:
- property wrapper value around Float
-
setLineMiterLimit
public void setLineMiterLimit(java.lang.Float value)
Set the LineMiterLimit propertyUsed to automatically convert miter joins to bevel joins for sharp angles.
- Parameters:
value- property wrapper value around Float
-
getLineRoundLimit
public java.lang.Float getLineRoundLimit()
Get the LineRoundLimit propertyUsed to automatically convert round joins to miter joins for shallow angles.
- Returns:
- property wrapper value around Float
-
setLineRoundLimit
public void setLineRoundLimit(java.lang.Float value)
Set the LineRoundLimit propertyUsed to automatically convert round joins to miter joins for shallow angles.
- Parameters:
value- property wrapper value around Float
-
getLineTranslate
public java.lang.Float[] getLineTranslate()
Get the LineTranslate propertyThe geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
- Returns:
- property wrapper value around Float[]
-
setLineTranslate
public void setLineTranslate(java.lang.Float[] value)
Set the LineTranslate propertyThe geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
- Parameters:
value- property wrapper value around Float[]
-
getLineTranslateAnchor
public java.lang.String getLineTranslateAnchor()
Get the LineTranslateAnchor propertyControls the frame of reference for
PropertyFactory.lineTranslate(java.lang.Float[]).- Returns:
- property wrapper value around String
-
setLineTranslateAnchor
public void setLineTranslateAnchor(java.lang.String value)
Set the LineTranslateAnchor propertyControls the frame of reference for
PropertyFactory.lineTranslate(java.lang.Float[]).- Parameters:
value- property wrapper value around String
-
getLineDasharray
public java.lang.Float[] getLineDasharray()
Get the LineDasharray propertySpecifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to density-independent pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.
- Returns:
- property wrapper value around Float[]
-
setLineDasharray
public void setLineDasharray(java.lang.Float[] value)
Set the LineDasharray propertySpecifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to density-independent pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.
- Parameters:
value- property wrapper value around Float[]
-
setFilter
public void setFilter(@NonNull com.mapbox.mapboxsdk.style.expressions.Expression expression)Set filter on the managed lines.- Parameters:
expression- expression
-
getFilter
@Nullable public com.mapbox.mapboxsdk.style.expressions.Expression getFilter()
Get filter of the managed lines.- Returns:
- expression
-
-