2010-10-22 5 views
0

J'ai le code suivant pour afficher la fenêtre d'informations sur la carte google lorsque le marqueur est cliqué comment puis-je ajouter des onglets aux infowindows qui utilise extinfowindows, quelqu'un peut-il aider à tracer le problème.comment ajouter des onglets à infowindow qui utilise extInfoWindows pour google map

function createMarker(point, name, address, imagepath) { 
    var marker = new GMarker(point, gicons[imagepath]); 
    var html1 = '<span class="name-tab"><b>' + name + '</b></span> <span class="info"><br/>' + address + '</span>'; 

    GEvent.addListener(marker, 'click', function() { 
     marker.openExtInfoWindow(
     map, "simple_example_window", html1, { 
      beakOffset: -4 
     }); 
    }); 
} 

Répondre

0

Note: les onglets ne sont pas pris en charge pour GMaps v3.0

Cocher cette

http://www.svennerberg.com/2009/02/working-with-info-windows-in-google-maps/

Mais nous pouvons le faire pour V3.0 JQuery est ici échantillon de code

var contentString = [ 
    '<div id="tabs">', 
    '<ul>', 
    '<li><a href="#tab-1"><span>One</span></a></li>', 
    '<li><a href="#tab-2"><span>Two</span></a></li>', 
    '<li><a href="#tab-3"><span>Three</span></a></li>', 
    '</ul>', 
    '<div id="tab-1">', 
    '<p>Tab 1</p>', 
    '</div>', 
    '<div id="tab-2">', 
    '<p>Tab 2</p>', 
    '</div>', 
    '<div id="tab-3">', 
    '<p>Tab 3</p>', 
    '</div>', 
    '</div>' 
].join(''); 

var infowindow = new google.maps.InfoWindow({ 
    content: contentString 
}); 

var marker = new google.maps.Marker({ 
    position: myLatlng, 
    map: map 
}); 

google.maps.event.addListener(marker, 'click', function() { 
    infowindow.open(map, marker); 
    $("#tabs").tabs(); 
}); 
+0

Cela ne fonctionne pas comme prévu mais ce http://stackoverflow.com/questions/5177705/google-maps-infowindow-not-showing-the-tabs-as-it-should corrige le problème :) –

Questions connexes