addClusteredMarkersFromPoints method

Future<String?> addClusteredMarkersFromPoints({
  1. required List<OlaLatLng> points,
  2. int? clusterRadius,
  3. String? defaultMarkerColor,
  4. String? defaultClusterColor,
  5. double? textSize,
  6. String? textColor,
  7. String? stop1Color,
  8. String? stop2Color,
  9. String? iconPath,
})

Implementation

Future<String?> addClusteredMarkersFromPoints({
  required List<OlaLatLng> points,
  int? clusterRadius,
  String? defaultMarkerColor,
  String? defaultClusterColor,
  double? textSize,
  String? textColor,
  String? stop1Color,
  String? stop2Color,
  String? iconPath,
}) {
  final geoJson = jsonEncode({
    'type': 'FeatureCollection',
    'features': [
      for (final point in points)
        {
          'type': 'Feature',
          'geometry': {
            'type': 'Point',
            'coordinates': [point.longitude, point.latitude],
          },
          'properties': <String, dynamic>{},
        },
    ],
  });
  return addClusteredMarkers(
    geoJson: geoJson,
    clusterRadius: clusterRadius,
    defaultMarkerColor: defaultMarkerColor,
    defaultClusterColor: defaultClusterColor,
    textSize: textSize,
    textColor: textColor,
    stop1Color: stop1Color,
    stop2Color: stop2Color,
    iconPath: iconPath,
  );
}