-
public class LineManager extends AnnotationManager<LineLayer, Line, LineOptions, OnLineDragListener, OnLineClickListener, OnLineLongClickListener>
The line manager allows to add lines to a map.
-
-
Constructor Summary
Constructors Constructor Description LineManager(MapView mapView, MapLibreMap maplibreMap, Style style)Create a line manager, used to manage lines. LineManager(MapView mapView, MapLibreMap maplibreMap, Style style, String belowLayerId, String aboveLayerId)Create a line manager, used to manage lines. LineManager(MapView mapView, MapLibreMap maplibreMap, Style style, String belowLayerId, String aboveLayerId, GeoJsonOptions geoJsonOptions)Create a line manager, used to manage lines.
-
Method Summary
Modifier and Type Method Description List<Line>create(@NonNull() String json)Create a list of lines on the map. List<Line>create(@NonNull() FeatureCollection featureCollection)Create a list of lines on the map. StringgetLineCap()Get the LineCap propertyThe display of line endings. voidsetLineCap(String value)Set the LineCap propertyThe display of line endings. FloatgetLineMiterLimit()Get the LineMiterLimit propertyUsed to automatically convert miter joins to bevel joins for sharp angles. voidsetLineMiterLimit(Float value)Set the LineMiterLimit propertyUsed to automatically convert miter joins to bevel joins for sharp angles. FloatgetLineRoundLimit()Get the LineRoundLimit propertyUsed to automatically convert round joins to miter joins for shallow angles. voidsetLineRoundLimit(Float value)Set the LineRoundLimit propertyUsed to automatically convert round joins to miter joins for shallow angles. Array<Float>getLineTranslate()Get the LineTranslate propertyThe geometry's offset. voidsetLineTranslate(Array<Float> value)Set the LineTranslate propertyThe geometry's offset. StringgetLineTranslateAnchor()Get the LineTranslateAnchor propertyControls the frame of reference for lineTranslate. voidsetLineTranslateAnchor(String value)Set the LineTranslateAnchor propertyControls the frame of reference for lineTranslate. Array<Float>getLineDasharray()Get the LineDasharray propertySpecifies the lengths of the alternating dashes and gaps that form the dash pattern. voidsetLineDasharray(Array<Float> value)Set the LineDasharray propertySpecifies the lengths of the alternating dashes and gaps that form the dash pattern. voidsetFilter(@NonNull() Expression expression)Set filter on the managed lines. ExpressiongetFilter()Get filter of the managed lines. -
Methods inherited from class org.maplibre.android.plugins.annotation.AnnotationManager
addClickListener, addDragListener, addLongClickListener, create, create, delete, delete, deleteAll, getAboveLayerId, getAnnotations, getBelowLayerId, getLayerId, onDestroy, removeClickListener, removeDragListener, removeLongClickListener, update, update, updateSource -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
LineManager
LineManager(MapView mapView, MapLibreMap maplibreMap, Style style)
Create a line manager, used to manage lines.- Parameters:
maplibreMap- the map object to add lines tostyle- a valid a fully loaded style object
-
LineManager
LineManager(MapView mapView, MapLibreMap maplibreMap, Style style, String belowLayerId, String aboveLayerId)
Create a line manager, used to manage lines.- Parameters:
maplibreMap- 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
LineManager(MapView mapView, MapLibreMap maplibreMap, Style style, String belowLayerId, String aboveLayerId, GeoJsonOptions geoJsonOptions)
Create a line manager, used to manage lines.- Parameters:
maplibreMap- 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
-
create
@UiThread() List<Line> create(@NonNull() 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 - StringLineOptions.PROPERTY_LINE_OPACITY - FloatLineOptions.PROPERTY_LINE_COLOR - StringLineOptions.PROPERTY_LINE_WIDTH - FloatLineOptions.PROPERTY_LINE_GAP_WIDTH - FloatLineOptions.PROPERTY_LINE_OFFSET - FloatLineOptions.PROPERTY_LINE_BLUR - FloatLineOptions.PROPERTY_LINE_PATTERN - StringLearn 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
-
create
@UiThread() List<Line> create(@NonNull() 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 - StringLineOptions.PROPERTY_LINE_OPACITY - FloatLineOptions.PROPERTY_LINE_COLOR - StringLineOptions.PROPERTY_LINE_WIDTH - FloatLineOptions.PROPERTY_LINE_GAP_WIDTH - FloatLineOptions.PROPERTY_LINE_OFFSET - FloatLineOptions.PROPERTY_LINE_BLUR - FloatLineOptions.PROPERTY_LINE_PATTERN - StringLearn 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
-
getLineCap
String getLineCap()
Get the LineCap property
The display of line endings.
-
setLineCap
void setLineCap(String value)
Set the LineCap property
The display of line endings.
- Parameters:
value- property wrapper value around String
-
getLineMiterLimit
Float getLineMiterLimit()
Get the LineMiterLimit property
Used to automatically convert miter joins to bevel joins for sharp angles.
-
setLineMiterLimit
void setLineMiterLimit(Float value)
Set the LineMiterLimit property
Used to automatically convert miter joins to bevel joins for sharp angles.
- Parameters:
value- property wrapper value around Float
-
getLineRoundLimit
Float getLineRoundLimit()
Get the LineRoundLimit property
Used to automatically convert round joins to miter joins for shallow angles.
-
setLineRoundLimit
void setLineRoundLimit(Float value)
Set the LineRoundLimit property
Used to automatically convert round joins to miter joins for shallow angles.
- Parameters:
value- property wrapper value around Float
-
getLineTranslate
Array<Float> getLineTranslate()
Get the LineTranslate property
The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
-
setLineTranslate
void setLineTranslate(Array<Float> value)
Set the LineTranslate property
The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
- Parameters:
value- property wrapper value around Float[]
-
getLineTranslateAnchor
String getLineTranslateAnchor()
Get the LineTranslateAnchor property
Controls the frame of reference for lineTranslate.
-
setLineTranslateAnchor
void setLineTranslateAnchor(String value)
Set the LineTranslateAnchor property
Controls the frame of reference for lineTranslate.
- Parameters:
value- property wrapper value around String
-
getLineDasharray
Array<Float> getLineDasharray()
Get the LineDasharray property
Specifies 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.
-
setLineDasharray
void setLineDasharray(Array<Float> value)
Set the LineDasharray property
Specifies 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
void setFilter(@NonNull() Expression expression)
Set filter on the managed lines.
- Parameters:
expression- expression
-
-
-
-