Vector Tile API with Mapbox renderer
Mapbox rendering tiles from the Vector Tile API
by Tristen Brown
HTML
<script src="https://api.mapbox.com/mapbox-gl-js/v2.0.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://api.mapbox.com/mapbox-gl-js/v2.0.0/mapbox-gl.css">
<div id="map"></div>
CSS
#map {
width: 100%;
position: absolute;
bottom: 0;
right: 0;
}
JavaScript
mapboxgl.accessToken = 'pk.eyJ1IjoidHJpc3RlbiIsImEiOiJjajZoOXU4Z2kwNnppMnlxd2d6bTFvZ2xtIn0.PP7AoUakMfeqdXFHdsY0oA';
new mapboxgl.Map({
container: 'map',
style: 'https://assets.vector.hereapi.com/styles/berlin/base/mapbox/tilezen?apikey=H6XyiCT0w1t9GgTjqhRXxDMrVj9h78ya3NuxlwM7XUs',
center: [-122.431297, 37.773972],
zoom: 11
});