kmlaravel/laravel-geographical-calculator

laravel地理计算包,使用多个算法帮助您处理坐标,以实现地理计算。

v2.2.0 2022-02-08 18:20 UTC

README

logo

地理计算器

License PHP Composer Check & fix styling Run tests Code Quality

地理计算器是为laravel 5.8+开发的,帮助您实现地理计算,提供多个算法帮助您处理坐标。

安装

1 - 依赖

第一步是使用composer安装包并自动更新您的composer.json文件,您可以通过运行以下命令完成此操作:

composer require kmlaravel/laravel-geographical-calculator
2 - 使用发布命令将包提供者复制到您的本地配置中,这将发布配置
php artisan geo:install

特性

配置选项

添加自定义单位、键等。

    /*
    |--------------------------------------------------------------------------
    | units values
    |--------------------------------------------------------------------------
    | your custom units, the initial units its convert from a mile to any value
    | (1.609344) is the conversion factor from a mile to a kilometer
    */
    'units' => [
        'mile' => 1,
        'km' => 1.609344,
        'm' => (1.609344 * 1000),
        'cm' => (1.609344 * 100),
        'mm' => (1.609344 * 1000 * 1000),
    ],

    /*
    |--------------------------------------------------------------------------
    | distance_key_prefix
    |--------------------------------------------------------------------------
    | if you declared more than tow points to resolve their distance,
    | you will see the result in the following format:
    | "1-2" => ["km" => "some result"],
    | "2-3" => ["km" => "some result"],
    | "3-4" => ["km" => "some result"],
    | and if you want to set any prefix before each index
    | you must change the below value to any value you want.
    |
    */
    'distance_key_prefix' => '',

变更日志

有关最近更改、更新或添加的信息,请参阅变更日志

安全

如果您发现任何安全相关的问题,请首先通过karam2mustafa@gmail.com发送电子邮件,如果在短时间内我们没有修复它,请打开一个新的问题,描述您的问题。

致谢

karam mustafa