Google地图的标记未在iPhone/iPad上显示InfoBubble [英] Google map's marker doesn't display InfoBubble on iPhone/iPad

查看:155
本文介绍了Google地图的标记未在iPhone/iPad上显示InfoBubble的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使在较小的屏幕上,有关Google Map的所有内容也可以在不同的桌面浏览器中正常工作-初始化,标记,信息气泡等都可以正常运行.但是在iPhone/iPad上,单击标记时不会出现InfoBubble.

Everything about Google map works fine in different desktop browsers even in smaller screen - initialise, markers, infobubbles etc are working perfectly. But on iPhone/iPad, the InfoBubble doesn't appear when the marker is clicked.

经过研究Stackoverflow并遵循了各种解决方案:

After research on Stackoverflow and followed the various solutions:

  1. Google地图信息窗口显示不正确
  2. Google Maps API v3:InfoWindow大小不正确
  3. 我如何绑定触摸Google地图中标记的事件?
  4. click事件在ipad中不起作用
  1. Google Map Infowindow not showing properly
  2. Google Maps API v3: InfoWindow not sizing correctly
  3. Why does Safari on the iPad not display my marker on an embedded Google Maps page?
  4. how can i bind touch events for a marker in google maps?
  5. click event is not working in ipad

问题仍然存在.有人可以帮忙吗?谢谢你!

The problem remained. Anyone can help? Thank you in advanced!

//set up infobubble
var infowindow = new InfoBubble({
    map: map,
    maxHeight: 380,
    minWidth: 270,
    shadowStyle: 0,
    pixelOffset: new google.maps.Size(0, 35),
    padding: 0,
    borderRadius: 0,
    arrowSize: 8,
    borderWidth: 0,
    borderColor: '#fff',
    disableAutoPan: true,
    hideCloseButton: true,
    arrowPosition: 50,
    arrowStyle: 0
});

// open infowindow when marker is clicked
var mm=[];
google.maps.event.addListener(marker, 'click', (function(marker, i) {
  return function()
  {
    if(mm !='')
    {
      mm[0].setVisible(true);
      mm=[];
    }
    mm.push(marker);
    marker.setVisible(false);
    infowindow.setContent(this.IWcontent);
    infowindow.open(map, marker);
  }
})(marker, i));

推荐答案

以防万一有人遇到类似问题.解决这个问题需要3天.我们的方法是:

Just in case anyone is facing this similar problem. It takes us 3 days to solve this problem. Our approaches are:

  1. 通过http
  2. 加载google map api
  3. 在不使用异步或延迟的情况下,先于infobubble.js加载地图
  1. load google map api via http
  2. load the map earlier than infobubble.js without using async or defer

这篇关于Google地图的标记未在iPhone/iPad上显示InfoBubble的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆