私はグーグルマップで作業していて、グーグルマップのインフォボックスプラグインを正常に実装しました。今、私の懸念は、マーカーのインフォボックスが開いた状態にあるかどうかをどうやって知ることができるかということです。マーカーをクリックすると切り替えることができます...
var locations = [
//this is array of arrays
];
var map = new google.maps.Map(document.getElementById('map_canvas'),{
disableDefaultUI : true,
zoom : 12,
center : new google.maps.LatLng(defaultLatitude,defaultLongitude),
mapTypeId : google.maps.MapTypeId.ROADMAP
});
var mapcode,myOptions;
for (var i = 0,len = locations.length; i < len; i++) {
var marker = add_marker(locations[i][1],locations[i][2],locations[i][3],'this is title',locations[i][0]);
allMarkers.push(marker);
marker.setMap(map);
};
function add_marker(lat,lng,icn,title,box_html) {
var marker = new google.maps.Marker({
animation : google.maps.Animation.DROP,
position : new google.maps.LatLng(lat,lng),
map : map,
icon : icn
});
mapcode = '<this is the code of infobox to show>';
myOptions = {
//options of the infobox...bla bla
};
var ib = new InfoBox(myOptions);
google.maps.event.addListener(marker, 'click', function() {
ib.open(map, marker);
});
return marker;
}
私はグーグルマップに慣れていないので、いくつかの非常に小さなものが欠けている可能性があります...事前に感謝します....アンクル