Skip to main content
1 of 2

How can I render Google Map's tile in leaflet (Offline)?

I have Google Map tiles on my computer in a folder. I want to use it offline in the leaflet. Actually, leaflet use by a link to load the map like below:

      L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
        maxZoom: 19,
        attribution: '&copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
      }).addTo(map);

When I replace the local link on my computer file:///D:/Map/{z}/{x}/{y}.png instead of https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png, the map does not load. But this link file:///D:/Map/5/5/5.png load correctly a tile on my browser and also it is same as this link on openstreetmap https://{s}.tile.openstreetmap.org/5/5/5.png It would be grateful if anyone can help me.