3***@qq.com
3***@qq.com
  • 发布:2024-03-27 12:15
  • 更新:2024-03-27 19:35
  • 阅读:113

在uniapp中使用map组件 在h5端不显示地图 有图标

分类:uni-app
<view class="resold_house-type_place_map">  
                    <map style="width: 100%; height: 100%;" enable-3D="false" show-compass="false"  
                        enable-overlooking="false" :enable-satellite="false" :enable-traffic="false"  
                        show-location="false" :latitude="latitude" :longitude="longitude" :markers="markers">  
                    </map>  
                </view>  

                latitude: 39.899,  
                longitude: 116.39742,  
                markers: [{  
                    id: 1, // Number  
                    title: '1', // String-标注点名  
                    rotate: 180, // Number - 顺时针旋转的角度,范围 0 ~ 360,默认为 0  
                    alpha: 0.5, // 默认1,无透明,范围 0 ~ 1  
                    latitude: 39.899,  
                    longitude: 116.39742,  
                    width: 30,  
                    height: 30,  
                    iconPath: '../../static/image/my.png', // 显示的图标  
                }, {  
                    id: 2,  
                    title: '2', // String  
                    latitude: 39.90,  
                    longitude: 116.39,  
                    callout: {  
                        color: '#007AFF', // 文本颜色  
                        bgColor: '#563BFF', // 背景色  
                        display: "ALWAYS", // 'BYCLICK':点击显示; 'ALWAYS':常显  
                        fontSize: 15,  
                        textAlign: 'left', // 文本对齐方式。有效值: left, right, center  
                        padding: 10, // 文本边缘留白  
                        borderRadius: 5,  
                        content: '腾讯地图',  
                    },  
                    label: {  
                        content: 'Jeskson',  
                        color: '#000000',  
                        fontSize: 12,  
                        borderWidth: 12,  
                        borderColor: '#007AFF',  
                        borderRadius: 5,  
                        padding: 5,  
                        textAlign: 'center',  
                        bgColor: '#563BFF',  
                    },  
                    iconPath: '../../static/image/my.png'  
                }],
2024-03-27 12:15 负责人:无 分享
已邀请:
JXWang

JXWang

<map> 组件的宽/高推荐写直接量,比如:750rpx,不要设置百分比值,或者给它的父组件设置固定宽高

要回复问题请先登录注册