relief map of US from http://pubs.usgs.gov/of/1999/of99-011/online.html
border of US from natural earth file
my boundary file's a little off
Last active
August 29, 2015 14:17
-
-
Save jhubley/e850f828df4065b5d8fa to your computer and use it in GitHub Desktop.
relief of US plus boundary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset='utf-8'> | |
<style> | |
/* Style here... */ | |
path#USI { | |
fill: none; | |
stroke: #000; | |
stroke-width:2; | |
} | |
image.bg { | |
opacity: .5; | |
} | |
</style> | |
<div></div> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="http://d3js.org/topojson.v0.min.js"></script> | |
<script> | |
var width = 1000, | |
height = 430; | |
var projection = d3.geo.albers() | |
.rotate([95.8,.2]) | |
.scale(937) | |
.translate([width / 2, height / 2]); | |
var path = d3.geo.path() | |
.projection(projection); | |
var svg = d3.select("body").append("svg") | |
.attr("class", "map") | |
.attr("width", width) | |
.attr("height", height); | |
d3.json("usborder.json", function(error, data) { | |
var us = topojson.object(data, data.objects.usborder); | |
svg.append("image") | |
//.attr("clip-path", "url(#clip)") | |
.attr("xlink:href", "usael.png") | |
.attr("width", width) | |
.attr("height", height) | |
.attr("class", "bg"); | |
svg.selectAll(".cr-subunit") | |
.data(us.geometries) | |
.enter().append("path") | |
.attr("id", function(d) { return "USI"; }) | |
.attr("d", path); | |
svg.append("clipPath") | |
.attr("id", "clip") | |
.append("use") | |
.attr("xlink:href", "#USI"); | |
svg.append("image") | |
.attr("clip-path", "url(#clip)") | |
.attr("xlink:href", "usael.png") | |
.attr("width", width) | |
.attr("height", height) | |
.attr("class", "fg"); | |
}); | |
// Script here... | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment