【问题标题】:Google Maps API not loading interface elements properlyGoogle Maps API 未正确加载界面元素
【发布时间】:2012-02-20 07:33:11
【问题描述】:

我有一个正在开发的网站http://damirsepictrip.com/test-mobile-post/

我正在使用 Google Maps API 创建自定义地图,但街景图标未正确显示。它只是一个垂直条,而它需要是一个人的图标。

此外,如果您将图标放在地图上以使用街景,您会看到当您旋转时,街景图像的某些部分丢失,并且关闭按钮图标也没有显示。任何帮助将不胜感激。

【问题讨论】:

    标签: javascript google-maps


    【解决方案1】:

    删除这个:

    img {
      max-width: 100% !important;
    }
    

    来自 http://damirsepictrip.com/wp-content/themes/starkers/css/base.css

    ..或尝试与地图中的图像不匹配的其他选择器。

    img {
      max-width: 100% !important;
    }
    
    /*override(reset) the setting for images inside the map*/
    #location-map img{
      max-width:none !important;
    }
    

    【讨论】:

    • 非常感谢。我从没想过这是一个 CSS 问题。再次感谢。
    【解决方案2】:

    添加到上面 Dr.Molle 的答案--

    让这个对我有用的 CSS 是:

    .gm-style img{
        max-width:none;
    }
    

    不幸的是,将 max-width 设置为 none 也破坏了 Android 2.3.3 中的 infowindow 关闭按钮 -- 请参阅 https://stackoverflow.com/questions/20692114/setting-max-width-css-property-to-none-breaks-android-2-3-3-infowindow-close-but

    【讨论】:

      【解决方案3】:

      最大高度!

      #location-map img{ 
          max-width: none !important; 
          max-height: none !important; 
      }
      

      【讨论】:

      • 请更好地解释你的答案。
      猜你喜欢
      • 1970-01-01
      • 2019-07-08
      • 1970-01-01
      • 2017-04-10
      • 2013-03-19
      • 1970-01-01
      • 2020-10-28
      • 1970-01-01
      • 2018-09-02
      相关资源
      最近更新 更多