Radius Circle or Drive Distance Map? How to Draw Both on a Map

A radius circle measures distance in a straight line, a drive distance map measures it along roads. Code for both, and a real 5-mile comparison in Memphis

Memphis map with a dashed orange 5-mile radius circle and a smaller purple 5-mile drive distance area inside it
Memphis map with a dashed orange 5-mile radius circle and a smaller purple 5-mile drive distance area inside it

A radius circle shows every point within a straight-line distance of a center, and a drive distance map shows the area you can reach within that distance along roads. You draw the first with a few lines of geometry and the second with one request to a routing-based API. The two shapes can be very different. Around downtown Memphis, a 5-mile circle covers 203.4 km², while the area within 5 miles of driving covers 71.1 km². This post shows the code for both, compares them on real data, and helps you pick the one that answers your question.

Key takeaways

  • Radius circle: one line in Leaflet (L.circle with a radius in meters) or a 64-point GeoJSON polygon in MapLibre GL JS. No API call is needed.
  • Drive distance map: one GET request to the Geoapify Isoline API with type=distance, mode=drive and range in meters. The response is GeoJSON, ready for a map layer.
  • The gap is real: in Memphis the 5-mile drive distance area is 35% of the 5-mile circle, because the Mississippi River has only two road bridges there.
  • Choose by the question: straight-line questions get a circle, questions about distance on roads get a drive distance map, and "how long does it take" questions get a travel time map.

What Is the Difference Between a Radius Circle and a Drive Distance Map?

A radius circle is the set of all points within a fixed straight-line distance of a center. It measures distance "as the crow flies" and ignores rivers, highways and street layouts. It is always round, and its area depends only on the radius.

A drive distance map is the area you can reach by driving a fixed distance along the road network. The technical name is isodistance, one of the two types of isoline maps. Its shape follows the roads: it stretches along highways and stops at rivers, rail yards and other places with no road across.

Our example uses downtown Memphis, Tennessee (latitude 35.1495, longitude -90.049) and a distance of 8,047 m, which is 5 miles. The circle covers 203.4 km². The drive distance area covers 71.1 km², or 35% of the circle.

Map of Memphis, Tennessee with a dashed orange 5-mile radius circle around downtown and a smaller purple 5-mile drive distance area inside it that crosses the Mississippi River only along two bridges
5 miles (8,047 m) around downtown Memphis: the radius circle covers 203.4 km², the drive distance area 71.1 km². Presidents Island is inside the circle but 11.0 km away by road. Drive distance area from the Geoapify Isoline API. Map: Geoapify, © OpenMapTiles, © OpenStreetMap contributors.

How Do You Draw a Radius Circle on a Map?

How you draw a radius circle depends on the map library. In Leaflet, a circle with a radius in meters is built in:

L.circle([35.1495, -90.049], { radius: 8047 }).addTo(map);

MapLibre GL JS has no circle layer measured in meters. Its circle layer type draws points with a radius in pixels, so the circle would keep the same screen size at every zoom level. The usual solution is to build the circle as a GeoJSON polygon: calculate 64 points at the same distance from the center and connect them.

const center = { lat: 35.1495, lon: -90.049 };
const distance = 8047; // meters, about 5 miles

// Radius circle: a GeoJSON polygon with points at the same straight-line distance.
function circlePolygon(lon, lat, radiusMeters, steps = 64) {
  const earthRadius = 6371008.8;
  const toRad = degrees => (degrees * Math.PI) / 180;
  const toDeg = radians => (radians * 180) / Math.PI;
  const angularDistance = radiusMeters / earthRadius;
  const lat1 = toRad(lat);
  const lon1 = toRad(lon);
  const ring = [];
  for (let i = 0; i <= steps; i++) {
    const bearing = (2 * Math.PI * i) / steps;
    const lat2 = Math.asin(
      Math.sin(lat1) * Math.cos(angularDistance) +
        Math.cos(lat1) * Math.sin(angularDistance) * Math.cos(bearing)
    );
    const lon2 =
      lon1 +
      Math.atan2(
        Math.sin(bearing) * Math.sin(angularDistance) * Math.cos(lat1),
        Math.cos(angularDistance) - Math.sin(lat1) * Math.sin(lat2)
      );
    ring.push([toDeg(lon2), toDeg(lat2)]);
  }
  return { type: "Feature", properties: {}, geometry: { type: "Polygon", coordinates: [ring] } };
}

const radiusCircle = circlePolygon(center.lon, center.lat, distance);

map.addSource("radius-circle", { type: "geojson", data: radiusCircle });
map.addLayer({
  id: "radius-circle-fill",
  type: "fill",
  source: "radius-circle",
  paint: { "fill-color": "#f76707", "fill-opacity": 0.1 }
});
map.addLayer({
  id: "radius-circle-outline",
  type: "line",
  source: "radius-circle",
  paint: { "line-color": "#f76707", "line-width": 2, "line-dasharray": [3, 2] }
});

We tested this code with MapLibre GL JS 5.24.1. Run it after the map's load event. If Turf is already in your project, its circle function returns the same kind of polygon.

One note on static images: in the Geoapify Static Maps API, geometry=circle:lon,lat,radius takes the radius in pixels, not meters. It is made for marking a spot on an image, not for showing a distance.

How Do You Draw a Drive Distance Map?

A drive distance map needs road data, so the shape comes from an API. With the Geoapify Isoline API it is one REST request:

https://api.geoapify.com/v1/isoline?lat=35.1495&lon=-90.049&type=distance&mode=drive&range=8047&apiKey=YOUR_API_KEY

The Isoline API reference documents these parameters:

ParameterValue in the exampleDescription
lat, lon35.1495, -90.049The center: where the trip starts
typedistancedistance for an isodistance, time for an isochrone
modedriveTravel mode
range8047For type=distance, the distance in meters
apiKeyYOUR_API_KEYYour API key

The response is a GeoJSON FeatureCollection with one feature per requested range. The geometry is a Polygon or a MultiPolygon, depending on the shape, with coordinates in [longitude, latitude] order. Simplified response for the Memphis request, with the coordinates removed:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "lat": 35.1495,
        "lon": -90.049,
        "mode": "drive",
        "type": "distance",
        "range": 8047,
        "id": "929714c3bdda62cc9bacea742c5e5413"
      },
      "geometry": { "type": "MultiPolygon", "coordinates": [] }
    }
  ]
}

Because the response is GeoJSON, a map library can draw it directly. This MapLibre GL JS code continues the circle example above: it requests the area, adds it on top of the circle, and fits the map to both.

// Drive distance area: an isodistance from the Isoline API.
const params = new URLSearchParams({
  lat: center.lat,
  lon: center.lon,
  type: "distance",
  mode: "drive",
  range: distance,
  apiKey
});
const response = await fetch(`https://api.geoapify.com/v1/isoline?${params}`);
if (!response.ok) throw new Error(`Isoline request failed: ${response.status}`);
const driveDistanceArea = await response.json();
if (!driveDistanceArea.features?.length) throw new Error("No drive-distance area was returned");

map.addSource("drive-distance", { type: "geojson", data: driveDistanceArea });
map.addLayer({
  id: "drive-distance-fill",
  type: "fill",
  source: "drive-distance",
  paint: { "fill-color": "#623aff", "fill-opacity": 0.3 }
});
map.addLayer({
  id: "drive-distance-outline",
  type: "line",
  source: "drive-distance",
  paint: { "line-color": "#623aff", "line-width": 2 }
});

new maplibregl.Marker({ color: "#222222" }).setLngLat([center.lon, center.lat]).addTo(map);

// The circle always contains the drive-distance area, so fit the map to the circle.
const bounds = new maplibregl.LngLatBounds();
radiusCircle.geometry.coordinates[0].forEach(position => bounds.extend(position));
map.fitBounds(bounds, { padding: 40 });

Here apiKey holds your Geoapify API key and map is your MapLibre map. In Leaflet, pass the same response to L.geoJSON; the JavaScript tutorial to draw isolines with Leaflet shows the full page.

The mode parameter is not limited to cars. The same request works with walk, bicycle and the truck modes; the Isoline docs link to the full travel modes table. For the time-based version of this map, see the how-to Create a drive-time service area.

How Different Are the Two Shapes in Practice?

In Memphis, the same 5 miles give two very different areas:

5-mile radius circle5-mile drive distance area
MeasuredIn a straight lineAlong roads, mode=drive
Area203.4 km²71.1 km²
Share of the circle100%35%
Across the MississippiCovers the river and Arkansas farmlandThin strips along two bridges

The reason is the Mississippi River, which runs just west of downtown. The circle does not know about it and covers the water and the farmland on the Arkansas side. The drive distance area follows roads, so it crosses the river only along the two bridges: the I-40 Hernando de Soto Bridge and the I-55 Memphis–Arkansas Bridge.

Even on the Tennessee side, the drive distance area stops short of the circle. Streets are not straight lines, so 5 miles of driving ends before the edge of the circle in every direction.

One point shows the difference well. Presidents Island, the industrial port area southwest of downtown, is 7.8 km from the center in a straight line, so it is inside the circle. By road it is 11.0 km away, which puts it outside the 5-mile drive distance area.

Searching for places inside each shape

Both shapes also work as search areas. The Geoapify Places API accepts a circle with filter=circle:lon,lat,radiusMeters, and a previously generated isoline with filter=geometry:<isoline id>. The id is the properties.id value from the Isoline API response. A generated isoline can be retrieved by its id within a 24-hour window. The Places API docs list all filters.

These two REST requests count fuel stations in the circle and in the drive distance area:

# Inside the 5-mile radius circle
https://api.geoapify.com/v2/places?categories=service.vehicle.fuel&filter=circle:-90.049,35.1495,8047&limit=500&apiKey=YOUR_API_KEY

# Inside the 5-mile drive distance area
https://api.geoapify.com/v2/places?categories=service.vehicle.fuel&filter=geometry:929714c3bdda62cc9bacea742c5e5413&limit=500&apiKey=YOUR_API_KEY

We ran both requests for four categories:

CategoryIn the circleIn the drive distance area
service.vehicle.fuel5539
catering.restaurant161147
commercial.supermarket1110
healthcare.pharmacy65

The counts differ less than the areas, because places cluster where the roads are, and the empty parts of the circle are river and farmland. Still, 16 fuel stations in the circle are farther than 5 miles by road. The data is based on OpenStreetMap, so the counts change over time.

Two maps of Memphis side by side showing fuel stations as dots: 55 inside the 5-mile radius circle on the left, 16 of them in orange because they are farther than 5 miles by road, and 39 inside the 5-mile drive distance area on the right
Fuel stations within 5 miles of downtown Memphis: 55 inside the radius circle, 39 inside the drive distance area. Orange dots are the 16 stations inside the circle that are farther than 5 miles by road. Data: Geoapify Places API, © OpenStreetMap contributors.

Which One Answers Your Question?

Neither shape is better in general. Each one answers a different question, so start with what you want to know:

Your questionShapeExamples
What is within X in a straight line?Radius circleRadio, wireless or drone range; a noise or safety buffer; legal distance rules measured in a straight line; a quick first filter before exact checks
What is within X of driving?Drive distance map (isodistance, type=distance)A delivery fee by distance; a service territory defined in miles; towing or taxi pricing by distance; the range of a vehicle
What is within X minutes?Travel time map (isochrone, type=time)"How long does it take" questions: commute areas, delivery time promises, response times

A radius circle is the right tool when the thing you measure really travels in a straight line, or when a rule says so. It is also a cheap first filter: every point within 5 miles by road is also within 5 miles in a straight line, so the circle never misses a candidate.

A drive distance map is the right tool when the cost or the limit depends on the distance on the road. A customer on the other side of a river may be inside your circle and still be a long drive away.

When the question is about time, use an isochrone. The request is the same with type=time and range in seconds. See travel time maps and our guide to isochrone maps.

Decision diagram with three branches: a straight-line question leads to a radius circle, a road distance question leads to a drive distance map, and a time question leads to a travel time map
Start with the question: straight line, distance on roads, or time.

What Are the Limits and the Cost?

A radius circle is free, since your code calculates it. For the drive distance map, these are the numbers to know:

  • Range: the Isoline API calculates isodistances of up to 60 km, depending on your plan. The Free plan goes up to 10 km, so the 8,047 m example in this post runs on a free key.
  • Bigger areas: the Batch API calculates bigger isolines.
  • Credits: every 5 requested km cost 1 credit. A 10 km isodistance costs 2 credits.
  • Several ranges in one call: range=5000,10000,15000 returns one area per range and costs only as much as the largest one.
  • Free plan: 3,000 credits per day.
  • Storing results: you may cache or store the calculated isolines on your side without restrictions.

Storing matters for cost. If your store or depot does not move, calculate its drive distance area once and reuse the saved GeoJSON. See Geoapify pricing for the limits of each plan.

AI Request Examples: Ask a Coding Agent to Draw Both

You do not have to write this code by hand. A coding agent can build the map or generate the data from a clear request.

Before you start

  1. Get a free API key in Geoapify MyProjects.
  2. Create a new folder for the project, or open an existing one.
  3. In that folder, create a file named .env with one line: GEOAPIFY_API_KEY= followed by your key.
  4. Open the folder in your coding agent.
  5. Paste one of the prompts below.

The first prompt creates a standalone web page where you click a point and see both shapes:

Create a standalone web page (one HTML file, no build step) that compares a radius circle
with a drive distance map.

- Show a MapLibre GL JS map with the Geoapify map tiles style:
  https://maps.geoapify.com/v1/styles/osm-bright/style.json?apiKey=...
  Load the current MapLibre GL JS release from a CDN and pin it to an exact version.
- When I click a point on the map, draw two areas around it:
  1. a radius circle, built as a GeoJSON polygon in the page;
  2. a drive distance area (isodistance) from https://api.geoapify.com/v1/isoline
     with lat, lon, type=distance, mode=drive and range in meters.
- Add a distance input in meters. Default 8047, maximum 10000 (the Free plan limit).
- Show both areas in km² and the drive distance area as a share of the circle.
- Read my API key from the .env file (GEOAPIFY_API_KEY) and put it in one constant in the
  page. Remind me to restrict the key to my website's origins in Geoapify MyProjects
  before I publish the page.
- Read https://apidocs.geoapify.com/docs/isolines/ before you write the request.

When you are done, open the page in a browser, save a screenshot, and tell me how to
open the page myself.

What happened in our test:

  • The page worked on the first run. A click on downtown Memphis with 8047 m showed 203.4 km² for the circle, 71.1 km² for the drive distance area and a share of 35.0%.
  • The agent looked up the current MapLibre GL JS release in the npm registry and pinned it. That release ships as ES modules only, so the agent loaded it with <script type="module"> and an import. An agent that writes the older script-tag pattern from memory gets a 404 and has to retry.
  • The prompt does not say how to measure the areas. The agent wrote a spherical area formula in the page and handled the MultiPolygon with a hole that the API returned. It built the circle from 180 points.
  • It put the key in one constant and told us to restrict the key to our website origins in MyProjects, because the key is visible in the page source.
  • It also added a retry for the HTTP 202 response that the Isoline docs describe for long calculations. Our request returned 200, so that path did not run.

The second prompt adds the comparison to a project you already have:

Add a "radius vs drive distance" overlay to the map in this project.

- Inspect the project first. Reuse its framework, its map library and its conventions,
  and make the smallest change that works.
- For a given point, draw a radius circle and a drive distance area from the Geoapify
  Isoline API (https://api.geoapify.com/v1/isoline with lat, lon, type=distance,
  mode=drive and range in meters). Read https://apidocs.geoapify.com/docs/isolines/ first.
- Ask me only what the project does not answer: which point, which distance, which travel
  mode, and whether the request should go through a backend or use a restricted browser key.
- Take the API key from the project's environment configuration. Never hardcode it and
  never print it.

When you are done, build the project and report the changed files and the command
to start it.

What happened in our test:

  • We ran the prompt in a small Vite project with a Leaflet map, one store marker and the key in .env.local. The agent found all of this on inspection and reused the existing key and the store location.
  • The only question it really needed was the distance. The point and the browser key were confirmations, and it would not have asked about the travel mode, because the prompt already says mode=drive.
  • It changed two files and added no dependency. The circle is the Leaflet built-in L.circle with a radius in meters, and the drive distance area is the Isoline API response passed to L.geoJSON.
  • The build passed even while an import was missing; only the check in a browser showed the error. In the first version the new shapes also covered the store marker, so its popup did not open. The agent moved the shapes to a lower map pane.
  • So ask for a browser check, not only a build, and tell the agent to keep the existing markers clickable.

The third prompt skips the map and generates the data as a GeoJSON file:

Write a Node.js script with no dependencies beyond the built-in fetch.

- Read GEOAPIFY_API_KEY from the .env file. Never print the key.
- Take three arguments: lat, lon and a distance in meters.
- Write one GeoJSON file with two features:
  1. a radius circle polygon around the point;
  2. the drive distance area from the Geoapify Isoline API
     (https://api.geoapify.com/v1/isoline with lat, lon, type=distance, mode=drive
     and range in meters).
- Give each feature two properties: kind and area_km2.
- Print the two areas and the drive distance area as a share of the circle.

Run it for 35.1495, -90.049 and 8047, then tell me the numbers and the file path.

What happened in our test:

  • The script ran on the first try and printed: radius circle 203.10 km², drive distance area 71.12 km², share 35.0%.
  • The circle is slightly smaller than the 203.4 km² above because the agent built it from 64 points, and a 64-sided polygon has about 0.16% less area than a true circle.
  • The GeoJSON file has two features with kind values radius_circle and drive_distance_area. The drive distance area is a MultiPolygon with one hole, and the agent subtracted the hole from the area.
  • The prompt does not name the output file, the number of circle points or the rounding, so the agent chose them. Add these details to the prompt if they matter to you.

Frequently Asked Questions

How do I draw a radius circle on a map?

In Leaflet, use L.circle([lat, lon], { radius: meters }).addTo(map); see the Leaflet reference. In MapLibre GL JS, build the circle as a GeoJSON polygon, for example 64 points at the same distance from the center, and add it as a fill layer. Turf's circle function creates the same polygon.

What is a drive distance map?

A drive distance map, or isodistance, shows the area you can reach by driving a fixed distance along the road network. With the Geoapify Isoline API you request it with type=distance, mode=drive and range in meters, and get a GeoJSON polygon back.

Is a drive distance map the same as an isochrone?

No. A drive distance map (isodistance) is limited by distance, for example 5 miles of driving. An isochrone is limited by time, for example 10 minutes of driving. The Isoline API calculates both: type=distance with a range in meters, or type=time with a range in seconds. See travel time maps.

Why is the drive distance area smaller than the circle?

Roads are not straight lines, and rivers, rail yards and other barriers force detours. A point 5 miles away by road is always 5 miles or less away in a straight line, so the drive distance area sits inside the circle. In our Memphis example it covers 71.1 km², 35% of the 203.4 km² circle, because the Mississippi River can be crossed only on two bridges.

Can I find places inside a drive distance area?

Yes. Take the properties.id value from the Isoline API response and pass it to the Places API as filter=geometry:ID. A generated isoline can be retrieved by its id within a 24-hour window. For a radius circle, use filter=circle:lon,lat,radiusMeters. See the Places API docs.

How far can a drive distance map reach?

The Isoline API calculates isodistances of up to 60 km, depending on your plan; the Free plan goes up to 10 km. Every 5 requested km cost 1 credit. See the Isoline API docs and pricing.

World map

Draw Your First Drive Distance Map

Get a free API key, try a point in the playground,
and add the area to your map.