Répondre

3

Si vous ne souhaitez pas utiliser d'icônes personnalisées pour chaque marqueur, je vous suggère de créer une classe d'étiquettes avec OverlayView, puis de lier la position au marqueur.

Ou vous pourriez envisager d'utiliser quelque chose comme: http://github.com/nmccready/google-maps-utility-library-v3-infobox

+0

Le lien est rompu. Heureusement, le rapport a été copié sur GitHub: https://github.com/nmccready/google-maps-utility-library-v3-infobox –

1

Je pense que la meilleure solution est d'utiliser un InfoWindow. Quelque chose comme ceci:

$(document).ready(function() { 
    var golfoMexico = new google.maps.LatLng(20.61536,-87.078975); 
    var settings = { 
     zoom: 18, 
     center: golfoMexico, 
     mapTypeControl: true, 
     mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, 
     navigationControl: true, 
     navigationControlOptions: {style: google.maps.NavigationControlStyle.ZOOM_PAN}, 
     mapTypeId: google.maps.MapTypeId.HYBRID 
    }; 

    var map = new google.maps.Map(document.getElementById("map_canvas"), settings); 
    var pos1= new google.maps.LatLng(20.61536,-87.078975); 
    var infowindow = new google.maps.InfoWindow({ 
      content: "Casa Stavola F8 II" 
     }); 
    var companyMarker = new google.maps.Marker({ position: pos1, map: map,title:"Casa Stavola F8 II", visible:true}); 
    infowindow.open(map,companyMarker); 
});