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