首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >markerStyle in JVectorMap

markerStyle in JVectorMap
EN

Stack Overflow用户
提问于 2013-12-03 15:45:41
回答 1查看 1.5K关注 0票数 0

我正在尝试使用http://jvectormap.com/examples/markers-world/的标记样式,但我很难将背景图像应用于这些标记

背景属性在这里不起作用,有什么指示吗?

代码语言:javascript
运行
复制
markerStyle: {
      initial: {
        fill: '#F8E23B',
        stroke: '#383f47',
        background: 'url("image.jpg") no-repeat 0 0 transparent'
      }
    },
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-12-09 15:32:43

找到另一种选择

jvectormap: How to implement HTML instead of simple string in the markers label/tooltip?

代码语言:javascript
运行
复制
$('#map').vectorMap({
    markerStyle: {
      initial: {
        fill: '#F8E23B',
        stroke: '#383f47'
      }
    },
    backgroundColor: '#383f47',
    markers: [
      {latLng: [46.90, 8.45], name: "My marker name"}
    ],
    onMarkerLabelShow: function(event, label, code) {
     label.html("<img src=\"img/logo.png\"><br>"+ label.html());                
    }
});
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20355518

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档