暮雪骄阳
暮雪骄阳
  • 发布:2020-05-25 06:50
  • 更新:2020-05-27 15:24
  • 阅读:1006

希望官方完善一下地图组件

分类:uni-app

忘了uni-vue下是什么情况了,为了callout的常显,改用了nvue

在<map>添加controls控件,在小程序上controlId取值跟APP上取值不一致,分别取值

if(e.detail.controlId == '0' || e.controlId == '0')

使用cover-image代替controls控件,在小程序上,popup弹窗盖不住cover-image,
在APP上用了透明窗口模拟popup可以盖住

nvue下的APP环境的高德地图,callout 的 显示距离安卓和IOS,不一致,安卓上callout挡住了标注图标,IOS正常,H5和MP正常

markers标注图标在APP上width和height无效

uni.moveToLocation 在 APP-PLUS-NVUE 下无效,在APP-PLUS || H5 || MP正常

安卓,IOS,H5,MP,VUE,NVUE,快绕晕了,多端都要端不住了,恳请官方尽力完善,多环境测试把误差减到最小。
再次跪谢!

2020-05-25 06:50 负责人:DCloud_uniAD_HDX 分享
已邀请:
DCloud_uniAD_HDX

DCloud_uniAD_HDX

微信小程序模拟器的bug,文档和真机都是 e.detail.controlId,我们后期后拉齐这个差异

callout 问题我们排查下

验证nvue marker 和 moveToLocation 没有问题

<template>  
  <view>  
    <map id="map1" class="map1" show-location="true" :latitude="latitude" :longitude="longitude" @regionchange="onregionchange"  
      @markertap="markertap" scale="16" :markers="markers">  
    </map>  
    <button @click="moveToLocation">move to location</button>  
  </view>  
</template>  

<script>  
  export default {  
    data() {  
      return {  
        showCoverView: true,  
        // latitude: 39.989631,  
        // longitude: 116.481018,  
        latitude: 39.925539,  
        longitude: 116.279037,  
        image: "/static/logo.png",  
        markers: [{  
          id: 110,  
          iconPath: '/static/logo.png',  
          latitude: 39.925539,  
          longitude: 116.279037,  
          width: "20",  
          height: "20"  
        }],  
        controls: [{  
          id: 5,  
          iconPath: '/static/logo.png',  
          position: {  
            left: 0,  
            top: 300 - 50,  
            width: 50,  
            height: 50  
          },  
          clickable: true  
        }]  
      }  
    },  
    onReady() {  
      this.mapContext = uni.createMapContext("map1", this);  
    },  
    methods: {  
      moveToLocation() {  
        this.mapContext.moveToLocation({  
          latitude: 39.989631,  
          longitude: 116.581018,  
          success: (res) => {  
            console.log("getCenterLocation");  
            console.log(res);  
          }  
        })  
      }  
    }  
  }  
</script>  

<style>  
  .map1 {  
    width: 750rpx;  
    height: 400px;  
  }  
</style>  
  • 暮雪骄阳 (作者)

    抱歉,我自己的疏忽,组件并没有加上show-location="true",用的静态坐标,一直测试结果就是NVUE上moveToLocation没反应,其他端都没问题。加了show-location="true"之后再获取当前位置,moveToLocation就好使了。感谢启发!这个功能实在重要

    2020-05-27 17:46

  • 6***@qq.com

    麻烦官方看下:moveToLocation移动到指定经纬度在app端ios平台无效,只会移动到当前定位的位置

    2020-06-29 20:45

  • YyJj123123

    大哥,这个现在是有问题的。用你这里的代码验证过,大概啥时候能解决?项目挺急的,又没有其他办法了

    2022-02-08 13:58

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