uniapp map callout使用

<template>
	<view>
		<view class="page-body">
			<view class="page-section page-section-gap">
				<map style="width: 100%; height: 300px;" :latitude="latitude" :longitude="longitude" :markers="covers">
				</map>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
     
     
		data() {
     
     
			return {
     
     
				id: 0, // 使用 marker点击事件 需要填写id
				title: 'map',
				latitude: 35.909,
				longitude: 116.39742,
				covers: [{
     
     
					width: 45,
					height: 60,
					latitude: 35.909,
					longitude: 116.39742,
					iconPath: '../../static/img/location-1.png',
					"callout": {
     
     
						"content": "小明",
						"borderRadius": 5,
						"display": "ALWAYS",
						"padding": 7,
						"bgColor": "#FFFFFF"
					}
				}]
			}
		},
		methods: {
     
     

		}
	}
</script>

おすすめ

転載: blog.csdn.net/qq_25430563/article/details/119106699
おすすめ