Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 32 additions & 34 deletions Flutter/maps/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,46 @@ The [`SfMaps`](https://pub.dev/documentation/syncfusion_flutter_maps/latest/maps
{% tabs %}
{% highlight Dart %}

late List<PopulationModel> _data;
late MapShapeSource _dataSource;
late String _semanticLabel = 'Asia is the most populated continent and Australia is the least populated continent';

@override
void initState() {
_data = const <PopulationModel>[
PopulationModel('Asia', 456.07),
PopulationModel('Africa', 121.61),
PopulationModel('Europe', 74.64),
PopulationModel('North America', 57.9),
PopulationModel('South America', 42.25),
PopulationModel('Australia', 2.54),
];

_dataSource = MapShapeSource.asset(
'assets/world_map.json',
shapeDataField: 'continent',
dataCount: _data.length,
primaryValueMapper: (int index) => _data[index].continent,
);
super.initState();
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
late List<PopulationModel> _data;
late MapShapeSource _dataSource;
late String _semanticLabel = 'Asia is the most populated continent and Australia is the least populated continent';

@override
void initState() {
_data = const <PopulationModel>[
PopulationModel('Asia', 456.07),
PopulationModel('Africa', 121.61),
PopulationModel('Europe', 74.64),
PopulationModel('North America', 57.9),
PopulationModel('South America', 42.25),
PopulationModel('Australia', 2.54),
];

_dataSource = MapShapeSource.asset(
'assets/world_map.json',
shapeDataField: 'continent',
dataCount: _data.length,
primaryValueMapper: (int index) => _data[index].continent,
);
super.initState();
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Semantics(
label: 'Syncfusion Flutter Maps',
value: _semanticLabel,
child: SfMaps(
layers: <MapLayer>[
MapShapeLayer(
source: _dataSource,
),
],
MapShapeLayer(source: _dataSource)
]
),
),
),
);
}
);
}

class PopulationModel {
const PopulationModel(this.continent, this.populationInCrores);
Expand Down
20 changes: 10 additions & 10 deletions Flutter/maps/data-labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Model {

## Overflow mode

You can trim or remove the data label when it is overflowed from the shape using the [`MapDataLabelSettings.overflowMode`](https://pub.dev/documentation/syncfusion_flutter_maps/latest/maps/MapDataLabelSettings/overflowMode.html) property. The possible values are `visible`, `ellipsis`, and `hide`. The default value of the [`overflowMode`](https://pub.dev/documentation/syncfusion_flutter_maps/latest/maps/MapDataLabelSettings/overflowMode.html) property is `MapLabelOverflow.visible`.
You can trim or remove the data label when it is overflowed from the shape using the [`MapDataLabelSettings.overflowMode`](https://pub.dev/documentation/syncfusion_flutter_maps/latest/maps/MapDataLabelSettings/overflowMode.html) property. The possible values are [`visible`](https://pub.dev/documentation/syncfusion_flutter_maps/latest/maps/MapLabelOverflow.html#visible), [`ellipsis`](https://pub.dev/documentation/syncfusion_flutter_maps/latest/maps/MapLabelOverflow.html#ellipsis), and [`hide`](https://pub.dev/documentation/syncfusion_flutter_maps/latest/maps/MapLabelOverflow.html#hide). The default value of the [`overflowMode`](https://pub.dev/documentation/syncfusion_flutter_maps/latest/maps/MapDataLabelSettings/overflowMode.html) property is [`MapLabelOverflow.visible`](https://pub.dev/documentation/syncfusion_flutter_maps/latest/maps/MapLabelOverflow.html#visible).

By default, the data labels will render even if they overflows from the shape.

Expand All @@ -141,10 +141,10 @@ void initState() {

dataSource = MapShapeSource.asset(
'assets/australia.json',
shapeDataField: 'STATE_NAME',
dataCount: data.length,
primaryValueMapper: (int index) => data[index].state,
dataLabelMapper: (int index) => data[index].dataLabel,
shapeDataField: 'STATE_NAME',
dataCount: data.length,
primaryValueMapper: (int index) => data[index].state,
dataLabelMapper: (int index) => data[index].dataLabel,
);
super.initState();
}
Expand Down Expand Up @@ -206,11 +206,11 @@ void initState() {
];

dataSource = MapShapeSource.asset(
'assets/australia.json',
shapeDataField: 'STATE_NAME',
dataCount: data.length,
primaryValueMapper: (int index) => data[index].state,
dataLabelMapper: (int index) => data[index].dataLabel,
'assets/australia.json',
shapeDataField: 'STATE_NAME',
dataCount: data.length,
primaryValueMapper: (int index) => data[index].state,
dataLabelMapper: (int index) => data[index].dataLabel,
);
super.initState();
}
Expand Down
Loading