svgmap 全国世界地图不同显示方式demo效果合集代码
代码语言:html
所属分类:图表
代码描述:svgmap 全国世界地图不同显示方式demo效果合集代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>SVG 地图</title>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery.17.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/raphael.min.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/svgmap.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/chinaMapConfig.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/worldMapConfig.js"></script>
<style type="text/css">
/* base */
html {
background: #fff;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%
}
body,ul,ol,dl,dd,h1,h2,h3,h4,h5,h6,p,form,fieldset,legend,input,textarea,select,button,th,td,div {
margin: 0;
padding: 0
}
button,input,select,textarea {
font: 12px/1.5 tahoma,Helvetica,arial,\5b8b\4f53
}
input,select,textarea {
font-size: 100%
}
table {
border-collapse: collapse;
border-spacing: 0
}
th {
text-align: inherit
}
fieldset,img {
border: 0
}
iframe {
display: block
}
ol,ul,li {
list-style: none
}
del {
text-decoration: line-through
}
ins,a {
text-decoration: none
}
a:focus {
outline: none
}
h1,h2,h3,h4,h5,h6 {
font-size: 100%
}
.clear {
clear: both
}
.clearfix:after {
content: ".";
display: block;
height: 0;
font-size: 0;
clear: both;
visibility: hidden
}
.clearfix {
zoom: 1
}
/* base */
body {
font: 12px/1.5 "Lucida Grande","Lucida Sans Unicode", Tahoma, SimSun,Helvetica,sans-serif;
color: #2E313A;
}
.wrap {
width: 900px;
margin: 0 auto;
border-left: 1px solid #DDD;
border-right: 1px solid #DDD;
}
a {
color: #0e4279;
-moz-transition: color 0.3s ease 0s;
}
a:hover {
color: #5B636A;
}
h1 {
padding: 20px 0 0 20px;
font-size: 24px;
line-height: 50px;
}
h2 {
margin-top: 30px;
padding-left: 10px;
background-color: #ddd;
font-size: 14px;
line-height: 30px;
}
/* 提示自定义 */
.stateTip, #StateTip {
display: none;
position: absolute;
padding: 8px;
background: #fff;
border: 2px solid #2385B1;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
font-size: 12px;
font-family: Tahoma;
color: #333;
}
.mapInfo i {
display: inline-block;
width: 15px;
height: 15px;
margin-top: 5px;
line-height: 15px;
font-style: normal;
background: #aeaeae;
color: #fff;
font-size: 11px;
font-family: Tahoma;
-webkit-border-radius: 15px;
border-radius: 15px;
text-align: center
}
.mapInfo i.active {
background: #E27F21;
}
.mapInfo span {
padding: 0 5px 0 3px;
}
.mapInfo b {
font-weight: normal;
color: #2770B5
}
</style>
<script type="text/javascript">
$(function() {
$('#ChinaMap').SVGMap({
mapName: 'china'
});
$('#ChinaMap1').SVGMap({
mapName: 'china',
mapWidth: 600,
mapHeight: 500
});
$('#ChinaMap2').SVGMap({
mapName: 'china',
stateData: {
'heilongjiang': {
'stateInitColor': 1, 'baifenbi': 0.236
},
'beijing': {
'stateInitColor': 2
},
'shanghai': {
'stateInitColor': 3
},
'tianjin': {
'stateInitColor': 4
},
'sichuan': {
'stateInitColor': 5
},
'shandong': {
'stateInitColor': 6
},
'shanxi': {
'stateInitColor': 3
},
'zhejiang': {
'stateInitColor': 4
},
'jiangshu': {
'stateInitColor': 2
},
'hunan': {
'stateInitColor': 4
},
'guizou': {
'stateInitColor': 5
},
'neimenggu': {
'stateInitColor': 6
},
'henan': {
'stateInitColor': 3
},
'gansu': {
'stateInitColor': 4
},
'ningxia': {
'stateInitColor': 2
},
'jilin': {
'diabled': true
}
}
});
$('#ChinaMap3').SVGMap({
mapName: 'china',
stateDataType: 'xml',
// stateSettingsXmlPath: 'chinaMapSettings.xml'
// <?xml version="1.0" encoding="utf-8".........完整代码请登录后点击上方下载按钮下载查看
















网友评论0