PHP code example of billy-poon / coordtransform

1. Go to this page and download the library: Download billy-poon/coordtransform 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/ */

    

billy-poon / coordtransform example snippets




oordtransform\Helper as CoordinateHelper;

$gcj02 = [113.425221,22.507924];
list($lng, $lat) = $gcj02;

$wgs84 = CoordinateHelper::gcj02towgs84($lng, $lat);
$bd09 = CoordinateHelper::gcj02tobd09($lng, $lat);

var_dump(compact('gcj02', 'wgs84', 'bd09'));