哈哈哈888                                                                                
                                        
                                - 发布:2023-01-30 10:35
 - 更新:2023-12-26 19:10
 - 阅读:2288
 
最佳回复
使用下面的代码验证下是否正常,另外:使用bug反馈模板反馈以提供更多信息
<template>  
  <view class="content">  
    <map class="map" id="map1" ref="map1" :controls="controls" :scale="scale" :longitude="location.longitude"  
      :latitude="location.latitude" :show-location="showLocation" :rotate="rotate" :skew="skew" show-scale="true"  
      :markers="markers" enable-building=true enable-indoorMap="true" @callouttap="oncallouttap">  
      <cover-view slot="callout">  
        <cover-view marker-id="1">  
          <cover-image class="icon" src="/static/logo.png"></cover-image>  
          <cover-view class="test">  
            customCallout  
          </cover-view>  
        </cover-view>  
      </cover-view>  
    </map>  
  </view>  
</template>  
<script>  
  const testMarkers = [{  
    id: 1,  
    latitude: 39.9086920000,  
    longitude: 116.3974770000,  
    title: '天安门',  
    zIndex: '1',  
    iconPath: '/static/gif.gif',  
    width: 40,  
    height: 40,  
    anchor: {  
      x: 0.5,  
      y: 1  
    },  
    callout: {  
      content: '首都北京\n天安门',  
      color: '#00BFFF',  
      fontSize: 12,  
      borderRadius: 2,  
      borderWidth: 0,  
      borderColor: '#333300',  
      bgColor: '#CCFF11',  
      padding: '1',  
      display: 'ALWAYS'  
    },  
    customCallout: {  
      anchorY: 0,  
      anchorX: 0,  
      display: 'ALWAYS'  
    }  
  }];  
  export default {  
    data() {  
      return {  
        location: {  
          longitude: 116.3974770000,  
          latitude: 39.9086920000  
        },  
        controls: [{  
          id: 1,  
          position: {  
            left: 5,  
            top: 180,  
            width: 30,  
            height: 30  
          },  
          iconPath: '/static/logo.png',  
          clickable: true  
        }],  
        showLocation: false,  
        scale: 13,  
        enableZoom: true,  
        polyline: [],  
        markers: testMarkers,  
        polygons: [],  
        circles: [],  
        includePoints: [],  
        rotate: 0,  
        skew: 0  
      }  
    },  
    methods: {  
      oncallouttap(e) {  
        uni.showModal({  
          content: JSON.stringify(e)  
        })  
      }  
    }  
  }  
</script>  
<style>  
  .content {  
    flex: 1;  
  }  
  .map {  
    width: 750rpx;  
    height: 250px;  
    background-color: #f0f0f0;  
  }  
  .icon {  
    width: 20px;  
    height: 20px;  
  }  
  .scrollview {  
    flex: 1;  
    padding: 10px;  
  }  
  .list-item {  
    flex-direction: row;  
    flex-wrap: nowrap;  
    align-items: center;  
    padding: 5px 0px;  
  }  
  .list-text {  
    flex: 1;  
  }  
  .button {  
    margin-top: 5px;  
    margin-bottom: 5px;  
  }  
</style>  
                                        
            
            
            

            
哈哈哈888 (作者)
没有修复啊 HBuilderX 3.7.1.20230210-alpha里还是没有显示,华为荣耀20s手机
2023-02-13 17:03
DCloud_Android_THB
回复 哈哈哈888: 你的测试demo里面
改为:
2023-02-14 16:02
哈哈哈888 (作者)
回复 DCloud_Android_THB:用 uni.request获取数据循环渲染,安卓时隐时现,ios不显示
2023-02-15 13:22
DCloud_Android_THB
回复 哈哈哈888: 没太懂 发个视频看看
2023-02-15 17:07
哈哈哈888 (作者)
回复 DCloud_Android_THB: 已发附件,customCallout设置的常显,regionchange移动的时候添加的
2023-02-15 17:22
DCloud_Android_THB
回复 哈哈哈888: 没看到附件
2023-02-15 17:38
哈哈哈888 (作者)
回复 DCloud_Android_THB: 已发,麻烦看下
2023-02-16 08:47
哈哈哈888 (作者)
你好,现在markers改变后地图上的点还是不会更新
2024-04-02 08:45