updateCoordinates method Null safety
- List<
BMFCoordinate> coordinates, - {List<
int> ? indexs}
更新经纬度数组
List<BMFCoordinate
> coordinates polyline经纬度数组
indexs iOS 独有参数,分段索引(多纹理,多颜色折线请赋值), iOS 在多颜色或者多纹理渲染的情况下,更新经纬度数组的同时,必须更新indexs
Implementation
Future<bool> updateCoordinates(List<BMFCoordinate> coordinates,
{List<int>? indexs}) async {
ArgumentError.checkNotNull(coordinates, "coordinates");
bool ret = await BMFMapDispatcherFactory.instance.overlayDispatcher
.updatePolylineMember(this.methodChannel, {
'id': this.id,
'member': 'coordinates',
'value': coordinates.map((coordinate) => coordinate.toMap()).toList(),
'indexs': indexs?.map((index) => index).toList()
});
if (ret) {
this.coordinates = coordinates;
if (Platform.isIOS) {
if (null != indexs) {
this.indexs = indexs;
}
}
}
return ret;
}