Im using React Map Gl to display maps on my app and right now I would like to add dynamic coordinates to show a place according to what was chosen. I cant see a way of doing that, i can only put the exact coordinates in the viewport
const [viewport, setViewport] = useState({
width: "93vw",
height: "35vh",
latitude: -25.96628484128926,
longitude: 32.595740826311584,
zoom: 10,
});
I tried to set the viewport state
setViewport({ ...viewport, latitude: lat, longitude: lon });
And im getting a "@math.gl/web-mercator: assertion failed" error
Is there a way of solving this issue? Thanks in advance