google street view pas du tout à l'adresse de la fiche d'identité affichée, issue #0000221
This commit is contained in:
parent
147f4b86cf
commit
2d9ef40720
@ -1,5 +1,6 @@
|
||||
<div id="infogeo" class="clearfix">
|
||||
<div id="infogeo_txt" style="float:left;width:200px;padding:20px 0 0 20px;">
|
||||
|
||||
<?php
|
||||
$google_map = './?page=referer&part=gmap&siret='.$siret.
|
||||
'&url=http://maps.google.fr/maps?f=q%26hl=fr%26geocode=%26q='.
|
||||
@ -9,116 +10,156 @@ $google_map = './?page=referer&part=gmap&siret='.$siret.
|
||||
',+'.$etab['CP'].'+'.
|
||||
urlencode($etab['Ville']);
|
||||
|
||||
if ($etab['GeoPrecis']>0) {
|
||||
?>
|
||||
<b>Information géographique :</b><br/>
|
||||
Latitude : <?=dec2dms($etab['GeoLat'])?> (<?=$etab['GeoLat']?>)<br/>
|
||||
Longitude : <?=dec2dms($etab['GeoLon'])?> (<?=$etab['GeoLon']?>)<br/>
|
||||
<?php
|
||||
if ($etab['GeoPrecis'] > 0) {
|
||||
print '<span id="geolocalisation">';
|
||||
print '<b>Information géographique :</b><br/>'.
|
||||
'Latitude : '. dec2dms($etab['GeoLat']).' ('.$etab['GeoLat'].')<br/>'.
|
||||
'Longitude : '.dec2dms($etab['GeoLon']).' ('.$etab['GeoLon'].')<br/>';
|
||||
print '</span>';
|
||||
}
|
||||
?>
|
||||
|
||||
<a href="<?=$google_map?>" target="_blank">
|
||||
Afficher l'adresse sur Google Map ©</a><br/>
|
||||
<br/>
|
||||
<b>Code commune / Rivoli :</b><br/>
|
||||
<?=$etab['Dept'].' '.$etab['codeCommune']?> / <?=$etab['Rivoli']?>
|
||||
<?php print $etab['Dept'].' '.$etab['codeCommune'].' / '.$etab['Rivoli']; ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if( hasPref('mappy') ){
|
||||
if (hasPref('mappy')) {
|
||||
require_once 'mappy/mappy.php';
|
||||
$photo = '';
|
||||
$ville = ' '.trim(preg_replace('/([0-9]|ARRONDISSEMENT|_)/i', ' ',
|
||||
$etab['Ville'])).' ';
|
||||
$ville = trim(strtr($ville, array(' EME ' => '', ' ER ' => '')));
|
||||
if (in_array(strtoupper($ville), $tabVilleMappy)) {
|
||||
$rue = trim(strtr(normaliseVoie($etab['AdresseVoie']).' '.
|
||||
$etab['AdresseRue'],
|
||||
array(' ST ' => ' SAINT ', ' STE ' => ' SAINTE ')));
|
||||
$photo = contentSrc($ville, $rue, $etab['AdresseNum'], $etab['CP']);
|
||||
$source = 'm';
|
||||
} else {
|
||||
$photo = 'http://cbk0.google.com/cbk?output=thumbnail&w=150&h=69&ll='.
|
||||
$etab['GeoLat'].','.$etab['GeoLon'];
|
||||
if (@fopen($photo, 'r') == false) {
|
||||
$photo = '';
|
||||
}
|
||||
$source = 'g';
|
||||
}
|
||||
|
||||
require_once 'mappy/mappy.php';
|
||||
$photo = '';
|
||||
$ville = ' '.trim(preg_replace('/([0-9]|ARRONDISSEMENT|_)/i', ' ',
|
||||
$etab['Ville'])).' ';
|
||||
$ville = trim(strtr($ville, array(' EME ' => '', ' ER ' => '')));
|
||||
if ( in_array(strtoupper($ville), $tabVilleMappy) ) {
|
||||
$rue = trim(strtr(normaliseVoie($etab['AdresseVoie']).' '.
|
||||
$etab['AdresseRue'],
|
||||
array(' ST ' => ' SAINT ', ' STE ' => ' SAINTE ', )));
|
||||
$photo = contentSrc($ville, $rue, $etab['AdresseNum'], $etab['CP']);
|
||||
$source = 'm';
|
||||
} else {
|
||||
$photo = 'http://cbk0.google.com/cbk?output=thumbnail&w=150&h=69&ll='.
|
||||
$etab['GeoLat'].','.$etab['GeoLon'];
|
||||
if (@fopen($photo, 'r') == false) {
|
||||
$photo = '';
|
||||
}
|
||||
$source = 'g';
|
||||
}
|
||||
|
||||
if ($photo != '') {
|
||||
?>
|
||||
if ($photo != '') {
|
||||
?>
|
||||
<div id="infogeo_photo" style="float:left;margin:0;padding:0;width:340px;">
|
||||
<?php
|
||||
if ($source == 'm') {
|
||||
?>
|
||||
<iframe src="<?=$photo?>" width="340px" height="320px" scrolling="no"
|
||||
frameborder="0"></iframe>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div style="width:278px;margin:5px 0 10px 0;padding:10px;border:1px solid #0000ff;color:#0000ff;">
|
||||
Cliché à l'approche de l'adresse postale.
|
||||
</div>
|
||||
<div>
|
||||
<img id="pp-cb-thumb" src="<?=$photo?>" width="300px" height="128px" />
|
||||
</div>
|
||||
<?php
|
||||
switch($_SERVER['SERVER_NAME'])
|
||||
{
|
||||
case 'extranet.devlocal.com':
|
||||
$key = 'ABQIAAAAgaXnaVXxxcgebvrN30E-VhT6B-FIN0IQI1kCChCUYV6RpBO17hTl__Sqiv_xQZFCiaRgHAoc_v9HcQ';
|
||||
break;
|
||||
case 'extranetrec.scores-decisions.com':
|
||||
$key = 'ABQIAAAAuKBtUyFonYJBl1fqfc78tRQQcNgS-tLiAG-ic2CW9PypgC_xRhTjSL9-5iBPvj3GA1_AvZYQU_QR3Q';
|
||||
break;
|
||||
case 'extranet.scores-decisions.com':
|
||||
$key = 'ABQIAAAAuKBtUyFonYJBl1fqfc78tRSYaqxLwFTMDT_MtTSFor1bsUZ_ChTvuzyTINkPMlW88Ar9fofaphzN3w';
|
||||
break;
|
||||
default:
|
||||
$key = '';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if ($source == 'm') {
|
||||
?>
|
||||
<iframe src="<?=$photo?>" width="340px" height="320px" scrolling="no"
|
||||
frameborder="0">
|
||||
</iframe>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div id="legende-photo"
|
||||
style="width:278px;margin:5px 0 10px 0;padding:10px;border:1px solid
|
||||
#0000ff;color:#0000ff;">
|
||||
Cliché à l'approche de l'adresse postale.
|
||||
</div>
|
||||
<div>
|
||||
<img id="pp-cb-thumb" src="<?=$photo?>" width="300px" height="128px" />
|
||||
</div>
|
||||
|
||||
<?php
|
||||
switch ($_SERVER['SERVER_NAME']) {
|
||||
case 'extranet.devlocal.com':
|
||||
$key = 'ABQIAAAAgaXnaVXxxcgebvrN30E-VhT6B-FIN0IQI1kCChCUYV6RpBO17hTl__Sqiv_xQZFCiaRgHAoc_v9HcQ';
|
||||
break;
|
||||
case 'extranetrec.scores-decisions.com':
|
||||
$key = 'ABQIAAAAuKBtUyFonYJBl1fqfc78tRQQcNgS-tLiAG-ic2CW9PypgC_xRhTjSL9-5iBPvj3GA1_AvZYQU_QR3Q';
|
||||
break;
|
||||
case 'extranet.scores-decisions.com':
|
||||
$key = 'ABQIAAAAuKBtUyFonYJBl1fqfc78tRSYaqxLwFTMDT_MtTSFor1bsUZ_ChTvuzyTINkPMlW88Ar9fofaphzN3w';
|
||||
break;
|
||||
default:
|
||||
$key = '';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="http://maps.google.com/maps?file=api&v=2&key=<?=$key?>">
|
||||
src="http://maps.google.com/maps?file=api&v=2&key=<?=$key?>">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function showPanoData(panoData) {
|
||||
function showPanoData(panoData) {
|
||||
if (panoData.code != 200) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
$("#pp-cb-thumb").replaceWith("\
|
||||
<div style=float:left;position:relative;width:256px;height:128px;overflow:hidden;>\
|
||||
<img style=position:relative;left:-256px;top:-140px;\
|
||||
src=http://maps.google.fr/cbk?output=tile&panoid=" +
|
||||
panoData.location.panoId +
|
||||
"&zoom=1&x=0&y=0&cb_client=maps_sv />\
|
||||
</div>\
|
||||
<div style=float:left;position:relative;width:44px;height:128px;overflow:hidden;>\
|
||||
<img style=position:relative;top:-140px;\
|
||||
src=http://maps.google.fr/cbk?output=tile&panoid=" +
|
||||
panoData.location.panoId +
|
||||
"&zoom=1&x=1&y=0&cb_client=maps_sv />\
|
||||
</div>");
|
||||
}
|
||||
function affichePhoto() {
|
||||
var ll = new GLatLng(<?=$etab['GeoLat']?>, <?=$etab['GeoLon']?>);
|
||||
$("#pp-cb-thumb").replaceWith(
|
||||
"<div style=float:left;position:relative;" +
|
||||
"width:256px;height:128px;overflow:hidden;>\
|
||||
<img style=position:relative;left:-256px;top:-140px;\
|
||||
src=http://maps.google.fr/cbk?output=tile&panoid=" +
|
||||
panoData.location.panoId +
|
||||
"&zoom=1&x=0&y=0&cb_client=maps_sv />\
|
||||
</div>\
|
||||
<div style=float:left;position:relative;" +
|
||||
"width:44px;height:128px;overflow:hidden;>\
|
||||
<img style=position:relative;top:-140px;\
|
||||
src=http://maps.google.fr/cbk?output=tile&panoid=" +
|
||||
panoData.location.panoId +
|
||||
"&zoom=1&x=1&y=0&cb_client=maps_sv />\
|
||||
</div>");
|
||||
}
|
||||
function doShowPanoData(ll) {
|
||||
var panoClient = new GStreetviewClient();
|
||||
panoClient.getNearestPanorama(ll, showPanoData);
|
||||
}
|
||||
$(document).ready(function() {
|
||||
if ($('#pp-cb-thumb').length) {
|
||||
affichePhoto();
|
||||
}
|
||||
function geoCodeCB(reponse) {
|
||||
if (reponse &&
|
||||
reponse.Status.code == 200 &&
|
||||
reponse.Placemark.length == 1) {
|
||||
var lat = reponse.Placemark[0].Point.coordinates[1];
|
||||
var lon = reponse.Placemark[0].Point.coordinates[0];
|
||||
var ll = new GLatLng(lat, lon);
|
||||
$("#geolocalisation").
|
||||
replaceWith("<b>Information géographique :</b><br/>" +
|
||||
"Latitude : " + lat + "<br/>" +
|
||||
"Longitude : " + lon + "<br/>");
|
||||
doShowPanoData(ll);
|
||||
} else {
|
||||
$("#geolocalisation").remove();
|
||||
$("#legende-photo" ).remove();
|
||||
$("#pp-cb-thumb" ).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
function affichePhoto() {
|
||||
<?php
|
||||
if ($etab['GeoPrecis'] < 7) {
|
||||
print 'var geoCoder = new GClientGeocoder;';
|
||||
print 'geoCoder.getLocations("'.
|
||||
$etab['AdresseNum'].' '.
|
||||
$etab['AdresseRue'].' '.
|
||||
$etab['CP'].' '.
|
||||
$etab['Ville'].'", geoCodeCB);';
|
||||
} else {
|
||||
print 'var ll = new GLatLng('.$etab['GeoLat'].', '.$etab['GeoLon'].');';
|
||||
print 'doShowPanoData(ll);';
|
||||
}
|
||||
?>
|
||||
}
|
||||
$(document).ready(function() {
|
||||
if ($('#pp-cb-thumb').length) {
|
||||
affichePhoto();
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user