leaflet-offline | Leaflet library that downloads map tiles
kandi X-RAY | leaflet-offline Summary
kandi X-RAY | leaflet-offline Summary
A Leaflet library that downloads map tiles and uses them offline.
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of leaflet-offline
leaflet-offline Key Features
leaflet-offline Examples and Code Snippets
Community Discussions
Trending Discussions on leaflet-offline
QUESTION
ANSWER
Answered 2019-Dec-04 at 12:11In my case, I create my own tiles via gdal2tiles
, which takes your data and automatically creates a {z}/{x}/{y}.png folder structure. Please see this link for a nice tutorial and what i mean about the file structure;
QUESTION
I have been using the react-leaflet library, so far it worked well.
Now I wanted the site to pre-load as much of the tiles as possible so that the web-app(also a PWA) could be used w/o internet.
I found some existing solutions(although not dedicated for react)
This is what i've tried so far - using leaflet-offline
...ANSWER
Answered 2018-Oct-16 at 13:49Yeah you'll need to extend react-leaflet
's TileLayer
class.
If you're using V1 that's pretty straightforward.
Here's a fiddle: https://jsfiddle.net/q2v7t59h/1965/
Currently it's breaking on the localforage
usage (never used that before) so you'll have to fix that. But the crux of defining a createLeafletElement
function is still correct.
If you're using react-leaflet
V2 then extending TileLayer
is a bit more of a pain. Read through https://github.com/PaulLeCam/react-leaflet/issues/506 and you should be able to figure it out. Oh and vote for that issue if you think it deserves attention.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install leaflet-offline
No Installation instructions are available at this moment for leaflet-offline.Refer to component home page for details.
Support
If you have any questions vist the community on GitHub, Stack Overflow.
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page