Add a map to a webpage

Create a map within an HTML element using MapTiler SDK JS. Additionally, it is possible to insert maps into websites with a simple iframe directly from MapTiler.

This is the most basic demonstration of utilizing the MapTiler SDK JS to effortlessly build a web mapping application. Feel free to explore various map styles, customizations, and functionalities to provide an exceptional mapping experience for your users. Take a look at the other examples available to discover the full potential of the SDK.

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', // container id
  style: MapStyle.STREETS, 
  center: [16.62662018, 49.2125578], // starting position [lng, lat]
  zoom: 10 // starting zoom
});
Was this helpful?