iconType property

MapIconType iconType
final

Specifies the shape of the legend icon.

Defaults to MapIconType.circle.

 @override
 Widget build(BuildContext context) {
   return SfMaps(
     layers: [
       MapShapeLayer(
         showLegend: true,
         legendSettings: MapLegendSettings(
             iconType: MapIconType.square
          ),
         delegate: MapShapeLayerDelegate(
             shapeFile: "assets/world_map.json",
             shapeDataField: "continent",
             dataCount: bubbleData.length,
             primaryValueMapper: (index) {
               return bubbleData[index].country;
             }),
       )
     ],
   );
 }

See also:

  • showIcon, to show or hide the icon for the legend items.
  • iconSize, to set the size of the icon.

Implementation

final MapIconType iconType