showMarker method

  1. @override
Future<void> showMarker({
  1. required MapType mapType,
  2. required Coords coords,
  3. required String title,
  4. String? description,
  5. int zoom = 16,
  6. Map<String, String>? extraParams,
})
override

Opens the map application specified by mapType and displays a marker at coords.

  • mapType: The map application to launch.
  • coords: Coordinates where the marker should be placed.
  • title: Title for the marker.
  • description: Optional description for the marker.
  • zoom: Optional zoom level (default is 16).
  • extraParams: Extra map-specific query parameters.

Implementation

@override
Future<void> showMarker({
  required MapType mapType,
  required Coords coords,
  required String title,
  String? description,
  int zoom = 16,
  Map<String, String>? extraParams,
}) async {
  final String url = getMapMarkerUrl(
    mapType: mapType,
    coords: coords,
    title: title,
    description: description,
    zoom: zoom,
    extraParams: extraParams,
  );

  final Map<String, String?> args = {
    'mapType': mapType.name,
    'url': url,
    'title': title,
    'description': description,
    'latitude': coords.latitude.toString(),
    'longitude': coords.longitude.toString(),
  };
  await methodChannel.invokeMethod('showMarker', args);
}