Maps API
#
OverviewThe Protomaps Map API is a hosted, CDN-accelerated web service for interactive maps on the web. The Map API serves square Web Mercator tiles based on the MVT Vector Tiles specification : vector-tile-spec
#
EndpointsThe Protomaps Map API is under heavy development.
- Access requires an API key.
- Requests made from a web browser are subject to Cross-Origin Resource Sharing (CORS) limitations. The list of allowed sites can be set per API key at the Dashboard.
- Requests made from localhost with a valid API key are not subject to CORS restrictions; this is useful for local development. For domain names used in development and staging environments, set them to allowed on the Dashboard.
The URL for accessing map tiles is:
https://api.protomaps.com/tiles/v2/{z}/{x}/{y}.pbf?key=<YOUR API KEY>
Other assets such as JavaScript Libraries, map styles, and fonts, can be loaded from content delivery networks and do not need an API key.
Examples:
https://unpkg.com/[email protected]/dist/leaflet.csshttps://unpkg.com/[email protected]/dist/leaflet.jshttps://unpkg.com/[email protected]/dist/protomaps.min.js
#
RenderersA map rendering library is needed to display interactive maps on the web. The Protomaps Map API is designed to work with any renderer that supports MVT format tiles, including:
- Protomaps JS
- MapLibre GL JS
- Tangram JS
- Leaflet.VectorGrid
- OpenLayers
For more information on these see Protomaps.JS documentation and Alternate Renderers