欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

小程序使用地图插件marker属性中的气泡框在ios中无法正常显示

程序员文章站 2022-06-19 17:44:49
这段代码在ios系统中无法正常显示!markers.splice(1, 1, { iconPath: '/static/dangqian.png', id: 1, title: '当前位置', width, height, latitude: this.data.nowNavigation.latitude, longitude: this.data.nowNavigation.longitud...

这段代码在ios系统中无法正常显示!

markers.splice(1, 1, {
        iconPath: '/static/dangqian.png',
        id: 1,
        title: '当前位置',
        width,
        height,
        latitude: this.data.nowNavigation.latitude,
        longitude: this.data.nowNavigation.longitude,
        callout: {
          content: '距离终点:' + this.data.navigationDis,
          color: 'black',
          fontSize: 15,
          borderRadius: 30,
          bgColor: 'white',
          padding: 10,
          textAlign: 'center',
          display: 'ALWAYS'
        },
      })

callout属性中的color字体颜色、和bgColor背景颜色的问题!

效果如下:
小程序使用地图插件marker属性中的气泡框在ios中无法正常显示
蓝色图标上并没有出现气泡框!

修改代码后:

markers.splice(1, 1, {
        iconPath: '/static/dangqian.png',
        id: 1,
        title: '当前位置',
        width,
        height,
        latitude: this.data.nowNavigation.latitude,
        longitude: this.data.nowNavigation.longitude,
        callout: {
          content: '距离终点:' + this.data.navigationDis,
          // color: 'black',
          fontSize: 15,
          borderRadius: 30,
          bgColor: '#ffffff',
          padding: 10,
          textAlign: 'center',
          display: 'ALWAYS'
        },
      })

将color属性删除,并且bgColor的值用十六进制颜色表示就ok!

效果如下:
小程序使用地图插件marker属性中的气泡框在ios中无法正常显示

本文地址:https://blog.csdn.net/qq_45547674/article/details/111883127