0

I have a map component with 1000+ overlapping polygons and want to show the Polygons from the Overlay layer always on top of the Polygons from the baselayer with the use of Panes. I found that using panes only works if the Polygons are rendered as SVG and not Canvas Objects, however this slows down performance a lot when using a lot of Polygons.

Is there a way to selectively render the Baselayers as Canvas Elements and the Overlay Polygons as SVG instead of defining preferCanvas for the whole MapContainer? Something like:

<MapContainer> 
    <BaseLayer preferCanvas={true} />
    <Pane name = "alwaysOnTop" style={{zIndex:400}}>
        <Overlay preferCanvas={false} />
    </Pane>
</MapContainer>

When wrapping the overlay layer in Panes while canvas is enabled, the Polygons from the Baselayer, which weren't overlapped by the Overlay become unclickable.

0 Answers0