PHP code example of burnbright / silverstripe-shop-geocoding
1. Go to this page and download the library: Download burnbright/silverstripe-shop-geocoding 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/ */
burnbright / silverstripe-shop-geocoding example snippets
$geocoder = new \Geocoder\Geocoder();
$adapter = new \Geocoder\HttpAdapter\CurlHttpAdapter();
$geocoder->registerProvider(
new \Geocoder\Provider\ChainProvider(array(
new \Geocoder\Provider\HostIpProvider($adapter),
new \Geocoder\Provider\GoogleMapsProvider($adapter)
))
);
AddressGeocoding::set_geocoder($geocoder);