这可能是之前被问到的,但我希望我能得到一个特定于我遇到的问题的答案.我是d3的新手,我现在正试图绘制一个纬度/长度(当我第一次成功时,我将完成其余的工作).感谢专家的任何帮助.谢谢.
尝试在特定区域绘制单元格网站.
这是代码:
<head>
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script src="d3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script src="datamaps.usa.min.js"></script>
<style>
#map {
height: 550px;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map = new google.maps.Map(d3.select("#map").node(), {
zoom: 8,
center: new google.maps.LatLng(32.7830600, -96.8066700),
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: [{
"stylers": [{
"saturation": -75
}, {
"lightness": 10
}]
}]
});
var places = [
{
name: "Site1",
location: {
latitude: 32.7935,
longitude: -97.9619
}
}
]
var projection = d3.geo.albersUsa();
// add circles to svg
svg.selectAll("circle")
.data(places) …
Run Code Online (Sandbox Code Playgroud) d3.js ×1