declare namespace google.maps { /** url可以直接作为Icon */ type UrlIcon = string interface InfoWindow { /** 获取Map, 文档中没写这个方法 */ getMap(): Map | undefined /** 获取锚点, 文档中没写这个方法 */ getAnchor(): MVCObject | marker.AdvancedMarkerElement | undefined /** * {@template info_window_anchor_bug} * 在marker未添加到地图上时, 执行{@link open}并传入marker, 它会被设为anchor, 如果此时执行{@link close}, anchor并不会被清空... * 这会导致marker被添加到map上时, 又自动将InfoWindow显示出来... * 因此必要时需要手动清空anchor * {@endtemplate} * @see getAnchor */ setAnchor(anchor?: MVCObject | marker.AdvancedMarkerElement) } }