itssonu/lat-long

通过地址获取经纬度

v0.0.5 2021-11-23 12:29 UTC

This package is auto-updated.

Last update: 2024-09-23 18:31:48 UTC


README

Issues Stars

从地址获取经纬度

composer require itssonu/lat-long

获取经纬度

使用包

use itssonu\LatLong;

初始化

$latLong = new LatLong;

获取地址

您可以通过GET或POST请求获取动态地址,这里我们使用静态地址

$address = "clock tower ludhiana punjab";

获取经纬度方法

$result = $latLong->getLatLong($address);
$lat = $result->lat;
$long = $result->long;

只获取经度

$lat = $latLong->getLat($address);

只获取纬度

$long = $latLong->getLong($address);