【发布时间】:2014-11-01 09:40:01
【问题描述】:
我必须自定义一个地图才能在 jvector 地图中使用它。所以我使用内联SVG 来制作地图。该地图显示完美,但我无法使用 jvectormap 对其进行操作。我只是 jvectormap 的初学者,所以我的代码可能有点错误。如果您有任何想法,请接受任何答案。
提前致谢。
这是我的代码:
<div id="pantsun" >
<svg title="well" width="500" height="300" style="border: 1px solid #000;background-color: lightgreen;" >
<rect x="200" y="0" width="30" height="300" style="fill:white;" />
<rect x="0" y="50" width="500" height="30" style="fill:white;" />
<rect x="0" y="150" width="500" height="30" style="fill:white;" />
<rect x="10" y="18" width="30" height="30" style="fill:darkgrey;" />
<rect x="45" y="18" width="30" height="30" style="fill:darkgrey;" />
Sorry, your browser does not support inline SVG.
</svg>
</div>
<script>
$(function(){
$('#pantsun').vectorMap({
map: 'well',
backgroundColor: 'transparent',
markers: [{
coords: [0, 50],
name: 'well 1',
style: {fill: 'white'}
},{
coords: [0, 150],
name: 'well 2',
style: {fill: 'white'}
}}};
</script>
我想做的是在这个link.
【问题讨论】:
标签: javascript jquery svg jvectormap