'Strange line after zoom-in Mapbox

Recently I got a weird issue when adding LineLayer to MapboxMap. Here's how I added it:

 val features = mutableListOf<Feature>()
var coordinateList = ArrayList<Point>()
var index = 0
for (item in locations) {
    coordinateList.add(
        Point.fromLngLat(
            item.longitude,
            item.latitude
        )
    )
    
    val properties = JsonObject()
    properties.addProperty("index", index)
    val feature =
        Feature.fromGeometry(
            Point.fromLngLat(item.longitude, item.latitude),
            properties
        )
    features.add(feature)
    index += 1
}
mapStyle!!.addSource(
    GeoJsonSource(
        "route-line-source", FeatureCollection.fromFeatures(
            arrayOf(
                Feature.fromGeometry(
                    MultiPoint.fromLngLats(coordinateList)
                )
            )
        )
    )
)

mapStyle!!.addLayer(
    LineLayer("route-line-layer", "route-line-source").withProperties(
        PropertyFactory.lineCap(Property.LINE_CAP_ROUND),
        PropertyFactory.lineJoin(Property.LINE_JOIN_ROUND),
        PropertyFactory.lineWidth(3f),
        PropertyFactory.lineColor(Color.RED)
    )
)

val fromFeatures = FeatureCollection.fromFeatures(features)
mapStyle!!.addSource(GeoJsonSource("index-source", fromFeatures))
val symbolLayer = SymbolLayer("index-layer", "index-source")
symbolLayer.setProperties(
    PropertyFactory.textField(Expression.toString(Expression.get("index"))),
    PropertyFactory.textSize(MapFragment.CLUSTER_RADIUS / 2f),
    PropertyFactory.textColor(Color.RED),
    PropertyFactory.textAllowOverlap(true)
)
mapStyle!!.addLayer(symbolLayer)

The output was nice in high-zoomed layers such as 10, 11. However, whenever I tried to zoom in (14, 15), some weird lines appeared as below.

Do you guys know how to get rid of those lines? I am using Mapbox SDK 9.xxx. I tried to report it in Mapbox Repo, but no answer. This is the issue link. You can down load the zip data and test it yourself.

weird lines after zooming in



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source