How to add a line to a static map
In this topic, you'll learn how to add a line to a static map using Amazon Location Service. We'll cover the supported styling options, how to define a line using GeoJSON, and how to apply custom styles such as color, width, and outline. We'll also explore how to use different measurement units for properties like line width.
Supported styling
Name |
Type |
Default |
Description |
---|---|---|---|
|
Color |
style-dependent |
The line color. |
|
Integer/String |
2 |
The line width. For more information, see How to add a line to a static map. |
|
Color |
style-dependent |
The line outline color. |
|
Integer/String |
0 (turned off) |
The width of the outline. For more information, see How to add a line to a static map. |
Supported unit
Unit |
Description |
---|---|
Integer, for example, |
Pixels |
String with no unit, for example |
Pixels |
|
Pixels |
|
Meters |
|
Kilometers |
|
Miles |
|
Feet |
|
Yards |
|
The percentage of the default value for a specific property, in pixels. For example, if the
default value for |
Add a line
In this example, you will add a line from a place in Vancouver to Stanley Park. The line is created using a GeoJSON format with defined coordinates.
Add styling to the line
In this example, you will style the line added in the previous example. This includes defining the line's color, width, outline color, and outline width to customize the visual appearance of the line on the map.