Hey there,
I wanted to share my website www.livehazards.com with you. Currently, I am working on relocating the popup box linked to each earthquake to the bottom right corner of the screen.
Below is the code related to the popup box:
.mapboxgl-popup-content {padding:10px; background:rgba(54, 69, 79, 0.8); color:#fff; pointer-events:none;}
var feature = features[0];
var popup = new mapboxgl.Popup()
.setLngLat (feature.geometry.coordinates)
.setHTML ('Magnitude = <b> '+ feature.properties.mag + '</b>,' + ' Location = <b>' + feature.properties.place + '</b>,' + ' Time: <b> ' + expressTime(feature.properties.time)[0]+' '+expressTime(feature.properties.time)[1]+' ago </b>'+ ' Felt by:<b> ' + Feltby(feature.properties.felt)+ '</b>').addTo(map);
});
...I have been able to adjust the position of the popup box relative to the point, but I am struggling to anchor it precisely to a specific area (even with position:absolute?).
.mapboxgl-popup-content {
right:100px;
bottom:100px;
position:absolute;
}
If anyone has any tips or solutions on how to achieve this, it would be greatly appreciated. Thank you!