Add a Marker

Next Billion Maps comes with a built-in marker that you can add to the maps directly. Checkout the Marker API to learn more.

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="initial-scale=1.0" />
<meta charset="UTF-8" />
<title>Basic Map</title>
<link href="https://maps-gl.nextbillion.io/maps/api/css" rel="stylesheet" />
<!-- Or use the legacy version: -->
<!-- <link href="https://maps.nextbillion.io/maps/api/css" rel="stylesheet"> -->
<style>
* {
margin: 0;
padding: 0;
}
#map {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="https://maps-gl.nextbillion.io/maps/api/js"></script>
<!-- Or use the legacy version: -->
<!-- <script src="https://maps.nextbillion.io/maps/api/js"></script> -->
<script>
;(function () {
var loc = { lat: 28.6139, lng: 77.209 }
nextbillion.apiKey = '123456'
var map = new nextbillion.maps.Map(document.getElementById('map'), {
zoom: 11,
center: loc,
})
// Adding a marker to the map
var marker = new nextbillion.maps.Marker({
position: loc,
map: map,
})
})()
</script>
</body>
</html>