0

Looking for the best way to Render TilesLayer (all the map) in Canvas instead of image because of lags? Found a "way" with React Leaflet V3.0 but it's not Working in Leaflet V4.0. Any suggestions to help please?

Here is what I Tried : To add L.canvas() in Renderer but there is no Canvas in DOM (EDIT : I open react-leaflet MapContainer.ts and they remove "renderer").

So I Guess the best way is to load like with Vanilla Leaflet in a UseEffect to do it ?

import * as L from "leaflet";
import { MapContainer, TileLayer } from 'react-leaflet';

<MapContainer preferCanvas={true} renderer={L.canvas()} scrollWheelZoom={true}>
<TileLayer maxNativeZoom={mapLayer.Options.maxNativeZoom} key={mapLayer.Url} url={mapLayer.Url}/>
</MapContainer>
Lucas
  • 85
  • 9
  • Can you edit the question and [describe the problem](https://meta.stackoverflow.com/questions/254393/what-exactly-is-a-recommendation-question) and share the code of what has been done so far to solve it. Please note that Stack Overflow is not a code-writing or tutorial service. – JustAG33K Aug 18 '22 at 06:36
  • @JustAG33K I Did. Actually, I did not found any information about it in the documentation and all code was for previous version (2.X). Not so much information for V4.0 on the web Not looking for "Code writing" or "tutorial", i did not even ask for CODE or solution that people could write for me, but for suggestion about a problem. – Lucas Aug 18 '22 at 07:00

0 Answers0