定制 rozklad/heremaps-flexible-polyline 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

rozklad/heremaps-flexible-polyline

最新稳定版本:1.0.3

Composer 安装命令:

composer require rozklad/heremaps-flexible-polyline

包简介

PHP implementation of Flexible Polyline encoding: a lossy compressed representation of a list of coordinate pairs or triples

README 文档

README

composer test

Usage

Decode

FlexiblePolyline::decode(string $encoded): array

$data = FlexiblePolyline::decode('BlBoz5xJ67i1BU1B7PUzIhaUxL7YU');
/** $data:
[
    'precision' => 5,
    'thirdDim' => 2,
    'thirdDimPrecision' => 0,
    'polyline' => [
        [50.10228, 8.69821, 10],
        [50.10201, 8.69567, 20],
        [50.10063, 8.6915, 30],
        [50.09878, 8.68752, 40]
    ]
]
*/

Encode

FlexiblePolyline::encode(array $coordinates [, int $precision = null, int $thirdDim = null, int $thirdDimPrecision = 0]): string

$encoded = FlexiblePolyline::encode([
    [50.10228, 8.69821, 10],
    [50.10201, 8.69567, 20],
    [50.10063, 8.6915, 30],
    [50.09878, 8.68752, 40]
], 5, 2, 0);
/** $encoded:
BlBoz5xJ67i1BU1B7PUzIhaUxL7YU
*/

Third Dimension

FlexiblePolyline::getThirdDimension(string $encoded): int

$thirdDimension = FlexiblePolyline::getThirdDimension('BVoz5xJ67i1BU')
/** $thirdDimension:
1
*/

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-02