65 lines
1.3 KiB
PHP
65 lines
1.3 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace Modules\RestaurantDelivery\Contracts;
|
||
|
|
|
||
|
|
interface MapsServiceInterface
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Get route between two points.
|
||
|
|
*/
|
||
|
|
public function getRoute(
|
||
|
|
float $originLat,
|
||
|
|
float $originLng,
|
||
|
|
float $destLat,
|
||
|
|
float $destLng,
|
||
|
|
array $options = []
|
||
|
|
): ?array;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get distance between two points.
|
||
|
|
*/
|
||
|
|
public function getDistance(
|
||
|
|
float $originLat,
|
||
|
|
float $originLng,
|
||
|
|
float $destLat,
|
||
|
|
float $destLng
|
||
|
|
): ?array;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get ETA between two points.
|
||
|
|
*/
|
||
|
|
public function getETA(
|
||
|
|
float $originLat,
|
||
|
|
float $originLng,
|
||
|
|
float $destLat,
|
||
|
|
float $destLng
|
||
|
|
): ?int;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Geocode an address to coordinates.
|
||
|
|
*/
|
||
|
|
public function geocode(string $address): ?array;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Reverse geocode coordinates to address.
|
||
|
|
*/
|
||
|
|
public function reverseGeocode(float $latitude, float $longitude): ?array;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Calculate distance using Haversine formula.
|
||
|
|
*/
|
||
|
|
public function calculateHaversineDistance(
|
||
|
|
float $lat1,
|
||
|
|
float $lng1,
|
||
|
|
float $lat2,
|
||
|
|
float $lng2
|
||
|
|
): float;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Decode polyline to array of coordinates.
|
||
|
|
*/
|
||
|
|
public function decodePolyline(string $encodedPolyline): array;
|
||
|
|
}
|