Skip to content

Instantly share code, notes, and snippets.

@shawnbot
Created March 6, 2012 01:00
Show Gist options
  • Save shawnbot/1982587 to your computer and use it in GitHub Desktop.
Save shawnbot/1982587 to your computer and use it in GitHub Desktop.
Stamen tiles in popular map engines
// replace "toner" here with "terrain" or "watercolor"
var layer = "toner";
var map = new google.maps.Map(document.getElementById("element_id"), {
center: new google.maps.LatLng(37.7, -122.4),
zoom: 12,
mapTypeId: layer,
mapTypeControlOptions: {
mapTypeIds: [layer]
}
});
map.mapTypes.set(layer, new google.maps.StamenMapType(layer));
// replace "toner" here with "terrain" or "watercolor"
var layer = new L.StamenTileLayer("toner");
var map = new L.Map("element_id", {
center: new L.LatLng(37.7, -122.4),
zoom: 12
});
map.addLayer(layer);
// replace "toner" here with "terrain" or "watercolor"
var layer = new MM.StamenTileLayer("toner");
var map = new MM.Map("element_id", layer);
map.setCenterZoom(new MM.Location(37.7, -122.4), 12);
// replace "toner" here with "terrain" or "watercolor"
var layer = new OpenLayers.Layer.Stamen("toner");
var map = new OpenLayers.Map("element_id");
map.addLayer(layer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment