html源码:
<div id="my_container"></div>
js源码:
export default {
name: "company_manage",
data() {
return {
ruleForm: {
addr: "",
long: "",
lat: "",
}
};
},
mounted: function() {
this.init();
},
methods: {
init() {
var map = new AMap.Map("my_container", {
resizeEnable: true,
zoom: 10
});
AMap.plugin("AMap.Geolocation", function() {
//异步加载插件
var geolocation = new AMap.Geolocation();
map.addControl(geolocation);
});
var geocoder, marker;
function regeocoder(lnglatXY, that) {
AMap.plugin("AMap.Geocoder", function() {
var geocoder = new AMap.Geocoder({
radius: 1000,
extensions: "all"
});