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
| <script type="text/javascript">
window.onload = function() {
// Coordonnées du cinéma Pathé Bellecour Lyon
var myLatlng = new google.maps.LatLng(<?php echo $this->lat; ?>,<?php echo $this->lng; ?>);
// Carte centrée
var myMapOptions = {
zoom: 8,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
// Création de la carte
var myMap = new google.maps.Map(
document.getElementById('div_carte'),
myMapOptions
);
// Création du Marker
var myMarker = new google.maps.Marker({
// Coordonnées du cinéma
position: myLatlng,
map: myMap,
title: myMap.getCenter().toUrlValue(),
draggable: true,
title: "<?php echo $this->name; ?>"
});
var marqueur = new google.maps.Marker( myMarker );
google.maps.event.addListener( marqueur, "dragend", function( evenement ) {
marqueur.setTitle( evenement.latLng.toUrlValue() ); // ou : this.setTitle( evenement.latLng.toUrlValue() );
});
}
</script> |
Partager