<template>
<div class="web-main">
<div id="container" style="width:1000px; height:900px"></div>
</div>
</template>
<script>
import { getActionData } from "@/api/manage.js";
export default {
name: "MidMap",
data() {
return {
description: "中间高德地图",
// 地图参数结束
},
watch: {},
created() {
},
mounted() {
this.xx();
},
methods: {
xx() {
var map = new AMap.Map("container", {
zoom: 15, //级别
center: [121.473678, 31.230516], //中心点坐标
viewMode: "2D", //使用3D视图
});
// 创建一个 Marker 实例:
var marker = new AMap.Marker({
position: new AMap.LngLat(121.473678, 31.230516), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
offset: new AMap.Pixel(-10, -10),
icon: require("../../../assets/img/real-estate-overview-img/mapdidian.png"),
// icon: "image/gdmap_icon.png", // 添加 Icon 图标 URL
title: "北京",
});
marker.setLab
高德地图引入 vue初始化高德地图报错‘AMap‘ is not defined
最新推荐文章于 2025-06-06 11:41:46 发布