You can try using Matrix Routing API with asynchronous option.
Here Matrix Routing API
The Matrix Routing service fulfills a single purpose: it calculates routing matrices (of travel times and/or distances). It supports matrices of any size up to 10,000 x 10,000.
This service is for you if you need to calculate a routing matrix
- with custom options and dynamic traffic applied, given the origins and destinations are within a certain region with diameter up to 400 km, or
- with routes of arbitrary length given a predefined set of options that can be used with free-flow speed traffic applied, or
- with custom options, dynamic traffic and no region size limitation, for up to 15 origins and 100 destinations, or up to 100 origins and 1 destination.
Sample code:
JSON Request Body:
{
"origins": [{"lat": 0.0, "lng": 0.0}, {"lat": 0.1, "lng": 0.1}, ...],
"destinations": [...], // if omitted, origins are used as destinations
"regionDefinition": {
"type": "circle",
"center": {"lat": 0.0, "lng": 0.0},
"radius": 10000
}
}
For more options you can look at Here Documentation
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…