nuicart / dutchgeo
此软件包已废弃,不再维护。未建议替代包。
对于所有寻求使用Google地图API将荷兰邮政编码转换为经纬度坐标的非荷兰语使用者。
v0.0.1
2017-04-13 11:29 UTC
Requires (Dev)
- phpunit/phpunit: ^6.1
This package is auto-updated.
Last update: 2020-06-10 12:13:15 UTC
README
通过荷兰邮政编码/邮编获取经纬度。如果你会说荷兰语,这是一项简单的工作,但对于非母语者来说则需要一点搜索。
入门指南
只需使用composer安装,调用 Postal::getLatLong('1421AW'); 然后您就完成了。该脚本使用curl,因此您需要安装具有lib curl的php,或者复制/粘贴源代码并使用file_get_contents。
作者
- Anton Boutkam
许可证
本项目采用MIT许可证 - 详细内容请参阅LICENSE.md 文件
用法
try{
$oLatLong = Postal::getLatLong('1421AW');
}
catch(NotFoundException $e)
{
// The postal was not found, is it a real address?
// Make someone fix the addresss?
}
catch(InvalidArgumentException $e)
{
// The format of the postal/zip code is does not comply with Dutch standards: /^[0-9]{4}[A-Z]{2}$/,
// Make someone fix the addresss?
}
catch(ApiException $e)
{
// Have a look at your cronjob / script. To many queries maybe?
}