Testing the topojson.presimplify function that is used in Dynamic Simplification examples. It's included in this stripped-down example just for testing purposes: seems to work like a charm in most browsers but for a topojson file with much detail (like the county map here), Firefox chokes on topojson.presimplify.
Testing the topojson.presimplify function that is used in Dynamic Simplification examples. It's included in this stripped-down example just for testing purposes: seems to work like a charm in most browsers but for a topojson file with much detail (like the county map here), Firefox chokes on topojson.presimplify.
An attempt to combine D3 zoomable map tiles and dynamic simplification. Simplification and redrawing occurs only at discrete zoom levels for performance reasons; a scale transformation is used in between.
<html> | |
<head> | |
<title>A Leaflet map!</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/> | |
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> | |
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<style> | |
#map{ height: 100% } | |
</style> | |
</head> |
// creates GeoJSON features (using Turfjs) for square grid cells in the Mercator projection | |
function grid(minX,minY,maxX,maxY,size){ // arguments are in projected mercator units; conversion functions below | |
var x = minX, | |
y = minY, | |
cells = [], | |
x0, | |
y0, | |
x1, | |
y1; |
Doug Greenfield (@MapOfTheWeek) made a perfect map projection example for Maptime Boston: rat projections! Using his world rat shapefile, here's an interactive version. As always, this is based on on the D3 Map Projection Transitions example by Jason Davies.
#ratmap!
A ton of overlapping polygons, representing neighborhoods that people drew and named. (GeoJSON here.) Well-known neighborhoods will have many polygons with the same name, and similar shapes.
A summary map of polygons representing the area where each neighborhood name is dominant. That is, the area where a given neighborhood name is used more than any other neighborhood name.
var g = symbols.append("g"), | |
statePath = d3.select( /* selector for the state polygon */ ), | |
centroid = path.centroid( statePath.datum() ); | |
var total = // whatever the total number of dots is | |
dotDiameter = 4, | |
dist = 0, | |
circumference = 0, | |
canFit = 1, | |
count = 0, |