Set pitch and bearing

Map options extend CameraOptions, so you can set more than the center and zoom. This example sets the pitch and bearing.

NPM module setup


npm install --save @maptiler/sdk
import { Map, MapStyle, config } from '@maptiler/sdk';
import '@maptiler/sdk/dist/maptiler-sdk.css';

config.apiKey = 'YOUR_MAPTILER_API_KEY_HERE';
const map = new Map({
    container: 'map',
    style: MapStyle.STREETS, 
    // camera options properties
    center: [-73.5804, 45.53483],
    pitch: 60, // pitch in degrees
    bearing: -60, // bearing in degrees
    zoom: 10
});
Display a 3D terrain map

3D terrain map

Tutorials

Create and display 3D terrain maps on web pages.

Customize camera animations

Customize camera animations

Examples

Customize map camera animations using the AnimationOptions property.

Fly to a location

Fly to a location

Examples

Smoothly interpolate between locations using the flyTo animation.

Toggle interactions

Toggle interactions

Examples

Enable or disable specific user interaction handlers on maps.

Was this helpful?