PinConfig class
Represents a BitmapDescriptor that is created from a pin configuration. Can only be used with AdvancedMarkers.
The backgroundColor and borderColor are used to define the color of the standard pin marker.
The glyph parameter is used to define the glyph that is displayed on the pin marker (default glyph is a circle).
The following example demonstrates how to change colors of the default map pin to white and blue:
PinConfig(
backgroundColor: Colors.blue,
borderColor: Colors.white,
glyph: CircleGlyph(color: Colors.blue)
)
The following example demonstrates how to customize a marker pin by showing a short text on the pin:
PinConfig(
backgroundColor: Colors.blue,
glyph: TextGlyph(text: 'Pin', textColor: Colors.white)
)
The following example demonstrates how to customize a marker pin by showing a custom image on the pin:
PinConfig(
glyph: BitmapGlyph(
bitmap: BitmapDescriptor.asset(
ImageConfiguration(size: Size(12, 12)),
'assets/cat.png'
)
)
- Inheritance
-
- Object
- BitmapDescriptor
- PinConfig
Constructors
- PinConfig({Color? backgroundColor, Color? borderColor, AdvancedMarkerGlyph? glyph})
-
Constructs a PinConfig that is created from a pin configuration.
const
Properties
- backgroundColor → Color?
-
The background color of the pin.
final
- borderColor → Color?
-
The border color of the pin.
final
- glyph → AdvancedMarkerGlyph?
-
The glyph that is displayed on the pin marker. If null, the default
circular glyph is used.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Object -
Convert the object to a Json format.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited