安卓手机上切换卫星地图无效 uni-app

安卓手机上切换卫星地图无效 uni-app

开发环境 版本号 项目创建方式
Windows 7 HBuilderX

产品分类:uniapp/App

PC开发环境操作系统:Windows

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

HBuilderX类型:正式

HBuilderX版本号:4.55

手机系统:Android

手机系统版本号:Android 9.0

手机厂商:华为

手机机型:huawie mate 20 pro

页面类型:vue

vue版本:vue2

打包方式:云端

示例代码:

<map id="mapId" style="width: 750rpx; height: 100%" :latitude="mapObj.latitude"  
longitude="mapObj.longitude" :scale="mapObj.scale" :markers="mapObj.markers" enable-satellite="true"
@markertap="handleRosMarker" :show-location="true">  
    <cover-view class="absoluteMainImg">  
        <cover-image src="/static/img/common/imeLocation.png" class="absoluteImg"  
            @click="handleImeiLocation"></cover-image>  
    </cover-view>  
</map>

操作步骤:

<map id="mapId" style="width: 750rpx; height: 100%" :latitude="mapObj.latitude"  
longitude="mapObj.longitude" :scale="mapObj.scale" :markers="mapObj.markers" enable-satellite="true"
@markertap="handleRosMarker" :show-location="true">  
</map>

预期结果:

<map id="mapId" style="width: 750rpx; height: 100%" :latitude="mapObj.latitude"  
longitude="mapObj.longitude" :scale="mapObj.scale" :markers="mapObj.markers" enable-satellite="true"
@markertap="handleRosMarker" :show-location="true">  
</map>

实际结果:

<map id="mapId" style="width: 750rpx; height: 100%" :latitude="mapObj.latitude"  
longitude="mapObj.longitude" :scale="mapObj.scale" :markers="mapObj.markers" enable-satellite="true"
@markertap="handleRosMarker" :show-location="true">  
</map>

bug描述:

【报Bug】安卓手机上,切换卫星地图无效


更多关于安卓手机上切换卫星地图无效 uni-app的实战教程也可以访问 https://www.itying.com/category-93-b0.html

1 回复

更多关于安卓手机上切换卫星地图无效 uni-app的实战教程也可以访问 https://www.itying.com/category-93-b0.html


这个问题可能是由于Android平台对地图卫星视图支持的限制导致的。以下是几个可能的原因和解决方案:

  1. 确保已正确配置地图SDK:
  • 检查manifest.json中是否已正确配置地图供应商(如高德或腾讯地图)
  • 确认已申请并配置了正确的API密钥
  1. 动态切换卫星视图: 尝试通过动态绑定属性来切换:
data() {
  return {
    enableSatellite: false
  }
},
methods: {
  toggleSatellite() {
    this.enableSatellite = !this.enableSatellite
  }
}
回到顶部