79474058

Date: 2025-02-27 22:20:57
Score: 0.5
Natty:
Report link

I have found a workaround for this by compensating the zoom in the map container by setting the zoom CSS property of the map to 100 / zoom, check live example here: https://codesandbox.io/p/devbox/quiet-fog-forked-yqdd6z

<Map
  defaultCenter={{ lat: 40.7128, lng: -74.006 }}
  defaultZoom={12}
  gestureHandling={"greedy"}
  reuseMaps
  disableDefaultUI
  mapTypeId={"hybrid"}
  nClick={handleMapClick}
  style={{ width: "100%", height: "600px", zoom: 100 / zoom }}
>
  {marker && (
    <Marker position={{ lat: marker.lat, lng: marker.lng }} />
  )}
</Map>
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: El-habib Amazzal