polemin
polemin
  • 发布:2020-02-26 07:26
  • 更新:2022-04-14 14:48
  • 阅读:2610

uni map scale熟悉设置无效问题

分类:uni-app

<map id="map1" class="map" :latitude="location.latitude" :longitude="location.longitude" :scale="18">
代码 scale属性设置无效 请问一下有知道解决方案的吗?

2020-02-26 07:26 负责人:无 分享
已邀请:
DCloud_uniAD_HDX

DCloud_uniAD_HDX

请提供示例代码?vue 还是 nvue?

  • polemin (作者)

    <template>

    <view>

    <map id="map1" class="map" :latitude="location.latitude" :longitude="location.longitude" :scale="18">

    <cover-image src="../../static/index/dingwei.png" class="dingwei" @click="getlocation"></cover-image>

    </map>

    <view class="index-h1">

    附近垃圾桶

    </view>

    <scroll-view scroll-y="true" class="scroll-y">

    <block v-for="(item,index) in address" :key="index">

    <indexlistx :item="item" :index="index"></indexlistx>

    </block>

    </scroll-view>

    </view>


    </template>

    2020-02-28 21:02

  • polemin (作者)

    vue

    2020-02-28 21:02

  • 5***@qq.com

    nvue下,getCenterLocation无反应

    this.map = uni.createMapContext("map",this);

    this.map.getCenterLocation({

    type: 'gcj02',

    success: function(res){

    console.log(res)

    },

    fail:function(res){

    console.log(res)

    }

    })

    2020-03-14 10:48

1***@qq.com

1***@qq.com

2021年了,问题还在!!!

z***@126.com

z***@126.com

2022年了,问题还在!!!

DCloud_uniAD_HDX

DCloud_uniAD_HDX

Bug已确认,当前版本绕过方案
1 获取原生map对象 $getAppMap
2 调用plus api setZoom() https://www.html5plus.org/doc/zh_cn/maps.html#plus.maps.Map.setZoom

  • ererere

    https://ask.dcloud.net.cn/question/89539 请解决

    2020-03-05 19:26

  • DCloud_uniAD_HDX

    回复 ererere: 好的

    2020-03-05 20:48

  • ditan123

    plus.maps.Map.setZoom is not a function报错了 怎么使用 。现在高德地图scale设置无效

    2020-03-06 11:22

DCloud_uniAD_HDX

DCloud_uniAD_HDX

this.map = uni.createMapContext("map1", this);
this.nativeMap = this.map.$getAppMap();
this.nativeMap.setZoom(18);

  • 5***@qq.com

    nvue下,getCenterLocation无反应


    this.map = uni.createMapContext("map",this);


    this.map.getCenterLocation({


    type: 'gcj02',


    success: function(res){


    console.log(res)


    },


    fail:function(res){


    console.log(res)


    }


    })

    2020-03-14 10:49

  • DCloud_uniAD_HDX

    回复 5***@qq.com: 今天发布2.6.6 修复所有平台map问题

    2020-03-17 10:26

  • 1***@163.com

    回复 DCloud_uniAD_HDX: 除了第一次修改scale的值有反应,之后再修改就没反应了是什么情况啊

    2020-05-15 20:50

DCloud_heavensoft

DCloud_heavensoft

此问题已经在2.6.4修复

  • 8***@qq.com

    H5手指缩放,getScale方法无法获取到当前地图的scale

    2020-04-22 14:36

weiwin123

weiwin123 - 90后闷烧迷茫it男

很明显没有修复

1***@163.com

1***@163.com

这个问题还是没有修复吧? 修改scale的值 没反应

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