react-map-gl
react-map-gl copied to clipboard
SVGOverlay redraw() function gets called when unnecessary
I read that the SVGOverlay redraw() function gets called every time the map updates, but it seems to get called steadily even when I don't change the map viewport. Taking the example from the docs:
import {SVGOverlay} from 'react-map-gl';
function redraw({project}) {
console.log("test"); // the print of this message doesn't stop when I don't change the map viewport
const [cx, cy] = project([-122, 37]);
return <circle cx={cx} cy={cy} r={4} fill="blue" />; // I think redrawing this circle when I don't change the map viewport makes no sense
}
<MapGL {...viewport}>
<SVGOverlay redraw={redraw} />
</MapGL>
I want the function redraw() to get called only at the launch of the application and when I change the viewport.
I cannot reproduce this. Do you have other prop/state change on MapGL?
I cannot reproduce this. Do you have other prop/state change on
MapGL?
No
Closing for inactivity. Will reopen if you can provide a code sandbox to reproduce the issue.