Add a raster tile source

To enhance your map, you have the option to incorporate a third-party raster source into the map. This could involve integrating satellite maps or drone images, as well as other raster layers like historical maps, for example. By doing so, you can enrich the visual representation and expand the range of information provided on your map.

NPM module setup


npm install --save @maptiler/sdk
import { Map, 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: {
        'version': 8,
        'sources': {
            'raster-tiles': {
                'type': 'raster',
                'tiles': [
                    `https://api.maptiler.com/tiles/satellite-v2/{z}/{x}/{y}.jpg`
                ],
                'tileSize': 256,
                'attribution':
                    '<a href="https://www.maptiler.com/copyright/" target="_blank">&copy; MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap contributors</a>'
            }
        },
        'layers': [
            {
                'id': 'simple-tiles',
                'type': 'raster',
                'source': 'raster-tiles',
                'minzoom': 0,
                'maxzoom': 22
            }
        ]
    },
    center: [-74.5, 40], // starting position
    zoom: 2 // starting zoom
});
Add a WMS source

Add a WMS source

Examples

Add an external Web Map Service raster layer.

Show raster image on the map

Raster layer

Tutorials

Add a raster image overlay to the map.

Display a satellite map

Display a satellite map

Examples

Display a satellite raster map baselayer.

Add hillshading

Add hillshading

Examples

Add raster hillshading effect to a MapTiler map.

Was this helpful?