juskiewicz/geolocation
Composer 安装命令:
composer require juskiewicz/geolocation
包简介
Biblioteka obsługująca Geocoding API firmy Google
README 文档
README
Klasa Geolocation łączy się z Google Maps API i wyszukuje współrzędne lub adres.
Instalacja
Composer
Za pomocą Composer możesz zawsze pobrać najnowszą wersję.
composer require juskiewicz/geolocation
Sprawdź w Packagist.
Przykłady użycia
getCoordinatesByObject
Pobiera obiekt Coordinates za pomocą obiektu Address.
$streetName = 'Maltańska'; $streetNumber = '1', $postalCode = '61-131', $locality = 'Poznań', $country = 'Polska', $address = new Address( null, $streetName, $streetNumber, $postalCode, $locality, $country ); $geolocation = new Geolocation('YOUR_GOOGLE_MAPS_API_KEY', 'pl', 'pl'); $coordinates = $coordinates = $geolocation->getCoordinatesByObject($address); // Współrzędne $latitude = $coordinates->getLatitude(); $longitude = $coordinates->getLongitude(); $tablica = $coordinates->toArray();
getCoordinatesByString
Pobiera obiekt Coordinates za pomocą stringu.
$address = "Maltańska 1, 61-131 Poznań, Polska"; $geolocation = new Geolocation('YOUR_GOOGLE_MAPS_API_KEY', 'pl', 'pl'); $coordinates = $geolocation->getCoordinatesByString($address);
getAddress
Pobiera obiekt Address za pomocą obiektu Coordinates.
$latitude = 51.8990865; $longitude = 17.7863699; $coordinates = new Coordinates($latitude, $longitude); $geolocation = new Geolocation('YOUR_GOOGLE_MAPS_API_KEY','pl', 'pl'); $address = $geolocation->getAddress($coordinates);
Sprawdź źródło klasy Geolocation. Sprawdź źródło klasy Address. Sprawdź źródło klasy Coordinates.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-14