changeMarker method

  1. @override
Future<void> changeMarker(
  1. int idOSM,
  2. GeoPoint oldLocation,
  3. GeoPoint newLocation, {
  4. GlobalKey<State<StatefulWidget>>? globalKeyIcon,
  5. double? angle = null,
  6. IconAnchor? iconAnchor,
})
override

Implementation

@override
Future<void> changeMarker(
  int idOSM,
  GeoPoint oldLocation,
  GeoPoint newLocation, {
  GlobalKey? globalKeyIcon,
  double? angle = null,
  IconAnchor? iconAnchor,
}) async {
  Map<String, dynamic> args = {
    "new_location": newLocation.toMap(),
    "old_location": oldLocation.toMap(),
    "angle": angle,
  };
  if (globalKeyIcon != null) {
    final icon = await _capturePng(globalKeyIcon);
    args["new_icon"] = icon;
  }
  if (iconAnchor != null) {
    args["iconAnchor"] = iconAnchor.toMap();
  }
  await _channels[idOSM]!.invokeMethod("change#Marker", args);
}