diff --git a/src/main/java/com/google/maps/StaticMapsRequest.java b/src/main/java/com/google/maps/StaticMapsRequest.java index 327a84780..88698f64e 100644 --- a/src/main/java/com/google/maps/StaticMapsRequest.java +++ b/src/main/java/com/google/maps/StaticMapsRequest.java @@ -443,7 +443,7 @@ public StaticMapsRequest path(Path path) { * @return Returns this {@code StaticMapsRequest} for call chaining. */ public StaticMapsRequest path(EncodedPolyline path) { - return paramAddToList("path", "enc:" + path.getEncodedPath()); + return paramAddToList("path", path.getEncodedPath()); } /** diff --git a/src/main/java/com/google/maps/model/EncodedPolyline.java b/src/main/java/com/google/maps/model/EncodedPolyline.java index 07f75ddeb..995b9d34c 100644 --- a/src/main/java/com/google/maps/model/EncodedPolyline.java +++ b/src/main/java/com/google/maps/model/EncodedPolyline.java @@ -16,49 +16,116 @@ package com.google.maps.model; import com.google.maps.internal.PolylineEncoding; +import com.google.maps.internal.StringJoin; + import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** * Encoded Polylines are used by the API to represent paths. * - *
See
+ *
+ * See
* Encoded Polyline Algorithm for more detail on the protocol.
*/
public class EncodedPolyline implements Serializable {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
+
+ private int weight;
+ private String color;
+ private String fillcolor;
+ private boolean geodesic;
+ private final String points;
+
+ public EncodedPolyline() {
+ this.points = null;
+ }
+
+ /**
+ * @param encodedPoints A string representation of a path, encoded with the
+ * Polyline Algorithm.
+ */
+ public EncodedPolyline(String encodedPoints) {
+ this.points = encodedPoints;
+ }
+
+ /** @param points A path as a collection of {@code LatLng} points. */
+ public EncodedPolyline(List