Ajout méthode GeoCode, issue #0000379
This commit is contained in:
parent
c03280bb56
commit
0b5d19426c
@ -61,3 +61,5 @@ Type.59 = "MandataireReturn"
|
||||
Type.60 = "MandataireDetail"
|
||||
Type.61 = "ListeJalCollecteReturn"
|
||||
Type.62 = "JalCollecte"
|
||||
Type.63 = "GeoCodeReturn"
|
||||
Type.64 = "GeoCode"
|
@ -960,3 +960,28 @@ class JalCollecte
|
||||
/** @var string */
|
||||
public $nom;
|
||||
}
|
||||
|
||||
class GeoCodeReturn
|
||||
{
|
||||
/** @var ErrorType */
|
||||
public $error;
|
||||
/** @var GeoCode */
|
||||
public $result;
|
||||
}
|
||||
|
||||
class GeoCode
|
||||
{
|
||||
/** @var string */
|
||||
public $latitude;
|
||||
/** @var string */
|
||||
public $longitude;
|
||||
/** @var string */
|
||||
public $precis;
|
||||
/** @var string */
|
||||
public $adresseValidee;
|
||||
/** @var string */
|
||||
public $latitudeDeg;
|
||||
/** @var string */
|
||||
public $longitudeDeg;
|
||||
}
|
||||
|
||||
|
@ -3641,36 +3641,39 @@ if ($infoEnq['LitigeChoix']<>'non')
|
||||
return array('error'=>array('errnum'=>0, 'errmsg'=>''), 'results'=>$tabFichier);
|
||||
}
|
||||
|
||||
/** Geocodage d'une adresse
|
||||
**
|
||||
** @nodoc
|
||||
** @param string $adresse
|
||||
** @param string $cp
|
||||
** @param string $ville
|
||||
** @param string $pays
|
||||
**/
|
||||
protected function geoCode($adresse, $cp, $ville, $pays='France') {
|
||||
|
||||
$ligne=date('YmdHis').";$siren;MMap AVANT";
|
||||
$fp=fopen('/var/www/log/accesDistant.log', 'a');
|
||||
/**
|
||||
* Geocodage d'une adresse
|
||||
* @param string $adresse
|
||||
* @param string $cp
|
||||
* @param string $ville
|
||||
* @param string $pays
|
||||
* @return GeoCodeReturn
|
||||
*/
|
||||
public function geoCode($adresse, $cp, $ville, $pays='France')
|
||||
{
|
||||
$ligne = date('YmdHis').";$siren;MMap AVANT";
|
||||
$fp = fopen(LOG_PATH.'/accesDistant.log', 'a');
|
||||
fwrite($fp,$ligne.EOL);
|
||||
fclose($fp);
|
||||
|
||||
$mMap=new MMap($adresse, $cp, $ville, $pays);
|
||||
$mMap = new MMap($adresse, $cp, $ville, $pays);
|
||||
|
||||
$ligne=date('YmdHis').";$siren;MMap APRES";
|
||||
$fp=fopen('/var/www/log/accesDistant.log', 'a');
|
||||
$fp=fopen(LOG_PATH.'/accesDistant.log', 'a');
|
||||
fwrite($fp,$ligne.EOL);
|
||||
fclose($fp);
|
||||
|
||||
$tabRet=array( 'latitude'=>$mMap->latitudeDec,
|
||||
'longitude'=>$mMap->longitudeDec,
|
||||
'precis'=>$mMap->precision,
|
||||
'adresseValidee'=>prepareString($mMap->adresseValidee),
|
||||
'latitudeDeg'=>$mMap->latitudeDeg,
|
||||
'longitudeDeg'=>$mMap->longitudeDeg,
|
||||
);
|
||||
return array('error'=>array('errnum'=>0, 'errmsg'=>''), 'results'=>$tabRet);
|
||||
$geocode = new GeoCode();
|
||||
$geocode->latitude = $mMap->latitudeDec;
|
||||
$geocode->longitude = $mMap->longitudeDec;
|
||||
$geocode->precis = $mMap->precision;
|
||||
$geocode->adresseValidee = $mMap->adresseValidee;
|
||||
$geocode->latitudeDeg = $mMap->latitudeDeg;
|
||||
$geocode->longitudeDeg = $mMap->longitudeDeg;
|
||||
|
||||
$output = new GeoCodeReturn();
|
||||
$output->error = $error;
|
||||
$output->result = $geocode;
|
||||
}
|
||||
|
||||
/** Retourne les informations identitaires de l'entreprise ou de l'établissement demandé
|
||||
|
Loading…
x
Reference in New Issue
Block a user