geocoder.on('result', function(e) { var marker = new mapboxgl.Marker({ draggable: true, color: "pink" }) .setLngLat(e.result.center) .addTo(map) });