9***@qq.com
9***@qq.com
  • 发布:2019-04-18 13:58
  • 更新:2021-03-31 11:18
  • 阅读:6048

地图map组件的markers时显示时不显示

分类:uni-app

uniapp里地图map组件的markers时显示时不显示,h5和微信小程序版都一直显示正常‘
代码如下

<template>  
    <view>  
        <view class="page-body">  
            <view class="page-section page-section-gap">  
                <map scale="13" @markertap="mktap" style="position: absolute;height: 100%; width: 100%; " :latitude="latitude" :longitude="longitude" :markers="markers">  
                </map>  
            </view>  
        </view>  
    </view>  
</template>  

<script>  
    var _self;  
    export default {  
        data() {  
            return {  
                height:0,  
                title: '首页',  
                latitude: 39.909,  
                longitude: 116.39742,  
                markers: [{  
                    id:'1',  
                    label:{  
                        content:'店铺1'  
                    },  
                    latitude: 39.909,  
                    longitude: 116.39742,  
                    width:80,  
                    height:80,  
                    iconPath: '/static/shop.png'  
                }, {  
                    id:'2',  
                    label:{  
                        content:'店铺2'  
                    },  
                    latitude: 39.90,  
                    longitude: 116.39,  
                    width:80,  
                    height:80,  
                    iconPath: '/static/shop.png'  
                }]  
            }  
        },        
        onLoad:function(options){  
            _self = this;  
            //uni.getSystemInfo({  
            //  success: function (res) {  
            //      _self.height = res.windowHeight;  
            //  }  
            //});  
        },  
        methods: {  
            mktap(e){  
                uni.navigateTo({  
                    url: '../jishi/jishi?id='+e.mp.markerId  
                });  
            }  
        }  
    }  
</script>
2019-04-18 13:58 负责人:无 分享
已邀请:
weiwin123

weiwin123 - 90后闷烧迷茫it男

一样,请问你解决了吗?

  • 9***@qq.com (作者)

    没有,后来没用地图 就没继续关注了

    2020-04-05 21:36

  • 1***@qq.com

    我有时候进去显示,有时候进去不显示,你是怎么解决的?

    2020-06-10 14:23

w***@163.com

w***@163.com

我也有同样的问题

  • 1***@163.com

    我这里也是这个问题, 在小程序里时显时不显的,你解决了吗

    2020-04-26 14:58

  • w***@163.com

    回复 1***@163.com: 嗯。

    我的经度和纬度是从服务器获取的,我给map标签加了v-if,让它在得到服务器传来的数据后再渲染,结果可以显示markers。但我还不清楚为什么这样就可以。

    不过现在显示的markers不是我让它显示的图标.....也不知道怎么回事

    2020-05-02 16:43

  • 1***@qq.com

    我有时候进去显示,有时候进去不显示,你是怎么解决的?

    2020-06-10 14:23

孙逊大神

孙逊大神 - 123

我也遇到了,是我本来用的公共包名注册的高德地图key,然后用了自有证书之后就要重新申请的key

caomengyue

caomengyue

你们都解决了吗,我也遇到了

该问题目前已经被锁定, 无法添加新回复