pendonl / pro6pp-php-wrapper
Pro6PP API的包装器
v1.0.1
2016-11-11 03:06 UTC
Requires
- php: >=5.6.0
Requires (Dev)
- phpunit/phpunit: ~5.0
This package is auto-updated.
Last update: 2024-09-15 04:48:57 UTC
README
PendoNL/pro6pp-php-wrapper
软件包提供了一个简单易用的方式,用于与Pro6PP的API通信以获取基于位置的数据,例如地址、坐标等。以下是所有方法列表。
安装与使用
使用composer或下载zip文件安装该包。当下载zip文件时,您只需将Pro6pp.php包含在您的页面上。
composer require pendonl/pro6pp-php-wrapper
以下页面列出了所有方法。请参考Pro6pp的类和API文档,以获取所有参数的详细信息。
<?php require __DIR__ . '/vendor/autoload.php'; $Pro6pp = new \PendoNL\Pro6pp\Pro6pp('api_code', 'json'); /** * Autocomplete an address. This can be achieved in different ways * (1) With a nl_fourpp postalcode * (2) With a nl_sixpp postalcode * (3) With a nl_sixpp postalcode housenumber and extension */ $Pro6pp->autocomplete(6225); $Pro6pp->autocomplete('6225XS'); $Pro6pp->autocomplete('6225XS', 7); $Pro6pp->autocomplete('6225XS', 7, 'c'); /** * Reverse address look-up. Provide the method with valid lat/lng * and you'll be presented with an address if found. */ $Pro6pp->reverse(50.858030, 5.717376); /** * Find the nearest postalcodes from a given set of postalcodes compared * to a single postalcode. The second parameter takes an array with either * a nl_fourpp, a nl_sixpp or a set of lat/lng. */ $Pro6pp->locator(['6220','6221','6223','6224'], ['nl_fourpp' => 6216]); /** * Find all postals within a given range. The second parameter is in meters. */ $Pro6pp->range(6225, 2500); /** * Get autocomplete suggestions for city names, takes a second parameter for * the maximum number of results. */ $Pro6pp->suggest('Maast', 10); /** * Calculate the distance between two nl_fourpp, 3rd parameter can be set to 'road', * be carefull: this is for supported account only. */ $Pro6pp->distance(6225, 6210, 'straight'); /** * Calculate distance between two coordinates */ $Pro6pp->coordinateDistance(50.858030, 5.717376, 50.840078, 5.659258);
安全性
如果您发现任何安全相关的问题,请通过电子邮件joshua@pendo.nl联系,而不是使用问题跟踪器。
鸣谢
感谢Pro6PP为以合理的价格创建、维护和更新邮政数据库所做的努力。
关于Pendo
Pendo是一家位于荷兰马斯特里的网络开发公司。如果您愿意,可以访问我们的网站。
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。