<!DOCTYPE html>
<html>
<head>
<title>basemap.world Web Vektor - MapLibre GL JS Demo</title>
<script src='https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js'></script>
<link href='https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css' rel='stylesheet' />
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id="map" class="map"></div>
<script>
var map = new maplibregl.Map({
container: 'map',
style: 'https://sgx.geodatenzentrum.de/gdz_basemapworld_vektor/styles/bm_web_wld_col.json',
center: [10, 51],
zoom: 6,
});
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>basemap.world Web Vektor - Mapbox GL JS Demo</title>
<script src="https://api.mapbox.com/mapbox-gl-js/v1.13.2/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://api.mapbox.com/mapbox-gl-js/v2.3.0/mapbox-gl.css">
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id="map" class="map"></div>
<script>
// For Mapbox GL JS > Version 2 you need an access token to make the map appear
mapboxgl.accessToken = '<your access token here>';
var map = new mapboxgl.Map({
container: 'map',
style: 'https://sgx.geodatenzentrum.de/gdz_basemapworld_vektor/styles/bm_web_wld_col.json',
center: [10, 51],
zoom: 6,
});
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>basemap.world Web Vektor - Leaflet Demo</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css" />
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js"></script>
<script src="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js"></script>
<script src="https://unpkg.com/@maplibre/maplibre-gl-leaflet@0.0.17/leaflet-maplibre-gl.js"></script>
<script>
var map = L.map('map', {
minZoom: 6,
maxZoom: 18,
});
var gl = L.maplibreGL({
style: 'https://sgx.geodatenzentrum.de/gdz_basemapworld_vektor/styles/bm_web_wld_col.json',
}).addTo(map);
map.setView([51, 10], 6);
</script>
</body>
</html>
import "ol/ol.css";
import { apply as applyMapboxStyle } from "ol-mapbox-style";
import Map from "ol/Map";
import View from "ol/View";
import { useGeographic as olUseGeographic } from "ol/proj";
import {
DragRotateAndZoom,
defaults as defaultInteractions
} from "ol/interaction.js";
olUseGeographic();
const center = [6.958307, 50.941357];
const map = new Map({
interactions: defaultInteractions().extend([new DragRotateAndZoom()]),
view: new View({
center: center,
zoom: 17
}),
target: "map"
});
applyMapboxStyle(
map,
"https://sgx.geodatenzentrum.de/gdz_basemapworld_vektor/styles/bm_web_wld_col.json"
);
<!DOCTYPE html>
<html>
<head>
<title>basemap.world Web Vektor - OpenLayers Demo</title>
<meta charset="UTF-8" />
<style>
html,
body,
#map {
font-family: sans-serif;
margin: 0;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script type="module" src="index.js"></script>
</body>
</html>
{
"name": "basemap.world-openlayers-demo",
"version": "1.0.0",
"description": "basemap.world Web Vektor - OpenLayers Demo",
"main": "index.html",
"scripts": {
"start": "vite",
"build": "vite build"
},
"dependencies": {
"ol": "7.3.0",
"ol-mapbox-style": "10.3.4",
"vite": "4.2.1"
},
"devDependencies": {
"@babel/core": "7.2.0",
"typescript": "4.4.4"
},
"resolutions": {
"@babel/preset-env": "7.13.8"
},
"keywords": ["javascript", "basemap.de", "basemap.world"]
}