Line manager won't show lines
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- mobile-dev
Research direction
Start by reproducing the report through addOrEditRouteLines, first with LineManager and then with GeoJsonSource and LineLayer, on Android 6.0–7.0. Observe the brief appearance and disappearance after updating the source; done means route lines remain visible after updates, including when the data changes.
Written by the indexing model from the issue text.
Description
On Android 6.0 - Android 7.0 (I've tested on those versions) the lines are not displayed.
On Android 10.0 lines are normally showed with exact same implementation as on Android 6.0 - Android 7.0 (not sure for 8.0 - 10.0 versions).
lineManager = LineManager(map, this, style).apply {
lineCap = Property.LINE_CAP_ROUND
}
points.map { line ->
val lineOptions = LineOptions()
.withLineColor(linesColor)
.withLineWidth(3f)
.withGeometry(
LineString.fromLngLats(line.map { Point.fromLngLat(it.longitude, it.latitude) })
)
lines.add(lineManager.create(lineOptions))
}
Then I've just noticed that the line appeared for a brief second and then disappeared.
Then I tried with a different approach:
I tried adding GeoJsonSource and LineLayer. Lines are shown, but when I update GeoJsonSource with different data, lines are hidden again 👎 When I load the exact same data as previously into GeoJsonSource, lines are shown again.
This is also happening on Android 6.0 - Android 7.0
fun addOrEditRouteLines(style: Style?, color: String, data: List<List<LatLng>>) {
with(style ?: return) {
(sources.find { it.id == DEFAULT_LAYER_LINES } as? GeoJsonSource)?.apply {
(getLayer(DEFAULT_LAYER_LINES) as LineLayer).apply {
withProperties(PropertyFactory.lineColor(color))
}
clearLines(style)
setGeoJson(
fromFeatures(
data.map { line ->
Feature.fromGeometry(
LineString.fromLngLats(line.map { Point.fromLngLat(it.longitude, it.latitude) })
)
}
)
)
return
}
val routeLines = GeoJsonSource(
DEFAULT_LAYER_LINES,
fromFeatures(
data.map { line ->
Feature.fromGeometry(
LineString.fromLngLats(line.map { Point.fromLngLat(it.longitude, it.latitude) })
)
}
)
)
addSource(routeLines)
addLayer(
LineLayer(DEFAULT_LAYER_LINES, DEFAULT_LAYER_LINES).withProperties(
PropertyFactory.lineWidth(3f),
PropertyFactory.lineColor(color),
PropertyFactory.lineCap(Property.LINE_CAP_ROUND)
)
)
}
}
- Dominant language
- Java
- Stars
- 242
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/mapbox-plugins-android
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
mapbox/mapbox-plugins-android#1207 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
mapbox/mapbox-plugins-android#1206 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
mapbox/mapbox-plugins-android#1203 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mapbox/mapbox-plugins-android#1195 · 1 comment · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
mapbox/mapbox-plugins-android#1193 · 1 comment ·
All issues in mapbox/mapbox-plugins-android
Similar issues
-
P2 testing
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
area/core kind/bug status/triage team/core-shared
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
checkstyle/checkstyle#21755 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
spring-projects/spring-integration#11495 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day