<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>可拖动的地图</title>
</head>
<style>
.link {
stroke: #ccc;
stroke-width: 1;
}
</style>
<body>
<script src = "d3.js"></script>
<script src = "js/movemap.js"></script>
</body>
</html>
一、常规设置:
var width = 1000,
height = 1000;
var svg = d3.select("body").append("svg")
.attr("width",width)
.attr("height",height)
.append("g")
.attr("transform","translate(0,0)")
var color = d3.scale.category20()
二、定义投影函数:
var projection = d3.geo.mercator()
.center(