Usage
Paths
Add a path (polyline) to the map.
The SDK allows you to easily plot a path on the map using the StaticMapPath
class. This class allows you to specify the size, color, outline, and the polyline to be drawn on the map.
The polyline string must be encoded using the Encoded Polyline Algorithm Format. You can use google_polyline_algorithm package to encode your path points, or provide the points directly.
The code above will generate the following static map:
Providing path points directly
You can provide a list of points directly, and leave it to our package to encode the polyline for you. Use the StaticMapPath.points()
constructor, example:
Avoid passing a large list of points directly, otherwise users can experience jank during encoding. Instead, install the google_polyline_algorithm package and encode the polyline in an isolate.