This is the documentation of version 0.62.3. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Function calculateReachableRanges

    • Calculate multiple reachable range areas from different origins or with different constraints.

      Computes several isochrone polygons in sequence, useful for comparing ranges from multiple locations, visualizing multiple time/distance rings from the same origin, or analyzing different vehicle scenarios.

      Parameters

      • paramsArray: ReachableRangeParams[]

        Array of reachable range parameters, one for each area to calculate

      • Optionaloptions: { signal?: AbortSignal }
        • Optionalsignal?: AbortSignal

          An AbortSignal to cancel the in-flight request and skip the remaining ones. Composed with any per-entry signal, so either one cancels.

      Returns Promise<PolygonFeatures<ReachableRangeProperties>>

      Promise resolving to a FeatureCollection with a polygon per range the service could calculate, in request order

      Private Preview: needs the same API key access as calculateReachableRange.

      Use cases:

      • Multi-location comparison: Compare service areas of different store locations
      • Concentric ranges: Create 15/30/45 minute drive time rings from one origin
      • Scenario analysis: Compare ranges for different vehicle types or times of day
      • Coverage optimization: Find optimal facility locations with minimal overlap

      Note: Ranges are calculated sequentially to avoid rate limiting. For large batches, consider implementing your own parallel processing with appropriate throttling.

      A range the service answers with an error is skipped, not thrown, unless that error is a 401, 403 or 429: an origin off the drivable road network answers NO_RANGE_FOUND, which calculateReachableRange rejects with. So features can be shorter than paramsArray, or empty; each feature's properties carries the request it answers. An abort and an invalid request still reject the whole batch.

      // Calculate concentric drive time rings (15, 30, 45 minutes)
      const timeRings = await calculateReachableRanges([
      { origin: [4.9, 52.3], budget: { type: 'timeMinutes', value: 15 } },
      { origin: [4.9, 52.3], budget: { type: 'timeMinutes', value: 30 } },
      { origin: [4.9, 52.3], budget: { type: 'timeMinutes', value: 45 } }
      ]);

      // Compare service areas of multiple stores
      const storeRanges = await calculateReachableRanges([
      { origin: [4.9, 52.3], budget: { type: 'timeMinutes', value: 30 } },
      { origin: [4.5, 51.9], budget: { type: 'timeMinutes', value: 30 } },
      { origin: [5.1, 52.1], budget: { type: 'timeMinutes', value: 30 } }
      ]);

      // Compare the range spent on 10% versus 20% of the battery
      const electricVehicle = {
      engineType: 'electric' as const,
      model: {
      engine: {
      consumption: { speedsToConsumptionsKWH: [{ speedKMH: 80, consumptionUnitsPer100KM: 12 }] },
      charging: { maxChargeKWH: 60 }
      }
      }
      };
      const batteryRanges = await calculateReachableRanges([
      { origin: [4.9, 52.3], budget: { type: 'spentChargePCT', value: 10 }, vehicle: electricVehicle },
      { origin: [4.9, 52.3], budget: { type: 'spentChargePCT', value: 20 }, vehicle: electricVehicle }
      ]);