admin管理员组文章数量:1391929
I previously used darkmode.addEventListener('change', ({ matches }) => map.setOptions({ styles: matches ? darkmodeStyles : null }));
which worked great! But since Google Maps is deprecating google.maps.Marker
I need to switch to google.maps.marker.AdvancedMarkerElement
, which requires a mapID and styling doesn't work anymore when mapID is used.
Is there a way to instantly switch to dark mode when using mapIDs?
Because the only solution I see currently is to create a whole new map instance in order to provide a new mapID, but that is not an acceptable solution to switch to dark mode because you lose the current map.
本文标签: toggleInstantly switch between light and dark mode with Google Maps JS API using mapIDStack Overflow
版权声明:本文标题:toggle - Instantly switch between light and dark mode with Google Maps JS API using mapID - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744686556a2619735.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论