com.google.android.gms.maps.model.Polyline

Here are the examples of the java api class com.google.android.gms.maps.model.Polyline taken from open source projects.

1. GeoJsonRenderer#addLineStringToMap()

View license
/**
     * Adds a GeoJsonLineString to the map as a Polyline
     *
     * @param lineStringStyle contains relevant styling properties for the Polyline
     * @param lineString      contains coordinates for the Polyline
     * @return Polyline object created from given GeoJsonLineString
     */
private Polyline addLineStringToMap(GeoJsonLineStringStyle lineStringStyle, GeoJsonLineString lineString) {
    PolylineOptions polylineOptions = lineStringStyle.toPolylineOptions();
    // Add coordinates
    polylineOptions.addAll(lineString.getCoordinates());
    Polyline addedPolyline = mMap.addPolyline(polylineOptions);
    addedPolyline.setClickable(true);
    return addedPolyline;
}

2. MapDoodler#addPath()

Project: mapdoodle-android
Source File: MapDoodler.java
View license
public void addPath(GeoPath geoPath) {
    mPath = geoPath;
    PolylineOptions polylineOptions = new PolylineOptions();
    polylineOptions.width(5);
    polylineOptions.color(Color.RED);
    Polyline polyline = mMap.addPolyline(polylineOptions);
    polyline.setPoints(mPath.toLatLngList());
}

3. GeoJsonRenderer#addLineStringToMap()

View license
/**
     * Adds a GeoJsonLineString to the map as a Polyline
     *
     * @param lineStringStyle contains relevant styling properties for the Polyline
     * @param lineString      contains coordinates for the Polyline
     * @return Polyline object created from given GeoJsonLineString
     */
private Polyline addLineStringToMap(GeoJsonLineStringStyle lineStringStyle, GeoJsonLineString lineString) {
    PolylineOptions polylineOptions = lineStringStyle.toPolylineOptions();
    // Add coordinates
    polylineOptions.addAll(lineString.getCoordinates());
    Polyline addedPolyline = mMap.addPolyline(polylineOptions);
    addedPolyline.setClickable(true);
    return addedPolyline;
}