About NextMap
NextMap is a service that converts OpenStreetMap (OSM) data into the PMTiles format, making it easy to host and serve map tiles on the web.
What is PMTiles?
PMTiles is a single-file archive format for map tiles. It enables efficient hosting of map tiles on static storage services like S3, without the need for a specialized tile server. This makes it ideal for web mapping applications that need to serve tiles efficiently.
How We Generate PMTiles
We use Tilemaker to process OpenStreetMap data and generate vector tiles in the PMTiles format. Tilemaker is a tool that converts OpenStreetMap data into vector tiles without the need for a database.
Data Sources
We currently use OpenStreetMap data from Geofabrik, focusing on the Berlin region. We plan to expand to more regions in the future.
Using the Generated PMTiles
Once you've generated a PMTiles file, you can use it with mapping libraries like MapLibre GL JS to display interactive maps on your website or application.
Example MapLibre GL JS Code
import maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';
import * as pmtiles from 'pmtiles';
// Register PMTiles protocol
maplibregl.addProtocol('pmtiles', (request, callback) => {
const p = new pmtiles.Protocol();
return p.tile(request, callback);
});
// Create map
const map = new maplibregl.Map({
container: 'map',
style: {
version: 8,
sources: {
'osm': {
type: 'vector',
url: 'pmtiles://./berlin.pmtiles'
}
},
layers: [
// Your map layers here
]
},
center: [13.4050, 52.5200], // Berlin coordinates
zoom: 12
});