<template>
<view class="content1">
<map style="width: 100%;height: 100%;" :latitude="latitude" :longitude="longitude" :scale="scale" :markers="covers">
</map>
</view>
</template>
<script>
export default {
data() {
return {
latitude: 39.915, // 经度
longitude: 116.404, // 纬度
scale: 16, // 缩放级别,可以根据自己的需求设置
covers: [{
latitude: 39.915, // 经度
longitude: 116.404, // 纬度
iconPath: '../../static/位置.png'
}]
}
},
methods: {}
}
</script>
<style>
.content1 {
height: 600rpx;
width: 650rpx;
}
</style>
![](https://img-blog.csdnimg.cn/d09c7b6d7bc8425383e4c580f0c82a46.png)
iconPath | 显示的图标 | | | 项目目录下的图片路径,支持相对路径写法 |