PHP code example of jyun / mapsapi

1. Go to this page and download the library: Download jyun/mapsapi library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jyun / mapsapi example snippets


use Jyun\Mapsapi\TwddMap\Geocoding;

Mysql, Mongo        # 自行配置
MAP8_API_KEY=""     # 圖霸 KEY
GOOGLE_API_KEY=""   # Google API KEY

use Jyun\Mapsapi\TwddMap\Directions;

/**
 * Directions
 *
 * @param $origin
 * @param $destination
 * @param $mode ['driving', 'walking', 'bicycling'], default='driving'
 * @return array|mixed
*/
$directions = Directions::directions('25.0097038,121.4401783', '25.0108898,121.4346963');

use Jyun\Mapsapi\TwddMap\Geocoding;

$geocode = Geocoding::geocode('台北市內湖區瑞光路335號');

$reverseGeocode = Geocoding::reverseGeocode('25.0396476673,121.505226616');