Created
December 7, 2012 20:03
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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