uniapp map自定义气泡窗

uniapp map自定义气泡窗

1、map

<template>
	<view>
		<map class="map" :latitude="mapCenter.lat" :longitude="mapCenter.lng" :scale="5" :markers="mapData">
			<!--自定义冒泡-->
			<cover-view slot="callout">
				<cover-view v-for="(item,index) in mapData" :key="item.id" 
				class="map-item" :marker-id="item.id">
					<!--你的内容-->
				</cover-view>
			</cover-view>
		</map>
	</view>
</template>

2、数据

	data(){
   
		return{
   
			mapCenter:{
   lat: 23.125178, lng: 113.280637},// 中心点
			mapData:[{
    // 标记点
			 id:1, // 必填 number
			 latitude:23.125178,
			 longitude: 113.280637,
             width: 30, 
             height: 30,
             customCallout:{
   display: 'BYCLICK'},// BYCLICK 点击显示 ALWAYS 总是显示
             iconPath:'../../static/img/icon.png'
             }]
		}
	}

参考官网:https://uniapp.dcloud.net.cn/component/map.html#map

相关推荐

  1. uniapp map定义气泡

    2024-01-26 17:28:01       36 阅读
  2. vue实现悬浮拖动的定义指令

    2024-01-26 17:28:01       30 阅读
  3. 鸿蒙OS应用开发之定义

    2024-01-26 17:28:01       39 阅读
  4. android 定义键盘长按弹

    2024-01-26 17:28:01       33 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-26 17:28:01       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-26 17:28:01       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-26 17:28:01       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-26 17:28:01       18 阅读

热门阅读

  1. glog使用方法

    2024-01-26 17:28:01       41 阅读
  2. 如何设计一个可靠UDP

    2024-01-26 17:28:01       29 阅读
  3. Acwing---788.逆序对的数量

    2024-01-26 17:28:01       32 阅读
  4. 常见的网络安全攻击类型

    2024-01-26 17:28:01       40 阅读
  5. 蓝桥杯练习题

    2024-01-26 17:28:01       36 阅读
  6. fbx格式转换

    2024-01-26 17:28:01       37 阅读