Created
December 11, 2011 19:43
-
-
Save bmount/1462337 to your computer and use it in GitHub Desktop.
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
// Add G, [minx, miny, maxx, maxy] as a bbox option to polymaps, after line 212: | |
case "G": { | |
var nw = po.map.coordinateLocation({row: c.row, column: column, zoom: c.zoom}), | |
se = po.map.coordinateLocation({row: c.row + 1, column: column + 1, zoom: c.zoom}), | |
pn = Math.ceil(Math.log(c.zoom) / Math.LN2); | |
return nw.lon.toFixed(pn) | |
+ "," + se.lat.toFixed(pn) | |
+ "," + se.lon.toFixed(pn) | |
+ "," + nw.lat.toFixed(pn); | |
} | |
// Then add your geojson | |
map.add(po.geoJson() | |
.url("http://localhost:5984/sf_bike_ped_acc/_design/gc-utils/_spatial/_list/geojson/geoms?bbox={G}") | |
// Should be able to write one function with a number, per zoom level, like geojson_{num} and do a full tms style map in polymaps: | |
map.add(po.geoJson() | |
.url("http://localhost:5984/sf_bike_ped_acc/_design/gc-utils/_spatial/_list/geojson_{Z}/geoms?bbox={G}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment