hector68 / mkad-google-distance
There is no license information available for the latest version (dev-master) of this package.
dev-master
2018-01-05 11:07 UTC
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: 2024-10-27 05:29:00 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);