I’m use Osmdroid lib and I want draw line in real time while user moves.
It’s true in points
recieved data from pos
but line
is not appears on the map.
What’s wrong here?
`GeoPoint pos = new GeoPoint(location.getLatitude(), location.getLongitude());
Polyline line = new Polyline();
ArrayList<GeoPoint> points = new ArrayList<>();
points.add(pos);
line.setPoints(points);
line.setColor(Color.BLACK);
line.setGeodesic(true);
map.getOverlays().add(line);
map.invalidate();`
when I try this
GeoPoint pos = new GeoPoint(location.getLatitude(), location.getLongitude()); GeoPoint pos2 = new GeoPoint(50.5, 50.5); Polyline line = new Polyline(); line.addPoint(pos); line.addPoint(pos2); line.setColor(Color.BLACK); line.setGeodesic(true); map.getOverlays().add(line); map.invalidate();
line appears
Dmitrii Voronchikhin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.