March 2013
Beginner to intermediate
580 pages
16h 11m
English
Now that you have everything else in place, it is relatively trivial to add markers to the map that show the start and finish locations of the run. You can also add some text along with those markers that will show up in an info window when you touch them.
Add the code highlighted below to updateUI().
Listing 36.12 Start and end markers with info (RunMapFragment.java)
private void updateUI() { if (mGoogleMap == null || mLocationCursor == null) return; // Set up an overlay on the map for this run's locations // Create a polyline with all of the points PolylineOptions line = new PolylineOptions(); // Also create a LatLngBounds so you can zoom to fit LatLngBounds.Builder latLngBuilder = new LatLngBounds.Builder(); ...Read now
Unlock full access