index.html
<!DOCTYPE html>
<html>
<head>
<title>Simple Map using native ECMAScript modules</title>
<link rel="stylesheet" href="https://openlayers.org/en/v5.0.0-beta.12/css/ol.css" type="text/css">
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
</head>
<body>
<div id="map" class="map"></div>
<script type=module>
import Map from 'https://dev.jspm.io/npm:ol@5.0.0-beta.12/Map.js';
import View from 'https://dev.jspm.io/npm:ol@5.0.0-beta.12/View.js';
import TileLayer from 'https://dev.jspm.io/npm:ol@5.0.0-beta.12/layer/Tile.js';
import OSM from 'https://dev.jspm.io/npm:ol@5.0.0-beta.12/source/OSM.js';
const map = new Map({
layers: [
new TileLayer({
source: new OSM()
})
],
target: 'map',
view: new View({
center: [0, 0],
zoom: 2
})
});
</script>
</body>
</html>