MapCircleLayer class

A sublayer which renders group of MapCircle on MapShapeLayer and MapTileLayer.

 late List<MapLatLng> _circles;
 late MapShapeSource _mapSource;

 @override
 void initState() {
   _circles = const <MapLatLng>[
     MapLatLng(-14.235004, -51.92528),
     MapLatLng(51.16569, 10.451526),
     MapLatLng(-25.274398, 133.775136),
     MapLatLng(20.593684, 78.96288),
     MapLatLng(61.52401, 105.318756)
   ];

   _mapSource = MapShapeSource.asset(
     'assets/world_map.json',
     shapeDataField: 'name',
   );
   super.initState();
 }

 @override
 Widget build(BuildContext context) {
   return Scaffold(
     body: Center(
         child: Container(
       height: 350,
       child: Padding(
         padding: EdgeInsets.only(left: 15, right: 15),
         child: SfMaps(
           layers: <MapLayer>[
             MapShapeLayer(
               source: _mapSource,
               sublayers: [
                 MapCircleLayer(
                   circles: List<MapCircle>.generate(
                     _circles.length,
                     (int index) {
                       return MapCircle(
                         center: _circles[index],
                       );
                     },
                   ).toSet(),
                 ),
               ],
             ),
           ],
         ),
       ),
     )),
   );
 }

See also:
* `MapCircleLayer.inverted()` named constructor, for inverted color support.
Inheritance

Constructors

MapCircleLayer({Key? key, required Set<MapCircle> circles, Animation<double>? animation, Color? color, double strokeWidth = 1, Color? strokeColor, IndexedWidgetBuilder? tooltipBuilder})
Creates the MapCircleLayer.
const
MapCircleLayer.inverted({Key? key, required Set<MapCircle> circles, Animation<double>? animation, double strokeWidth = 1, Color? color, Color? strokeColor, IndexedWidgetBuilder? tooltipBuilder})
You may highlight a specific area on a map to make it more readable by using the circles property of MapCircleLayer.inverted by adding mask to the outer region of the highlighted circles.
const

Properties

animation → Animation<double>?
Animation for the circles in MapCircleLayer.
final
circles → Set<MapCircle>
A collection of MapCircle.
final
color → Color?
The fill color of all the MapCircle.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
strokeColor → Color?
The stroke color of all the MapCircle.
final
strokeWidth → double
The stroke width of all the MapCircle.
final
tooltipBuilder → IndexedWidgetBuilder?
Returns a widget for the map line tooltip based on the index.
finalinherited

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited