Skip to content

Instantly share code, notes, and snippets.

@js1568
js1568 / L.TopoJSON.js
Last active August 29, 2015 13:57 — forked from rclark/L.TopoJSON.js
/*
You'll need something like this in your HTML:
<script src="http://d3js.org/topojson.v1.min.js"></script>
*/
L.TopoJSON = L.GeoJSON.extend({
addData: function(jsonData) {
if (jsonData.type === "Topology") {
for (key in jsonData.objects) {
geojson = topojson.feature(jsonData, jsonData.objects[key]);