Skip to content

Instantly share code, notes, and snippets.

@aaizemberg
Last active August 29, 2015 13:57
Show Gist options
  • Save aaizemberg/9673117 to your computer and use it in GitHub Desktop.
Save aaizemberg/9673117 to your computer and use it in GitHub Desktop.
OpenLayers (v3) & OSM
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="http://ol3js.org/en/master/css/ol.css" type="text/css">
<style>
.map {
height: 600px;
width: 100%;
}
</style>
<script src="http://ol3js.org/en/master/build/ol.js" type="text/javascript"></script>
<title>OpenLayers 3</title>
</head>
<body>
<div id="map" class="map"></div>
<script type="text/javascript">
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View2D({
center: ol.proj.transform([-58.4280189, -34.6051541], 'EPSG:4326', 'EPSG:3857'),
zoom: 16
})
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment