hector68 / mkad-google-distance
Installs: 1 040
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 3
Open Issues: 0
Requires
- php: >=7.0.0
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: 4.6.*
- satooshi/php-coveralls: dev-master
This package is not auto-updated.
Last update: 2025-03-30 07:19:27 UTC
README
... или других объектов
Использование
Через Google APi
$provider = new GoogleDistanceProvider($key);
$mkad = new MkadPolygon();
$pointOutMkad = new Point(55.731727, 36.851284);
$distance = DistanceHelper::getDistance($pointOutMkad, $mkad, $provider);
$this->assertTrue($distance > 0);
$pointInMkad = new Point(55.705485, 37.673276);
$distance = DistanceHelper::getDistance($pointInMkad, $mkad, $provider);
$this->assertTrue($distance === 0);
Определять расстояние напрямую
$provider = new DirectDistanceProvider();
$mkad = new MkadPolygon();
$pointOutMkad = new Point(55.731727, 36.851284);
$distance = DistanceHelper::getDistance($pointOutMkad, $mkad, $provider);
$this->assertTrue($distance > 0);
$pointInMkad = new Point(55.705485, 37.673276);
$distance = DistanceHelper::getDistance($pointInMkad, $mkad, $provider);
$this->assertTrue($distance === 0);