Class LineManager

    • 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 to
        style - 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 to
        style - a valid a fully loaded style object
        belowLayerId - the id of the layer above the line layer
        aboveLayerId - 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 to
        style - a valid a fully loaded style object
        belowLayerId - the id of the layer above the line layer
        aboveLayerId - the id of the layer below the line layer
        geoJsonOptions - options for the internal source
    • Method Detail

      • 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 property

        The display of line endings.

        Returns:
        property wrapper value around String
      • setLineCap

        public void setLineCap​(java.lang.String value)
        Set the LineCap property

        The display of line endings.

        Parameters:
        value - property wrapper value around String
      • getLineMiterLimit

        public java.lang.Float getLineMiterLimit()
        Get the LineMiterLimit property

        Used 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 property

        Used 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 property

        Used 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 property

        Used 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 property

        The 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 property

        The 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 property

        Controls 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 property

        Controls 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 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.

        Returns:
        property wrapper value around Float[]
      • setLineDasharray

        public void setLineDasharray​(java.lang.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

        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