while
while
  • 发布:2023-11-11 11:29
  • 更新:2023-11-13 18:59
  • 阅读:334

【报Bug】app端地图平面图和卫星图切换问题,hbuilderx 3.7.11

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 10

HBuilderX类型: 正式

HBuilderX版本号: 3.7.11

手机系统: Android

手机系统版本号: Android 11

手机厂商: 小米

手机机型: xiaomi5

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

                :style="{height: mapHeight,marginTop: statusBarHeight}"  
                    id="maps"  
                    ref="maps"  
                    :show-scale="true"  
                    :latitude="latitude"  
                    :longitude="longitude"  
                    :markers="covers"  
                    :scale="scale"  
                    :polygons="polygonsData"  
                    :polyline="polylineData"  
                    :enable-satellite="enableSatellite"  
                    :show-location="showLocation"  
                    @markertap="chooseItem"  
                    @tap="clickMap"  
                >  
                <cover-view slot="callout">  
                    <cover-view class="customCallout" marker-id="123">  
                        <text style="font-size: 10px;color: #00BFFF;">测试</text>  
                    </cover-view>  

                </cover-view>  
                </map> ```, ```changeMapStyle () {  
                this.wxAc = !this.wxAc  
                console.log('改变卫星图')  
                uni.$emit('resourceSatellite', this.wxAc)  
            },          uni.$on('resourceSatellite', function(data) {  
            console.log(data)  
            this.enableSatellite = data  
            // this.$set(this, this.enableSatellite, data)  
            var mapContext = uni.createMapContext('maps', this)  
        }) ``` 

操作步骤:

在subnvue页面点击按钮切换卫星图触发$emit,接收到事件了,值赋值了,地图未切换

预期结果:

实现卫星图和平面图的切换

实际结果:

未实现动态切换

bug描述:

nvue页面切换卫星图和平面图无效, <map class="mapwh" style="{height: mapHeight,marginTop: statusBarHeight}" id="maps"
ref="maps" show-scale="true" latitude="latitude" longitude="longitude" markers="covers" scale="scale" polygons="polygonsData" polyline="polylineData" enable-satellite="enableSatellite" show-location="showLocation" @markertap="chooseItem"
@tap="clickMap"
>,在subnvue页面通过$emit触发事件,地图页面$on接收事件,然后改变enableSatellite的值,真机和模拟器都没有效果,没有在平面图和卫星图之间切换
2023-11-11 11:29 负责人:无 分享
已邀请:
while

while (作者) - 为3

有大佬来帮忙看下吗,uniapp做地图以前都是用webview来做,这次用map组件遇到更多的问题了,地图咋手动刷新啊?

while

while (作者) - 为3

地图都是用的nvue页面来写的

while

while (作者) - 为3

有官方大佬帮忙解答下吗

while

while (作者) - 为3

有人遇到过这种过这种切换的需求吗,咋解决的

while

while (作者) - 为3

这里面设置v-if控制地图显示都不行

要回复问题请先登录注册