1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
<?php
mysql_connect("*****","****","****") ;
mysql_select_db("****") ;
extract($_POST) ;
echo'
<script type="text/javascript">
$(document).ready( function(){
var latlng = new google.maps.LatLng(45.05,2.7);
var options = {
center: latlng,
zoom: 9,
mapTypeId: google.maps.MapTypeId.TERRAIN
};
var carte = new google.maps.Map(document.getElementById("carte"), options);
var optionZone = {gridSize: 500, maxZoom: 15} ;
var tabMarqueur = [] ;
';
$r1 = "
SELECT
a.id, a.vid_assmat, a.sexe_assmat, a.nom_assmat, a.prenom_assmat, a.adresse_assmat, a.adresse2_assmat, a.cp_assmat, a.ville_assmat, a.num_assmat, a.lat_assmat, a.lng_assmat
FROM assmat a
WHERE a.lat_assmat != 0 AND a.lng_assmat != 0 AND a.lat_assmat BETWEEN 44.52112 AND 45.600347 AND a.lng_assmat BETWEEN 1.927414 AND 3.738556 and ville_assmat like '%".$recherche."%'
";
$q1 = mysql_query( $r1 ) ;
$resQ1 = mysql_num_rows( $q1 );
while( $data1 = mysql_fetch_assoc( $q1 ) ){
echo'
var marqueur = new google.maps.Marker({
position: new google.maps.LatLng('.$data1["lat_assmat"].','.$data1["lng_assmat"].'),
map: carte,
title: "'.$data1["lat_assmat"].','.$data1["lng_assmat"].'",
clickable: true,
icon: "http://www.cantal.com/img/google/cantal_AUVERGNE.png",
});
tabMarqueur.addMarker(marqueur);
';
}
echo'
var zone = new MarkerClusterer( carte, tabMarqueur, optionZone ) ;
});
</script>
';
?> |
Partager