MapMarkerTextStyle.withFont constructor - MapMarkerTextStyle - mapview library - Dart API
MapMarkerTextStyle.withFont constructor
- double textSize,
- Color textColor,
- double textOutlineSize,
- Color textOutlineColor,
- List<
MapMarkerTextStylePlacement> placements, - String fontName,
Creates a set of styling options for the text of a MapMarker.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behavior. Related APIs may change for new releases without a deprecation process.
List of placements is used to specify allowed placement of text relative to the icon.
When marker overlapping is allowed as set by MapMarker.isOverlapAllowed,
only first placement element is considered.
Otherwise the placement value is chosen so that the text does not overlap
with other MapMarker instances.
Placement values are prioritized according to the order in which they appear in the list. Lists with duplicate entries as well as empty lists are not supported.
-
textSizeThe size of the text in pixels. Only positive values are supported. -
textColorThe text color. -
textOutlineSizeThe size of the text outline in pixels. Only non-negative values are supported. -
textOutlineColorThe color of the text outline. -
placementsList of allowed placements of the text relative to the icon of a MapMarker. -
fontNameFont name, registered withAssetsManager.registerFont. If empty string is provided, a default font will be used.
Throws MapMarkerTextStyleInstantiationException. In case of invalid input parameters.
Implementation
factory MapMarkerTextStyle.withFont(double textSize, ui.Color textColor, double textOutlineSize, ui.Color textOutlineColor, List<MapMarkerTextStylePlacement> placements, String fontName) => $prototype.withFont(textSize, textColor, textOutlineSize, textOutlineColor, placements, fontName);