block by ThomasG77 21a32b3bacdd4a813fc48a5130200d38

Demo using native ECMAScript modules in OpenLayers 5.0.0-beta.12

Full Screen

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">
    <!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
    <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>