Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle Error of (404 Not Found) leaflet offline Map tiles fetching #1094

Open
syncthreads-sammith opened this issue Sep 12, 2023 · 0 comments

Comments

@syncthreads-sammith
Copy link

I have developed application using react-leaflet map and i have incorporated offline map tiles
<TileLayer attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' url={${process.env.PUBLIC_URL}/map/{z}/{x}/{y}.png} zoom={17} maxZoom={22} maxNativeZoom={19} />
here the map tiles are being fetched from this map folder so when i create build using npm run build i'll feed this tiles in the map folder
Here the catch is i have limited area of map if i start navigating out off that map tiles which are available in map folder chrome console throws error saying
Screenshot (10)
actually its trying to fetch tiles which are not available, how do i handle this case, i need to stop fetching if tiles are not available and possibly show some alert message in UI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant