地图显示正常、Marker 功能正常
export const AmapConfig = {
key: '****',
version: '2.0',
plugins: ['AMap.Geocoder', 'AMap.ElasticMarker', 'AMap.MoveAnimation'],
};
// Geocoder
this.geocoder$.subscribe(([geocoder, AMap]) => {
geocoder.getAddress(
new AMap.LngLat(116.359119, 39.972121),
function (status: any, result: any) {
console.log({ status, result });
if (status === 'complete' && result.regeocode) {
var address = result.regeocode.formattedAddress;
console.log({ result, address });
} else {
console.error('根据经纬度查询地址失败');
}
},
);
});