Skip to content

"A sample app demonstrating how to download and cache MBTiles in IndexedDB, and load them from the cache in a map."

Notifications You must be signed in to change notification settings

CodeCleverOG/offline-mbtiles-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Offline MBTiles Browser Viewer

A web-based application for viewing and testing MBTiles files directly in the browser. This project provides two different implementations using popular mapping libraries:

  1. Cesium.js Implementation (mbtiles-cesium.html)
  2. Leaflet.js Implementation (mbtiles-leaflet.html)

Features

  • Download and serve MBTiles files directly in the browser
  • View map tiles using either Cesium.js or Leaflet.js
  • Test tile loading and rendering
  • Cache management for offline access
  • Progress tracking and status monitoring
  • Detailed logging system
  • Modern, responsive UI

Prerequisites

  • A modern web browser with JavaScript enabled
  • Internet connection for initial library loading

Dependencies

Cesium Implementation

  • Cesium.js (v1.113)
  • SQL.js (v1.13.0)

Leaflet Implementation

  • Leaflet.js (v1.9.4)
  • SQL.js (v1.13.0)

Usage

  1. Open either mbtiles-cesium.html or mbtiles-leaflet.html in your web browser
  2. Enter the URL of your MBTiles file in the input field
  3. Click the "Download" button to fetch the MBTiles file
  4. Once downloaded, the tiles will be displayed on the map
  5. Use the map controls to navigate and explore the tiles

Features in Detail

Map Controls

  • Pan and zoom functionality
  • Tile preview grid
  • Status monitoring
  • Download progress tracking
  • Cache management

UI Components

  • Modern, responsive design
  • Progress bars
  • Status indicators
  • Detailed logging console
  • Tile preview grid

Browser Support

This application works best in modern browsers that support:

  • IndexedDB
  • Web Workers
  • Fetch API
  • Modern JavaScript features

License

This project is open source and available under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

About

"A sample app demonstrating how to download and cache MBTiles in IndexedDB, and load them from the cache in a map."

Topics

Resources

Stars

Watchers

Forks

Languages