一連のマーカーに設定された Google マップと Infobox を使用する小さなアプリがあります。インフォボックスの画像をクリックすると、別のリンクに移動します。これは PC と Ipad では完全に機能しますが、Android (Samsung の携帯電話) で画像をタップするとリンクが「アクティブ」になりません。コードの一部を次に示します。
var myOptions = {
content: boxText
,disableAutoPan: true
,maxWidth: infobox_width
,boxClass:"mybox"
,zIndex: null
,closeBoxMargin: "-13px 0px 0px 0px"
,closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif"
,infoBoxClearance: new google.maps.Size(1, 1)
,isHidden: false
,pane: "floatPane"
,enableEventPropagation: true
};
infoBox = new InfoBox(myOptions);
for (var i = 0; i < locations.length; i++) {
var beach = locations[i];
var myLatLng = new google.maps.LatLng(beach[1], beach[2]);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
shadow: shadow,
icon: custompin(beach[8]),
shape: shape,
title: beach[0],
zIndex: beach[3],
image:beach[4],
price:beach[5],
type:beach[6],
type2:beach[7],
link:beach[9],
infoWindowIndex : i
});
gmarkers.push(marker);
google.maps.event.addListener(marker, 'click', function() {
infoBox.setContent('<div class="info_details" id="strut"><a href="'+this.link+'">'+this.image+'</a> <h2><a href="'+this.link+'">'+this.title+'</a></h2> <div class="prop_details"><span class="info_inside">'+this.type+' for '+this.type2+' - '+this.price+'</span></div>' );
infoBox.open(map, this);
map.setCenter(this.position);
if(infobox_width==700){
map.panBy(380,-190);
}else{
map.panBy(0,-190);
}
});
また、infobox の domready イベントを一覧表示しようとしましたが、うまくいきませんでした:
google.maps.event.addListener(infoBox,'domready',function(){
jQuery('#strut').click(function(){ alert('clicked!') });
});