Overview Examples Documentation Download


© 2010 CloudMade, OpenStreetMap contributors, CCBYSA.

Lat-Lon Grid

The built-in grid control draws lines of constant latitude and longitude over the map. The grid reveals that the spherical mercator projection is cylindrical: longitudes are uniformly spaced. Zoom out to see the exaggeration of latitudes near the poles caused by the log-tan transform.

The lines are subdivided as you zoom in to maintain constant apparent density—useful for debugging tiles! A future enhancement of this control might display proper major and minor ticks, as well as labels to show the visible latitudes and longitudes.

The map background is an image layer from CloudMade. Register a developer account with CloudMade for your own API key.

Source Code

var po = org.polymaps;

var map = po.map()
    .container(document.getElementById("map").appendChild(po.svg("svg")))
    .add(po.interact());

map.add(po.image()
    .url(po.url("http://{S}tile.cloudmade.com"
    + "/1a1b06b230af4efdbb989ea99e9841af" // http://cloudmade.com/register
    + "/998/256/{Z}/{X}/{Y}.png")
    .hosts(["a.", "b.", "c.", ""])));

map.add(po.grid());

map.add(po.compass()
    .pan("none"));
Polymaps is a project from SimpleGeo and Stamen.