Skip to content

Instantly share code, notes, and snippets.

@bernardobelchior
Last active August 27, 2018 16:42
Show Gist options
  • Save bernardobelchior/c6a3572bb8d9c4cfb777678cf083c876 to your computer and use it in GitHub Desktop.
Save bernardobelchior/c6a3572bb8d9c4cfb777678cf083c876 to your computer and use it in GitHub Desktop.
map index.js
import View from 'ol/View';
import Map from 'ol/Map';
// Wait for the page to load, otherwise getElementById may not work.
window.onload = () => {
const target = document.getElementById('map')
// Create a new map with the target as the div#map, and without layers - for now.
new Map({
target,
view: new View({
center: [0, 0],
zoom: 2,
}),
layers: [ /* To be added later */]
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment