Polylines on android map disappear when zoomed out

…衆ロ難τιáo~ 提交于 2019-12-09 07:43:45

This seems like a bug in the Google Play Services library similar to the one I reported some time ago.

I just tried

map.addPolyline(new PolylineOptions()
        .add(new LatLng(90, 5))
        .add(new LatLng(-90, 5))
        .width(2)
        .color(Color.BLUE));

and it draws a line from 0,0 to 0,5 on low zoom levels and from 0,5 to 90,5 after you zoom in. Both are of course incorrect.

A workaround would be to use 85 instead

map.addPolyline(new PolylineOptions()
        .add(new LatLng(85, 5))
        .add(new LatLng(-85, 5))
        .width(2)
        .color(Color.BLUE));

but don't ask me why it works correctly this way...

You may also want to add more info to the linked issue report.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!