Commit 0b1150a0 authored by Andres Käver's avatar Andres Käver

location line

parent cf6a36b3
......@@ -29,9 +29,9 @@ class MapsActivity : AppCompatActivity(), OnMapReadyCallback, LocationListener {
private lateinit var locationManager: LocationManager;
private var provider : String? = ""
private var location: Location? = null
private val polylineOptions = PolylineOptions().width(5f)
private val polylineOptions = PolylineOptions().width(10f)
.color(Color.RED)
private lateinit var polyLine : Polyline
private var polyLine : Polyline? = null;
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
......@@ -116,7 +116,7 @@ class MapsActivity : AppCompatActivity(), OnMapReadyCallback, LocationListener {
// remove the old polyline from map
// or you will just add lines on top of each other and run out of memory
if (polyLine != null) {
polyLine.remove();
polyLine!!.remove()
}
polylineOptions.add(markerLatLng)
polyLine = mMap.addPolyline(polylineOptions)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment