geocoding static method

Future<void> geocoding({
  1. required String? address,
  2. String? cityOrAdcode,
  3. GeocodingResultBack? back,
})

地理编码

Implementation

static Future<void> geocoding({
  required String? address,
  String? cityOrAdcode,
  GeocodingResultBack? back,
}) async {
  final String? jsonStr = await _channel.invokeMethod('geocoding', {
    "address": address,
    "cityOrAdcode": cityOrAdcode,
  });
  if (jsonStr != null) {
    Map? map = json.decode(jsonStr);
    if (map != null && back != null) {
      back(map['code'] as int, GeocodingResult.fromJson(map["data"]));
    }
  }
}