OpenLayers Template

by Sara Dub

HTML

<head>
  <link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css" type="text/css">
  <script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js">
  </script>
  <title>OpenLayers Template</title>
</head>

<body>
  <div id="map"></div>
</body>

CSS

#map {
  height: 100%;
  width: 100%;
}

JavaScript

var map = new ol.Map({
	target: 'map',
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM()
    })
  ],
  view: new ol.View({
    center: ol.proj.fromLonLat([13.741640, 51.051999]),
    zoom: 12
  })
});