Skip to content

Instantly share code, notes, and snippets.

@mpmckenna8
mpmckenna8 / d3.geo.raster.js
Last active August 31, 2015 18:52 — forked from emeeks/d3.geo.raster.js
Mapbox tiles on a d3.globe, oh gosh
// Copyright 2014, Jason Davies, http://www.jasondavies.com/
(function() {
d3.geo.raster = function(projection) {
var path = d3.geo.path().projection(projection),
url = null,
scaleExtent = [0, Infinity],
subdomains = ["a", "b", "c", "d"];
var reprojectDispatch = d3.dispatch('reprojectcomplete');
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.graticule {
fill: none;
stroke: #777;
}
.boundary {
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.background {
fill: none;
pointer-events: all;
}
#states {

Building on this - experimenting with fake 3d svg arcs using two nested orthographic projections and cardinal line interpolation.

<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.6.0"></script>
</head>
<body>
<svg>
<defs>
<mask id="rekt">
<g id="rrr">
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
var width = 960,
height = 500;