stamen / modestmaps-js

Modest Maps javascript port
http://modestmaps.com
566 stars 152 forks source link

Coordinate -> Extent #118

Closed tmcw closed 8 years ago

tmcw commented 12 years ago

Since coordinates are 1:1 with extents, it might be useful to make this programmatic for people who want to write non-image tile layers. Thoughts?

migurski commented 12 years ago

Explain more?

tmcw commented 12 years ago

Like, your map provider is given a coordinate per tile to provide. If you want to provide tiled html points, you could do something like a

points.filter(coord.toExtent().containsLocation())

to filter them. This might be unnecessary abstraction, though.

migurski commented 12 years ago

So it would be a replacement for getting the top-left and bottom-right locations of a tile coordinate? I think it makes sense, but would need to live in the projection object that understands how to map coordinates to locations and back.

So:

projection.coordinateExtent(coord)

?