mapsense / mapsense.js

Mapsense.js
Other
88 stars 22 forks source link

context object with tile as third argument argument to fetch function #21

Open sttawm opened 9 years ago

sttawm commented 9 years ago

It can be useful for transcoders (AKA the "fetch" function) to be aware of the tile's coordinates. Though they are generally available via the url, this is not standardized and is annoying to parse.

The current use-case is binning. Binning involves quantizing a tile, which (in general) requires knowledge of its bounds. Servers may occassionally provide responses with enough information (i.e. via topojson.q), but in general this cannot be assumed.

The context object is nested in order to avoid name-clashes if / when passed to the Queue.js functions.

sttawm commented 9 years ago

I came across another use for this while labeling, where-in I'd like to class the city labels differently according to their zoom.