"use strict";const e=require("../vendor.js");exports.getMapAddress=function(){return new Promise(((o,s)=>{e.index.getLocation({type:"wgs84",altitude:!0,isHighAccuracy:!0,success(s){console.log(s,"经纬度");const t=`https://api.tianditu.gov.cn/geocoder?postStr={'lon':${s.longitude},'lat':${s.latitude},'ver':2}&type=geocode&tk=4ce26ecef55ae1ec47910a72a098efc0`;e.index.request({url:t,method:"GET",success(e){var s,t;o({address:(null==(t=null==(s=null==e?void 0:e.data)?void 0:s.result)?void 0:t.formatted_address)||""}),console.log(e,"address")},fail(s){o({address:"拒绝定位"}),console.error("获取地址失败:",s),e.index.showModal({title:"提示",content:"请先允许定位！",success:function(o){o.confirm?(e.index.openSetting(),console.log("用户点击确定")):o.cancel&&console.log("用户点击取消")}})}})},fail(e){console.log("拒绝定位",e)}})}))};
