"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.AMapGeoRequest = void 0;
var _axios = _interopRequireDefault(require("axios"));
var _base = require("./base");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class AMapGeoRequest extends _base.RequestBase {
  ecodeAddress(params) {
    throw new Error('Method not implemented.');
  }
  async decodeAddress(params) {
    try {
      const requestParams = {
        ...params,
        location: params.location.join(',')
      };
      const {
        data
      } = await _axios.default.get(`${this.serverHost}/geocode/regeo`, {
        params: requestParams
      });
      const {
        status,
        ...others
      } = data;
      return {
        status: Number(status),
        ...others
      };
    } catch (err) {
      return {
        status: 0,
        info: err.toString()
      };
    }
  }
}
exports.AMapGeoRequest = AMapGeoRequest;
//# sourceMappingURL=geo.js.map