Satellite Basemap
Display satellite imagery with optional labels overlay. Each library takes its own approach, compared side by side below.
Quick recommendations
Leaflet: A strong choice for quick satellite imagery embeds using simple raster tile URL templates with an optional labels toggle via layer controls.
MapLibre GL JS: Best when you need vector label overlays on satellite imagery with crisp text rendering at any zoom level.
OpenLayers: Ideal when satellite tiles need to integrate with WMS overlays or other OGC raster services.
MapTiler SDK: Works best for the simplest setup, where one MapStyle.SATELLITE constant replaces the entire style URL.
At a glance
| Leaflet | MapLibre | OpenLayers | SDK | |
|---|---|---|---|---|
| Coordinates | [lat, lng] | [lng, lat] | fromLonLat([lng, lat]) | [lng, lat] |
| Rendering | DOM + Canvas (2D) | WebGL (GPU, 60fps) | Canvas + WebGL | WebGL (GPU, 60fps) |
| Bundle size | ~40 KB gzipped | ~300 KB gzipped | ~90 KB gzipped (tree-shakeable) | ~360 KB gzipped (includes MapLibre) |
| Learning curve | Easiest (simple API, great tutorials) | Moderate (source/layer model, expressions) | Steepest (projections, OGC standards, verbose API) | Easy (MapLibre API with convenience helpers) |
| 3D support | No native 3D (2D only) | Full: terrain, fill-extrusion, globe, sky | Limited: WebGL layers, no native globe | Full (same as MapLibre) |
| Code lines | 14 | 12 | 16 | 11 |
Code snippets
Click a library to expand its code. Each snippet shows only the core logic: the scaffold handles HTML boilerplate.
Leaflet 14 lines Show code
const satellite = L.tileLayer('https://api.maptiler.com/maps/satellite/256/{z}/{x}/{y}.jpg?key=YOUR_MAPTILER_KEY', {
tileSize: 256,
attribution: '© <a href="https://www.maptiler.com/">MapTiler</a>'
});
const hybrid = L.tileLayer('https://api.maptiler.com/maps/hybrid/256/{z}/{x}/{y}.jpg?key=YOUR_MAPTILER_KEY', {
tileSize: 256,
attribution: '© <a href="https://www.maptiler.com/">MapTiler</a>'
});
const streets = L.tileLayer('https://api.maptiler.com/maps/streets-v4/256/{z}/{x}/{y}.png?key=YOUR_MAPTILER_KEY', {
tileSize: 256,
attribution: '© <a href="https://www.maptiler.com/">MapTiler</a> © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>'
});
const map = L.map('map', { layers: [hybrid] }).setView([41.9028, 12.4964], 12);
L.control.layers({ 'Satellite': satellite, 'Hybrid (labels)': hybrid, 'Streets': streets }).addTo(map); MapLibre GL JS 12 lines Show code
const map = new maplibregl.Map({
container: 'map',
style: 'https://api.maptiler.com/maps/satellite/style.json?key=YOUR_MAPTILER_KEY',
center: [-73.985, 40.748],
zoom: 15,
pitch: 45
});
map.addControl(new maplibregl.NavigationControl());
new maplibregl.Marker({ color: '#FF5722' })
.setLngLat([-73.985, 40.748])
.setPopup(new maplibregl.Popup().setHTML('<b>Empire State Building</b>'))
.addTo(map); OpenLayers 16 lines Show code
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.XYZ({
url: 'https://api.maptiler.com/maps/satellite/256/{z}/{x}/{y}.jpg?key=YOUR_MAPTILER_KEY',
attributions: '© <a href="https://www.maptiler.com/copyright/">MapTiler</a>',
maxZoom: 20
})
})
],
view: new ol.View({
center: ol.proj.fromLonLat([2.2945, 48.8584]),
zoom: 16
})
}); MapTiler SDK 11 lines Show code
maptilersdk.config.apiKey = 'YOUR_MAPTILER_KEY';
const map = new maptilersdk.Map({
container: 'map',
style: maptilersdk.MapStyle.SATELLITE,
center: [12.4964, 41.9028],
zoom: 15
});
new maptilersdk.Marker({ color: '#9C27B0' })
.setLngLat([12.4922, 41.8902])
.setPopup(new maptilersdk.Popup().setHTML('<b>Colosseum</b>'))
.addTo(map); Things to know
Implementation-specific details that matter for satellite basemap.
Satellite tiles are raster-only; labels overlay requires a separate transparent tile layer on top.
The MapTiler satellite style includes vector labels by default; you get crisp text that rotates with the map.
Can use either raster XYZ tiles or vector style via ol-mapbox-style for the satellite basemap.
Uses the MapStyle.SATELLITE constant, which automatically loads the correct MapTiler style with vector labels.
Which library to use?
Show MapTiler satellite imagery on a Leaflet map with L.tileLayer() and switch to a labeled hybrid layer through L.control.layers().
A strong choice for quick satellite imagery embeds using simple raster tile URL templates with an optional labels toggle via layer controls.
Show MapTiler satellite imagery as the basemap of a MapLibre GL JS map by loading the satellite style into maplibregl.Map, tilted with pitch.
Best when you need vector label overlays on satellite imagery with crisp text rendering at any zoom level.
Load MapTiler satellite imagery into OpenLayers as an ol.layer.Tile backed by an ol.source.XYZ source, with an ol.View zoomed in on Paris.
Ideal when satellite tiles need to integrate with WMS overlays or other OGC raster services.
Show satellite imagery as the basemap of a MapTiler SDK map by setting style to maptilersdk.MapStyle.SATELLITE in the maptilersdk.Map constructor.
Works best for the simplest setup, where one MapStyle.SATELLITE constant replaces the entire style URL.
Build maps with AI
Generate code like these examples using mapping library skills in your IDE.