Before you start
- List every maps call your app makes: search the code for the provider’s domain and SDK.
- Note your monthly volume per call from the old provider’s console.
- Request a GeoDesh account and create two keys: a server key and a browser key restricted to your origin.
Endpoint map
| What you call today | GeoDesh endpoint | Notes |
|---|---|---|
| Geocoding | GET /v1/geocode?address= | Returns formattedAddress, location, viewport, addressComponents. |
| Reverse geocoding | GET /v1/reverse-geocode?lat=&lng= | |
| Places text search | GET /v1/places/search?q= | Bias with lat, lng, radius; up to 120 results with limit. |
| Nearby search | GET /v1/places/nearby | radius is required; type or keyword. |
| Place details | GET /v1/places/{id} | Accepts the place id from search or autocomplete. |
| Autocomplete | GET /v1/places/autocomplete?input= | Each result includes location. |
| Directions / routes | POST /v1/routes | JSON body: origin, destination, waypoints, mode. |
| Distance matrix | POST /v1/routes/matrix | Up to 100 elements per request. |
| Static maps | GET /v1/maps/static | lat, lng, zoom, markers, path. |
| Street View image | GET /v1/streetview/image | Metadata is free at /v1/streetview/metadata. |
| Elevation, time zone | GET /v1/elevation, GET /v1/timezone |
Differences to handle
- Authentication: send
x-api-key: YOUR_KEYas a header. Map tile, Street View and static image URLs may carry?key=because images cannot send headers. - Envelope: results are in
data, withmetaholding the request id and cache state. Errors come as{ "error": { "code", "message", "requestId" } }. - Routes are POST with JSON, not query strings. Origins and destinations can be coordinates (
{ "lat", "lng" }) or plain text. - Durations and distances are
{ value, text }in seconds and metres; traffic time isdurationInTraffic. - Field names follow camelCase:
formattedAddress,userRatingsTotal,openingHours.
A thin adapter
Put every maps call behind one module in your app. Then the switch is one file, and you can run both providers side by side.
const BASE = 'https://geodesh.com';
const KEY = process.env.GEODESH_KEY;
async function call(path, init = {}) {
const res = await fetch(BASE + path, { ...init, headers: { 'x-api-key': KEY, 'content-type': 'application/json', ...init.headers } });
const body = await res.json();
if (!res.ok) throw Object.assign(new Error(body.error?.message ?? 'Maps error'), { code: body.error?.code, status: res.status });
return body.data;
}
export const geocode = (address) => call('/v1/geocode?address=' + encodeURIComponent(address)).then((d) => d[0] ?? null);
export const autocomplete = (input, near) => call('/v1/places/autocomplete?input=' + encodeURIComponent(input) + (near ? '&lat=' + near.lat + '&lng=' + near.lng : ''));
export const directions = (origin, destination, mode = 'driving') => call('/v1/routes', { method: 'POST', body: JSON.stringify({ origin, destination, mode }) });
export const matrix = (origins, destinations) => call('/v1/routes/matrix', { method: 'POST', body: JSON.stringify({ origins, destinations, mode: 'driving' }) });Swapping the map
You have three options:
- GeoDesh Map SDK: one script tag with markers, clustering, polylines, polygons, popups and a place panel.
addPolylineaccepts an encoded polyline from Directions directly. - Leaflet or MapLibre: keep your map library and point it at GeoDesh tiles,
/v1/maps/atlas/{theme}/{z}/{x}/{y}, or the MapLibre style at/v1/maps/atlas/{theme}/style.json. - Mobile WebView: load
/embed/map.htmland send commands withatlasCommand.
A safe order of work
- Move server-side calls first (geocoding, directions, matrix), behind the adapter.
- Run both providers on a sample of real requests for a few days and compare results.
- Switch the adapter to GeoDesh for all traffic; keep the old provider’s key active for a week.
- Swap the map in the web app, then in mobile apps with the next release.
- Watch usage and errors in the GeoDesh console, then close the old account.
Estimating the new bill
Multiply each call’s monthly volume by its GeoDesh price per 1,000 on the pricing page, apply your plan discount and subtract the included credit. The worked examples in what a maps API costs show the method.
Things that do not change
GeoDesh data comes from Google Maps, so place results, addresses and roads match what your users already know. Show the attribution GeoDesh returns on your maps.
After the switch
Once all traffic runs on GeoDesh, review the console after the first week: the busiest endpoints, error codes and cost per day. Tighten key restrictions now that you know every origin that calls the API, and set your plan quota as a ceiling.
Comparing results during the overlap
While both providers run, log a sample of requests with both answers: the coordinates from each geocode, the duration from each route. Look for large differences rather than small ones; a few metres apart is normal, a different district is a bug in the input or a gap to report. Share the worst cases with the GeoDesh team so they can be checked.
Mobile apps need a release
Web apps switch the moment you deploy. Mobile apps switch only when users update, so keep the old provider working for older app versions until most users have moved, or move mobile maps calls behind your own server so the switch does not depend on an app release at all.
Rolling back if you need to
Because every call goes through one adapter, rolling back is a configuration change. Keep the old provider’s key active until you have run a full month on GeoDesh, and keep logging which provider served each request so you can compare error rates.
A migration checklist
- All maps calls go through one adapter module.
- Server key in environment variables; browser key restricted by origin.
- Responses read from
dataand errors fromerror.code. - Directions and matrix send JSON bodies with
POST. - Map attribution visible on every map.
- Usage alerts set up in the GeoDesh console.
Frequently asked questions
Do place ids carry over?
GeoDesh place ids come from the same index, so ids from search and autocomplete work with GeoDesh place details. Re-fetch any you stored long ago, as ids can change.
Can I migrate one feature at a time?
Yes. The adapter lets you move geocoding first, then routes, then the map.
How long does migration take?
For a typical app with a handful of maps calls, a developer can move the server-side calls in a day and the map in another day or two, plus testing.