Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[Android] LineLayer not appearing on map #12990

Closed
amir169 opened this issue Sep 29, 2018 · 5 comments
Closed

[Android] LineLayer not appearing on map #12990

amir169 opened this issue Sep 29, 2018 · 5 comments
Labels
Android Mapbox Maps SDK for Android archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl

Comments

@amir169
Copy link

amir169 commented Sep 29, 2018

I tried to add a line using LineLayer and I got different results on different devices! On my device, Galaxy A3-2017, this was fine and the line was drawn correctly but on many other devices such as: Nexus 5X, Asus Zenphone, Huawei honor, ... this was not working and no line where drawn. Here's my code:

        List<Point> points = new ArrayList<>();
        for (LatLng coord : getCoords()) {
            points.add(com.mapbox.geojson.Point.fromLngLat(coord.getLongitude(), coord.getLatitude()));
        }
       LineString lineString = LineString.fromLngLats(points);

        GeoJsonSource geoJsonSource = new GeoJsonSource("source", lineString);
        mapboxMap.addSource(geoJsonSource);

        LineLayer layer = new LineLayer("id", "source");

        Float[] dashArray = new Float[1];
        dashArray[0] = 1f;

        layer.setProperties(
                PropertyFactory.lineCap("round"),
                PropertyFactory.lineJoin("round"),
                PropertyFactory.lineWidth(7f),
                PropertyFactory.lineColor("#09baba"),
                PropertyFactory.lineOpacity(1f)
                ,PropertyFactory.lineDasharray(dashArray));

        mapboxMap.addLayer(layer);

Expected behavior

A simple map with a line drawn on it:
image

Actual behavior

A simple map:
image

Configuration

Device models: Nexus 5X with android 8, Huawei honor with android 5, Asus Zenphone
Mapbox SDK version: 6.5.0

The weird thing is, this was OK in previous versions of Mapbox SDK such as 6.1.0.

@LukasPaczos LukasPaczos added the Android Mapbox Maps SDK for Android label Oct 1, 2018
@tobrun
Copy link
Member

tobrun commented Oct 9, 2018

Potentially this is similar to the line flickering (considering timeline this issue surfaced). I hope this is fixed with #12982. @amir169 would you be able to test out v6.6.0-beta.1 and see if this fixed your issue?

@tobrun
Copy link
Member

tobrun commented Oct 12, 2018

6.6.0 has landed, feel free to test out if this version resolves your issue from OP.
Please reach out if not, closing for now.

@tobrun tobrun closed this as completed Oct 12, 2018
@amir169
Copy link
Author

amir169 commented Nov 12, 2018

@tobrun
I can see this issue again in 'Mapbox SDK version: 6.7.0' on device 'Samsung GT-N7100'.
Would you please re-open this?

@tobrun tobrun reopened this Nov 12, 2018
@rudza
Copy link

rudza commented Mar 11, 2019

Is there any progress on this?

@tobrun tobrun added the Core The cross-platform C++ core, aka mbgl label Mar 18, 2019
@stale stale bot added the archived Archived because of inactivity label Sep 14, 2019
@stale
Copy link

stale bot commented Sep 14, 2019

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

4 participants