2017 © Pedro Peláez
 

library lbs

百度 LBS WEB 服务 API 的 PHP 封装实现.

image

yoozi/lbs

百度 LBS WEB 服务 API 的 PHP 封装实现.

  • Monday, September 28, 2015
  • by yangg
  • Repository
  • 9 Watchers
  • 6 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

LBS

Build Status, (*1)

This library is part of Project Golem, see yoozi/golem for more info., (*2)

本 LBS 库是百度地图 LBS WEB API 的简单 PHP 封装。目前支持如下几个 API:, (*3)

Installation

The best and easy way to install the Golem package is with Composer., (*4)

  1. Open your composer.json and add the following to the require array:, (*5)

    "yoozi/lbs": "1.0.*"
    
  2. Run Composer to install or update the new package dependencies., (*6)

    php composer install
    

    or, (*7)

    php composer update
    

Usage Example

以下使用 Place Suggestion API 查询关键词为 广州市 尚德大厦 地标信息:, (*8)

<?php

use Yoozi\LBS\Query\Place;
use Yoozi\LBS\Search;

$place = new Place;
$place->set('method', 'suggestion');
$place->set('q', '尚德大厦');
$place->set('region', '广州市');

$search = new Search('E4805d16520de693a3fe707cdc962045', $place);

var_dump($search->run()->toArray());

Data returned:, (*9)

array(3) {
  ["status"]=>
  int(0)
  ["message"]=>
  string(2) "ok"
  ["result"]=>
  array(4) {
    [0]=>
    array(5) {
      ["name"]=>
      string(12) "尚德大厦"
      ["city"]=>
      string(9) "广州市"
      ["district"]=>
      string(9) "天河区"
      ["business"]=>
      string(0) ""
      ["cityid"]=>
      string(3) "257"
    }
    [1]=>
    array(5) {
      ["name"]=>
      string(16) "尚德大厦a座"
      ["city"]=>
      string(0) ""
      ["district"]=>
      string(0) ""
      ["business"]=>
      string(0) ""
      ["cityid"]=>
      string(1) "0"
    }
    [2]=>
    array(5) {
      ["name"]=>
      string(22) "尚德大厦-停车场"
      ["city"]=>
      string(9) "广州市"
      ["district"]=>
      string(9) "天河区"
      ["business"]=>
      string(0) ""
      ["cityid"]=>
      string(3) "257"
    }
    [3]=>
    array(5) {
      ["name"]=>
      string(18) "西安尚德大厦"
      ["city"]=>
      string(9) "西安市"
      ["district"]=>
      string(9) "新城区"
      ["business"]=>
      string(0) ""
      ["cityid"]=>
      string(3) "233"
    }
  }
}

The Versions

28/09 2015

dev-master

9999999-dev http://golem.yoozi.cn/

百度 LBS WEB 服务 API 的 PHP 封装实现.

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding place baidu lbs golem yoozi

27/10 2014

1.0.8

1.0.8.0 http://golem.yoozi.cn/

百度 LBS WEB 服务 API 的 PHP 封装实现.

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding place baidu lbs golem yoozi

20/08 2014

1.0.7

1.0.7.0 http://golem.yoozi.cn/

百度 LBS WEB 服务 API 的 PHP 封装实现.

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding place baidu lbs golem yoozi

19/08 2014

1.0.6

1.0.6.0 http://golem.yoozi.cn/

百度 LBS WEB 服务 API 的 PHP 封装实现.

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding place baidu lbs golem yoozi