Map

The Map object represents the map on your page. It exposes methods and properties that enable you to programmatically change the map, and fires events as users interact with it.

You create a Map by specifying a container and other options. Then SDK JS initializes the map on the page and returns your Map object.

Example


import * as maptilersdk from '@maptiler/sdk';

const map = new maptilersdk.Map({
  container: 'map',
  center: [-122.420679, 37.772537],
  zoom: 13,
  style: maptilersdk.MapStyle.STREETS,
  hash: true,
});

API reference

Class Map

Was this helpful?