Goong DocumentsExamplesDisplay a satellite map

Display a satellite map

Display a satellite raster baselayer.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Display a satellite map</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://cdn.jsdelivr.net/npm/@goongmaps/goong-js@1.0.9/dist/goong-js.js"></script>
<link href="https://cdn.jsdelivr.net/npm/@goongmaps/goong-js@1.0.9/dist/goong-js.css" rel="stylesheet" />
<style>
body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
</style>
</head>
<body>
<div id="map"></div>
<script>
var style = {
'version': 8,
'name': 'Satellite Style',
'sources': {
'mapbox': {
'type': 'raster',
'url': 'https://api.mapbox.com/v4/mapbox.satellite.json?secure&access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4M29iazA2Z2gycXA4N2pmbDZmangifQ.-g_vE53SD2WrJ6tFX7QHmA',
'tileSize': 256
}
},
'center': [0, 0],
'zoom': 0,
'layers': [
{
'id': 'background',
'type': 'background',
'paint': {
'background-color': 'rgb(4,7,14)'
}
},
{
'id': 'satellite',
'type': 'raster',
'source': 'mapbox',
'source-layer': 'mapbox_satellite_full'
}
]
};
goongjs.accessToken = '8qzxZAuxcsctSlmOszInchP1A5GrmRBHJwCBCjO6';
var map = new goongjs.Map({
container: 'map',
zoom: 12,
center: [105.8379, 21.03606],
style: style
});
</script>
</body>
</html>