Witam, czy jest możliwe aby przyblizyć oraz wyznaczyć srodek na mapie tam gdzie są markery ? Jakos to obliczyc nalezy? Prosze o wskazówki
const map = new mapboxgl.Map({
container: this.mapContainer,
style: 'mapbox://styles/mapbox/streets-v11',
center: [this.state.lng, this.state.lat],
zoom: 10,
})
for (const obj of this.state.history2) {
let myLatlng = new mapboxgl.LngLat(obj.Y, obj.X);
new mapboxgl.Marker()
.setLngLat(myLatlng)
.setPopup(new mapboxgl.Popup({ offset: 25 })
.setHTML('<h3>' + obj.Name + '</h3><p>' + obj.Description + '</p>'
))
.addTo(map);
}