vuejs谷歌地图信息窗口 - 隐藏关闭图标

时间:2021-01-03 10:35:21

标签: vue.js google-maps google-maps-api-3 vuejs2 quasar

我想知道如何隐藏/删除 google-map infoWindow 中的关闭图标。

info window

我正在使用带有 Gmap-vue 端口的 Vuejs 和 vue-google-maps

模板

<GmapMap
  ref="mapRef"
  :center="center"
  :zoom="12"
  :style="`height: ${mapSize.height}; width: ${mapSize.width};`"
  :options="mapOptions"
>
  <gmap-info-window
    v-for="(m, index) in markers"
    :key="index"
    :options="infoOptions"
    :position="m.position"
    :opened="showInfoWindow"
    @closeclick="infoWinOpen = false"
  >
    <info-window-content />
  </gmap-info-window>
</GmapMap>

努力

我尝试使用 Css 来隐藏关闭图标。

.gm-ui-hover-effect {
  display: none !important;
}

button.gm-ui-hover-effect {
  visibility: hidden;
}

但仍然显示关闭的“x”图标。

1 个答案:

答案 0 :(得分:-1)

我找到的解决方案是使用 Css ::v-deep 选择器

div ::v-deep .gm-ui-hover-effect {
  display: none !important;
}