<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
window._AMapSecurityConfig = {
securityJsCode: "securityJsCode",
};
</script>
<script src="https://webapi.amap.com/loader.js"></script>
<script type="text/javascript">
AMapLoader.load({
key: "key",
version: "2.0"
}).then(() => {
AMap.plugin('AMap.Geolocation', function () {
AMap.plugin('AMap.Geocoder', function () {
var geolocation = new AMap.Geolocation();
var geocoder = new AMap.Geocoder();
geolocation.getCurrentPosition(function (_, pos) {
pos = pos.position.toString().split(',');
geocoder.getAddress(pos, function (_, result) {
var c = result.regeocode.addressComponent.city;
console.log(result.regeocode.formattedAddress + '#' + pos);
});
});
});
});
});
</script>
</body>
</html>