承接 nemesis/laragis 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nemesis/laragis

Composer 安装命令:

composer require nemesis/laragis

包简介

A geospatial library and set of utilities for Laravel. This is fork from https://github.com/ralphschindler/laragis

README 文档

README

LaraGis provides geospatial database and Eloquent features to Laravel.

Features:

  • Simple Entity API, for use in casting model properties
  • Fast serialization of geospatial data from MySql (not PHP userland) via ST_AsGeoJSON()

Installation

To get started with Socialite, add to your composer.json file as a dependency:

composer require ralphschindler/laragis

Configuration

After installing the Socialite library, register the LaraGis\LaraGisProvider in your config/app.php configuration file:

'providers' => [
    // Other service providers...

    LaraGis\LaraGisProvider::class,
],

Basic Usage

To use in Eloquent based models, use the LaraGisTrait, and specify a column to be cast into a geospatial datatype with the laragis key in the $casts array:

class Place extends Model
{
    use LaraGisTrait;

    protected $table = 'places';

    protected $casts = [
        'coordinates' => 'laragis'
    ];
}
$place = App\Places::find(1);
$coordinates = $place->coordinates;
echo $coordinates->getLatitudeLongitude(); // "30, -90"

Entity API

/**
 * @property double $latitude
 * @property double $longitude
 */
class Coordinates {
    public function __construct($latitude = null, $longitude = null);
    public function setLatitude($latitude);
    public function getLatitude();
    public function setLongitude($longitude);
    public function getLongitude();
    public function castToString($separator, $coordinatesOrder = self::LATITUDE_FIRST)
}

class Area implements \IteratorAggregate, \Countable {
    public function addCoordinates(Coordinates $coordinates);
    public function getCoordinates();
}

统计信息

  • 总下载量: 116
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: UNLICENSE
  • 更新时间: 2017-04-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固