Browse Source

Ajout provider geocoder

feature/export_comptable
Guillaume 4 years ago
parent
commit
b58903888c
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      ShopBundle/Services/Utils.php

+ 11
- 0
ShopBundle/Services/Utils.php View File

use EasyCorp\Bundle\EasyAdminBundle\Configuration\ConfigManager; use EasyCorp\Bundle\EasyAdminBundle\Configuration\ConfigManager;
use Geocoder\Model\Coordinates; use Geocoder\Model\Coordinates;
use Geocoder\Provider\Addok\Addok; use Geocoder\Provider\Addok\Addok;
use Geocoder\Provider\GoogleMaps\GoogleMaps;
use Geocoder\Provider\Nominatim\Nominatim;
use Geocoder\Query\GeocodeQuery; use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery; use Geocoder\Query\ReverseQuery;
use Lc\ShopBundle\Context\ImageInterface; use Lc\ShopBundle\Context\ImageInterface;
public function getGeocoderProvider() public function getGeocoderProvider()
{ {
$symfonyClient = new HttplugClient(); $symfonyClient = new HttplugClient();

/* API du gouvernement */
$provider = new Addok($symfonyClient, 'https://api-adresse.data.gouv.fr') ; $provider = new Addok($symfonyClient, 'https://api-adresse.data.gouv.fr') ;

/* Google Maps */
//$provider = new GoogleMaps($symfonyClient, null, '') ;

/* Nominatim : OpenStreetMap */
//$provider = Nominatim::withOpenStreetMapServer($symfonyClient, 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion');

return $provider ; return $provider ;
} }



Loading…
Cancel
Save