var places = [ { name: "Wollongong, Australia", location: { latitude: -34.42507, longitude: 150.89315 } }, { name: "Newcastle, Australia", location: { latitude: -32.92669, longitude: 151.77892 } } ] var width = 960 var height = 480 var projection = d3.geo.equirectangular() .scale(153) .translate([width / 2, height / 2]) .precision(.1); var path = d3.geo.path() .projection(projection) var graticule = d3.geo.graticule() var svg = d3.select("#graph").append("svg") .attr("width", width) .attr("height", height) // Map svg.append("path") .datum(graticule) .attr("class", "graticule") .attr("d", path) d3.json("/rpowelll/raw/8312267/world-50m.json", function(error, world) { svg.insert("path", ".graticule") .datum(topojson.feature(world, world.objects.land)) .attr("class", "land") .attr("d", path) svg.insert("path", ".graticule") .datum(topojson.mesh(world, world.objects.countries, function(a, b) { return a !== b })) .attr("class", "boundary") .attr("d", path) }) // Location points svg.selectAll(".pin") .data(places) .enter().append("circle", ".pin") .attr("r", 5) .attr("transform", function(d) { return "translate(" + projection([ d.location.latitude, d.location.longitude ]) + ")" })