import 'wayz_common_models.dart';

/// 逆地理编码
class WzReverseGeocodeResponse {
  final String id;
  final String asset;
  final WzLocation location;

  WzReverseGeocodeResponse({
    required this.id,
    required this.asset,
    required this.location,
  });

  factory WzReverseGeocodeResponse.fromJson(Map<String, dynamic> json) {
    return WzReverseGeocodeResponse(
      id: (json['id'] ?? '') as String,
      asset: (json['asset'] ?? '') as String,
      location: WzLocation.fromJson((json['location'] as Map).cast<String, dynamic>()),
    );
  }

  Map<String, dynamic> toJson() => {
        'id': id,
        'asset': asset,
        'location': location.toJson(),
      };
}

