SVG path notation
in Google Maps API, whereas the path was the only required property for using symbols.
Users can also customize the properties like weight, color of a symbol using symbol objects.
The following are the properties of Symbol.anchor
Used to set the position of a symbol with respect to the polyline or marker.fillcolor
Used to fill the symbol’s color, by default the color is black.fillOpacity
The symbol’s opacity is defined by fillOpacity
and the values range from 0.0 to 1.0 and the default value is 0.0.path
The shapes of the symbols are defined using the path property. User can use google.maps.symbolpath
or use SVG path notation
for customizing.scale
Used to scale the size of symbol and by default the scale is 1.rotation
Used to rotate the symbol in degrees of clockwise direction and by default the symbol has a 0 rotation.strokeColor
The outline color of a symbol is defined using the property strokecolor
and by default the color is black. For polyline symbol the default color depends up on polyline.strokeOpacity
The symbol’s stroke relative opacity is defined using the strokeOpacity
by default it is 1.0 and range from 0.0 to 1.0.strokeWeight
The weight of the symbol can be defined using the property strokeweight
.SymbolPath
class.
The fill or stroke of a pre-defined symbols can be modified using the symbol default options. The Google Maps API uses the following predefined symbols.
Symbols | SymbolPaths |
---|---|
Backward-point arrow(closed on all sides) | google.maps.SymbolPath.BACKWARD_CLOSED_ARROW |
Forward-point arrow(closed on all sides) | google.maps.SymbolPath.FORWARD_CLOSED_ARROW |
Circle | google.maps.SymbolPath.CIRCLE |
Backward-point arrow(open on one side) | google.maps.SymbolePath.BACKWARD_OPEN_ARROW |
Forward-point arrow(open on one side) | google.maps.SymbolPath.FORWARD_OPEN_ARROW |
symbol
object use the marker’s icon property with desired path. The example below explain in detail about adding a symbol. window.setInteval()
function in Google Maps JavaScript API applications. setIcon()
on marker.
For more information about Markers checkout Google Maps - Markers.