用户登录
用户注册

分享至

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

  • 作者: 阿里克谢马克西莫维奇彼什科夫
  • 来源: 51数据库
  • 2021-08-21

这段代码在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背景颜色的问题!

效果如下:

蓝色图标上并没有出现气泡框!

修改代码后:

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!

效果如下:

软件
前端设计
程序设计
Java相关