JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ol3js.org/en/master/build/ol.css">
<script src="http://ol3js.org/en/master/build/ol.js"></script>
<div id="map" class="map"></div>
CSS
.map {
height: 500px;
width: 100%;
}
JavaScript
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
new ol.layer.Tile({
source: new ol.source.XYZ({
url: 'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png',
crossOrigin: 'null'
})
})],
view: new ol.View2D({
center: ol.proj.transform([12.1, 54.18], 'EPSG:4326', 'EPSG:3857'),
zoom: 13
})
});