Maps: get access and make your first request
Request Maps access, create a key, and use search, reverse geocoding, routing and map tiles from your app.
Maps gives your app a managed location layer: place search, address lookup, routing and map tiles. Its address formats follow the common conventions used by popular map libraries, so many apps only need to change a base URL and a token.
Request access
Maps is shared by all projects, so a person reviews each project before it can use it.
- In your project's sidebar, under Platform Services, choose Maps & Geo.
- If your project is not approved, describe what you will use Maps for under What will you use Maps for? (optional).
- Choose Request Maps Access.
The page shows Access request pending review until it is decided. If a request is not approved you can request again with more detail. A request to a Maps endpoint before approval is refused with a message that says access is pending or has not been requested.
Your Maps page
Once approved, the page shows request counts (Total Requests, Geocoding & Search, Routing & Directions, Active Keys) and your base addresses:
- Project Base URL (recommended):
https://<your-project>.pgbhub.app/maps - Global Ingress URL:
https://pgbhub.app/maps
Try it in the sandbox
The Interactive Maps Sandbox & Simulator lets you test calls from the page:
- Geocoding & Places: enter a place name or coordinates, an optional Country Code and Result Limit, then choose Execute Places v5 Query.
- Directions & Navigation: enter an Origin and Destination as
longitude,latitude, choose a Profile (driving-traffic, driving, walking or cycling), then choose Calculate Directions v5 Route.
The response appears below in the response panel.
Make a request from your app
Every request carries a Maps key as access_token. See Maps keys and endpoints to create one.
# Forward search for a place
curl "https://my-project.pgbhub.app/maps/geocoding/v5/mapbox.places/Ikeja.json?country=ng&access_token=pgb_map_live_xxx"
# Reverse geocode a coordinate
curl "https://my-project.pgbhub.app/maps/search/geocode/v6/reverse?latitude=6.4281&longitude=3.4219&access_token=pgb_map_live_xxx"
# A driving route with steps
curl "https://my-project.pgbhub.app/maps/directions/v5/mapbox/driving-traffic/3.35,6.60;3.42,6.43?steps=true&access_token=pgb_map_live_xxx"
Coordinates are always longitude,latitude, and a route joins stops with ;.
Show a map
For a map view, point your map library's style address at your project. For example, with MapLibre GL JS:
const map = new maplibregl.Map({
container: "map",
style: "https://my-project.pgbhub.app/maps/styles/v1/mapbox/streets-v12?access_token=pgb_map_live_xxx",
center: [3.4219, 6.4281],
zoom: 13,
});
The page also shows a Drop-In Migration Guide for Mobile & Web Apps with tabs for Flutter (Dart), NestJS / Node.js, MapLibre GL JS and cURL / REST.
Good to know
- Each key has a rate limit shown in requests per minute.
- Do not put a key you cannot afford to leak into a public page without limiting it to your website's addresses. Create a separate key per app so you can revoke one without breaking the rest.
- Maps usage is metered. See Pricing.