收藏
回答

地图组件marker的使用问题

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug map 工具 666 2.0.9

地图组件的marker的label为什么不能居中呢, 点击地图上的图标,callout 也没法弹出


markers: [{

id: 1,

latitude: 23.099994,

longitude: 113.324520,

name: 'T.I.T 创意园',

callout:{

content:"将大幅降价"

},

label: {

content: "将大幅降价",

textAlign:"center"

}

}],



回答关注问题邀请回答
收藏

5 个回答

  • 晨
    2018-06-29

    麻烦给个相关的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),我们定位下问题

    2018-06-29
    有用 1
    回复
  • 1璐U你
    1璐U你
    2018-08-01

    我现在要在 marker 上显示数字,我现在通过判断几位数来动态设置左移多少像素。很蠢,但目前感觉没什么其他好的办法。

    2018-08-01
    有用
    回复
  • Narney
    Narney
    2018-08-01

    同问, 怎么居中

    2018-08-01
    有用
    回复
  • ZengLH
    ZengLH
    2018-06-29

    就是你们例子里的

    wechatide://minicode/3uVxpmmT6wY9


    我把markers里的数据改成这样的


    markers: [{

    id: 1,

    latitude: 23.099994,

    longitude: 113.324520,

    title: 'T.I.T 创意园',

    callout:{

    content:"calloutcallout",

    display: "ALWAYS",

    textAlign: "center",

    bgColor: "#fff",

    padding: 10,

    },

    label: {

    content: "label",

    textAlign:"center",

    bgColor:"#fff",

    padding:10,

    //   anchorX: -10, anchorY: -10,

    //   x: -10, y: -30,

    }

    }],


    显示成这个样子




    2018-06-29
    有用
    回复
  • 远山
    远山
    2018-06-29

    同问,label怎么居中?或者可不可以添加一个map 属性,让一些文字内容在maker正下居中位置

    2018-06-29
    有用
    回复
登录 后发表内容