Skip to content

Instantly share code, notes, and snippets.

@kristopherjohnson
Created December 7, 2012 20:03
Show Gist options
  • Save kristopherjohnson/4236088 to your computer and use it in GitHub Desktop.
Save kristopherjohnson/4236088 to your computer and use it in GitHub Desktop.
OpenLayers example from chapter 1 of "OpenLayers 2.10" by Eric Hazard, translated to Jade
doctype 5
html
head
title My OpenLayers Map
script(src='OpenLayers.js')
script
function init() {
map = new OpenLayers.Map('map_element', {});
var wms = new OpenLayers.Layer.WMS(
'OpenLayers.WMS',
'http://vmap0.tiles.osgeo.org/wms/vmap0',
{layers: 'basic'},
{});
map.addLayer(wms);
if (!map.getCenter()) {
map.zoomToMaxExtent();
}
}
body(onload='init();')
#map_element(style='width: 500px; height: 500px;')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment