谷歌地图信息框 - 点击Android

时间:2013-05-21 12:57:27

标签: javascript android google-maps google-maps-api-3 infobox

我有一个小应用程序,使用谷歌地图和信息框设置一系列标记。单击信息框图像后,您将转到另一个链接。这在Pc和我的Ipad上完美运行,但是当您点击Android(三星手机)中的图像时,该链接不是“活动”。以下是代码的一些部分:

 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);
            }

  });

我也尝试列出信息框的domready事件,但没有运气:

             google.maps.event.addListener(infoBox,'domready',function(){  
                 jQuery('#strut').click(function(){ alert('clicked!') }); 

          }); 

0 个答案:

没有答案