sotechn/yii2-geohash 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

sotechn/yii2-geohash

Composer 安装命令:

composer require sotechn/yii2-geohash

包简介

geohash like python-geohash

README 文档

README

Description

Generate geohash, it is a hierarchical spatial data structure which subdivides space into buckets of grid shape, which is one of the many applications of what is known as a Z-order curve, and generally space-filling curves. See more https://en.wikipedia.org/wiki/Geohash

Getting Started

Install

composer require sotechn/yii2-geohash

or add your composer.json

"require": {
	...
	"sotechn/yii2-geohash": "~0.1.0"
},

System Requirements

You need PHP >= 5.4.0, Yii ~ 2.0.4

Usage

in your config file

/congig/web.php

added component:

'components' => [
	...
	'geohash' => [
		'class' => 'sotechn\geohash\Geohash',
	],
]

after you've added it, you can use it

$hash = Yii::$app->geohash->encode($longitude, $latitude, $prec);

and you can also use behavior with model

public function behaviors()
{
    return [
		...
		['class' => \sotechn\geohash\behaviors\Geohash::className(),]
    ];
}

you can specify their fields to be used and precision that you use in your default project:

[
	'class' => \sotechn\geohash\behaviors\Geohash::className(),
	'fieldLng' => 'longitude', // default 'lng'
	'fieldLat' => 'latitude', // default 'ltd'
	'fieldHash' => 'hash', // default 'geohash'
	'defaultPrec' => '0.00000001', // default 0.00001
]

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2017-02-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固