JSFiddle - React, Tailwind, and code Playground
by teknohippy
HTML
<link rel="stylesheet" href="http://openlayers.org/en/v3.13.1/css/ol.css">
<script src="http://openlayers.org/en/v3.13.1/build/ol.js"></script>
<div id="map" class="map" style="height: 100%; width: 100%;"></div>
JavaScript
var osmSource = new ol.source.OSM();
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: osmSource
}),
new ol.layer.Tile({
source: new ol.source.TileDebug({
projection: 'EPSG:3857',
tileGrid: osmSource.getTileGrid()
})
})
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
collapsible: false
})
}),
view: new ol.View({
center: ol.proj.transform(
[-0.1275, 51.507222], 'EPSG:4326', 'EPSG:3857'),
zoom: 10
})
});