export interface AmapAdapter {
  reverseGeocode(coordinates: { latitude: number; longitude: number }): Promise<{ formattedValue: string; serviceMode: "mock" }>;
}

export class MockAmapAdapter implements AmapAdapter {
  readonly calls: Array<{ latitude: number; longitude: number }> = [];

  async reverseGeocode(coordinates: { latitude: number; longitude: number }) {
    this.calls.push({ ...coordinates });
    return {
      formattedValue: `模拟地点 ${coordinates.latitude.toFixed(4)}, ${coordinates.longitude.toFixed(4)}`,
      serviceMode: "mock" as const,
    };
  }
}
