微信小程序map地图白屏不显示标记marker-填坑日记

微信小程序map地图的标记markers好好的,几个月后打开一片空白,真是无语,各种百度,后来发现是height:100%不支持!!!!!改成 height: 1200rpx;就可以了,非常无语

<map id="myMap"  markers="{
    
    {markers}}" show-location   longitude="{
    
    {longitude}}" latitude="{
    
    {latitude}}" />
Page({
    
    
 data: {
    
    
    latitude: 23.099994,
    longitude: 113.324520,
    markers: [{
    
    
      id: 2828,
      latitude: 23.099994,
      longitude: 113.324520,
      name: 'T.I.T 创意园',
      iconPath: "../../images/location.png",
      desc: '我现在的位置',
      title: 'T.I.T 创意园',
      width: 20,
      height: 30,
      callout: {
    
    
        content: 'T.I.T 创意园',
        color: '#000000',
        bgColor: '#ffffff', //需要6位的色值有效
        fontSize: 16,
        borderRadius: 2,
        padding: 5,
        display: 'BYCLICK' //'BYCLICK':点击显示; 'ALWAYS':常显
      }
    }],
    
  },
 })
map {
    
    
  width: 100%;
   /* 改成 height: 100%就不行,神奇的罪恶之源*/
  height: 1200rpx;
  color: red;
 }

猜你喜欢

转载自blog.csdn.net/weixin_41884808/article/details/117745238
今日推荐