rodgermd / geotools

PHP 5.4 地理工具

v0.1.0 2014-03-11 08:59 UTC

This package is not auto-updated.

Last update: 2024-09-24 06:06:58 UTC


README

Google Route Boxer 的 PHP 实现

http://gmaps-utility-library-dev.googlecode.com/svn/trunk/routeboxer/src/RouteBoxer.js

安装

在您的 composer.json 文件中添加此行

"bazo/geotools" : "v0.1.0"

运行 composer install

如何使用


//add all points from calculated route
$points = [
	[48.167, 17.104],
	[48.399, 17.586],
	[48.908, 18.049],
	[49.22253, 18.734436],
	[48.728115, 21.255798],
];

$collection = new GeoTools\LatLngCollection($points);

$boxer = new GeoTools\RouteBoxer();

//calculate boxes with 10km distance from the line between points
$boxes = $boxer->box($collection, $distance = 10);

//boxes now contain an array of LatLngBounds

享受