behlulbozal/location-search

这是为 Laravel 设计的包位置搜索

dev-main 2022-10-18 12:02 UTC

This package is not auto-updated.

Last update: 2024-10-01 20:58:06 UTC


README

特性

  • 在一个圆圈中找到你指定的半径米内的位置。
  • 从一个位置找到另一个位置的距离。
  • 获取 Google Maps 链接。只需提供经纬度。获取整个链接。

位置搜索 - PHP - Laravel

Tourist-Male-Holding-Map

入门指南

安装

composer require behlulbozal/location-search

迁移类型

将这些列添加到迁移中,列名和类型如下。

// Example Model Migration
 $table->double('latitude')->nullable();
 $table->double('longitude')->nullable();

开始

use behlulbozal\LocationSearch\Location;
Location::FindInCircle($lat, $long, $radius, Example::class);

用法

在圆圈内查找

Location::FindInCircle($latitude, $longitude, $radius, Example::class);

获取两个位置之间的距离

Location::GetDistance($latitude1, $longitude1, $latitude2, $longitude2);

获取 Google 链接

Location::GoogleLink($latitude1, $longitude1);

贡献

获取 Google 链接

你可以为升级创建 PR。打开问题或解决问题 ;)

BEHLÜL BOZAL