谷歌地图API没有正确加载界面元素

Google Maps API not loading interface elements properly

本文关键字:加载 界面 元素 API 谷歌地图      更新时间:2023-09-26

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

我正在使用谷歌地图API创建自定义地图,但街景图标显示不正确。它只是一个竖条,而它需要是一个人的图标。

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

删除此:

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

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

让我工作的CSS是:

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

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

最大高度!

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