markerJVectorMap中的样式

markerStyle in JVectorMap

本文关键字:样式 markerJVectorMap      更新时间:2024-02-06

我正在尝试从http://jvectormap.com/examples/markers-world/但我很难将背景图像应用于标记

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

markerStyle: {
      initial: {
        fill: '#F8E23B',
        stroke: '#383f47',
        background: 'url("image.jpg") no-repeat 0 0 transparent'
      }
    },

找到替代选项

jvectormap:如何在标记标签/工具提示中实现HTML而不是简单的字符串?

$('#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());                
    }
});