Log in
Model

GetDistance

Magento\InventoryDistanceBasedSourceSelection\Model\DistanceProvider\GoogleMap\GetDistance

What it does

This class calculates the distance or travel time between two geographic coordinates using Google Maps Distance Matrix API.

Developers use it when implementing distance-based source selection to determine which inventory source is closest to a delivery destination.

It caches results to avoid redundant API calls and supports both distance and time-based calculations based on configuration.

Public Methods

  • execute()