Best code examples for Android Polyline class (com.google.android.gms.maps.model.Polyline)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Polyline class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android Polyline examples from Open Source projects
This code example shows how to use the following methods: setPoints
        double distance = SphericalUtil.computeDistanceBetween(mMarkerA.getPosition(), mMarkerB.getPosition());
        mTextView.setText("The markers are " + formatNumber(distance) + " apart.");
    } 
 
    private void updatePolyline() { 
        mPolyline.setPoints(Arrays.asList(mMarkerA.getPosition(), mMarkerB.getPosition()));
    } 
 
    private String formatNumber(double distance) {
        String unit = "m";
        if (distance < 1) {
            distance *= 1000;
            unit = "mm";
        } else if (distance > 1000) {
            distance /= 1000;
            unit = "km";
        } 
 
        return String.format("%4.3f%s", distance, unit);
    } 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getColor, setColor
This code example shows how to use the following methods: setPoints
package com.droidplanner.fragments.helpers; 
 
import java.util.List; 
 
import android.graphics.Color; 
 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.model.LatLng; 
import com.google.android.gms.maps.model.Polyline; 
import com.google.android.gms.maps.model.PolylineOptions; 
 
public class MapPath { 
	public interface PathSource { 
		public List<LatLng> getPathPoints();
	} 
 
	public Polyline missionPath;
	private GoogleMap mMap;
	private float width;
	private int color;

5
CodeRank
This code example shows how to use the following methods: getPoints, setPoints
This code example shows how to use the following methods: getColor, setColor
Related Android Polyline Questions & Answers:
See Code Examples for Android Polyline Methods: