Google Maps API v3: Custom styles for infowindow

后端 未结 4 690
深忆病人
深忆病人 2020-11-28 02:11

I\'ve tried many of the examples from the google maps reference and from other stackoverflow questions, but I haven\'t been able to get custom styles on my infowindow.

4条回答
  •  清歌不尽
    2020-11-28 02:38

    You can style the infoWindow by styling the .gm-style-iw class.

      #map-canvas {
        .gm-style {
          > div:first-child > div + div > div:last-child > div > div {
            &:first-child > div,
            &:first-child > div > div > div,
            &:last-child,
            &:last-child > img {
              display: none !important;
            }
          }
          .gm-style-iw {
            top: 20px !important;
            left: 130px !important;
            background: #fff;
            padding: 10px;
            height: 40px;
          }
        }
      }

提交回复
热议问题