2013-11-21 16:31:49 +00:00

50 lines
1.4 KiB
PHP

<?php
class Scores_Google_Maps
{
protected $url = 'http://maps.google.fr/maps?f=q&hl=fr&geocode=&q=';
protected $urlPhoto = '';
public function getGoogleKey($domain)
{
switch ($domain) {
case 'extranet.sd.dev':
return 'ABQIAAAAuKBtUyFonYJBl1fqfc78tRTTQao-JYbZvohjws19Eq-s8HocrxTKnnmfOnWxcHe01UHRIkRkZ1f17Q';
break;
case 'extranet.sd.lan':
return 'ABQIAAAAuKBtUyFonYJBl1fqfc78tRSKTEtsiH12Xc5SNL4Zmo_wRXVkrxR4jPIy3GOKGzZxBEOkvOsLG2CJ3w';
break;
case 'extranet-2.0.sd.lan':
return 'ABQIAAAAuKBtUyFonYJBl1fqfc78tRTy4fRlC-SwcCZRiggZoieobzFAiRR6bORav5_Dl3324CqVALrh-ciGFQ';
break;
case 'extranetrec.scores-decisions.com':
return 'ABQIAAAAuKBtUyFonYJBl1fqfc78tRQQcNgS-tLiAG-ic2CW9PypgC_xRhTjSL9-5iBPvj3GA1_AvZYQU_QR3Q';
break;
case 'extranet.scores-decisions.com':
//return 'ABQIAAAAuKBtUyFonYJBl1fqfc78tRQvADPcxwXf3Q2QIE-M32vuSkrxiBRLUHDB_YSLeTscTDeWRKM_wILaaw';
return 'ABQIAAAAuKBtUyFonYJBl1fqfc78tRSYaqxLwFTMDT_MtTSFor1bsUZ_ChTvuzyTINkPMlW88Ar9fofaphzN3w';
break;
}
}
protected function supprDecimales($dec)
{
if ($dec>0 )
return floor($dec);
else
return ceil($dec);
}
public function dec2dms($dec)
{
$d = $this->supprDecimales($dec);
$m = $this->supprDecimales(($dec - $d) * 60);
$s = abs(round(((($dec - $d) * 60) - $m) * 60));
$m = abs($m);
return $d.'°'.$m."'".$s.'"';
}
public function getGoogleMapLink($q)
{
return $this->url.$q;
}
}