Skip to content

Set pitch and bearing

Initialize a map with pitch and bearing camera options.

<!DOCTYPE html>
<html lang="en">
    <title>Set pitch and bearing</title>
    <meta property="og:description" content="Initialize a map with pitch and bearing camera options." />
    <meta charset='utf-8'>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel='stylesheet' href='' />
    <script src=''></script>
        body { margin: 0; padding: 0; }
        html, body, #map { height: 100%; }
<div id="map"></div>
    const map = new maplibregl.Map({
        container: 'map',
        // camera options properties
        center: [-73.5804, 45.53483],
        pitch: 60, // pitch in degrees
        bearing: -60, // bearing in degrees
        zoom: 10