block by aemkei 1164659

Mercator Projection - 140byt.es

Mercator Projection - 140byt.es

Converts a point from latitude/longitude to pixel coordinates using the Mercator projection.

Demo: http://jsfiddle.net/aemkei/Ls4QU/show/

Usage

mercator(
  latitude, longitude,
  zoomLevel,
  tileSize
)

// returns {x,y} coordinates

Author

Created by Martin Kleppe (@aemkei) at Ubilabs.

DIY

Check his “JavaScript Golf Lessons“ slides.

For more information

See the 140byt.es site for a showcase of entries (built itself using 140-byte entries!), and follow @140bytes on Twitter.

index.js

LICENSE.txt

annotated.js

package.json

test.html