OpenFreeMap example
#16223
Replies: 1 comment 1 reply
-
Thanks @hyperknot for launching that service! To compare best with your MapLibre example, you could use <script src="https://unpkg.com/[email protected]/dist/ol.js"></script>
<script src="https://unpkg.com/[email protected]/dist/olms.js"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/ol.css" type="text/css"> <div id="map" style="width: 100%; height: 500px"></div>
<script>
const map = new ol.Map({
target: 'map',
view: new ol.View({
center: ol.proj.fromLonLat([13.388, 52.517]),
zoom: 9.5
})
});
olms.apply(map, 'https://tiles.openfreemap.org/styles/liberty');
</script> If you want to show the module way, then https://openlayers.org/ol-mapbox-style/examples/tilejson-vectortile.html would be the minimal example to match: import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';
apply('map', ' https://tiles.openfreemap.org/styles/liberty'); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I've just launched OpenFreeMap yesterday. I'd like to include an official OpenLayers example. What would you recommend me for such an example?
I've found the OpenMapTiles example on this page: https://openlayers.org/ol-mapbox-style/examples/
Is that the right way of using it?
Beta Was this translation helpful? Give feedback.
All reactions