You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but the zoom control is not being position at the LEFT_TOP:
If I use the same constant from google.maps.ControlPosition it works as expected. Although they both seem to point to 17, at runtime google.maps.ControlPosition seems to evaluate to 5:
"use client";import{APIProvider,ControlPosition,Map}from"@vis.gl/react-google-maps";import{useEffect,useState}from"react";exportdefaultfunctionGoogleMap(){constposition={lat: 53.54,lng: 10};const[zoomControlPosition,setZoomControlPosition]=useState(ControlPosition.LEFT_TOP);useEffect(()=>{setTimeout(()=>{console.log("ControlPosition.LEFT_TOP:",ControlPosition.LEFT_TOP);console.log("google.maps.ControlPosition.LEFT_TOP:",google.maps.ControlPosition.LEFT_TOP// <---- this logs 5 instead of 17);setZoomControlPosition(google.maps.ControlPosition.LEFT_TOP);},2000);},[]);return(<APIProviderapiKey={process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY??""}><divclassName="aspect-video max-w-lg"><Mapzoom={9}center={position}disableDefaultUIzoomControlzoomControlOptions={{position: zoomControlPosition,}}/></div></APIProvider>);}
The text was updated successfully, but these errors were encountered:
Oh, that is Interesting. There was just recently a change in the maps API regarding the control positions, where they added a bunch of new values for 'writing direction independent' positioning. I copied the values from the typescript definitions (@types/google.maps@3.54.7) but those are apparently incompatible with what the maps API is currently doing:
This actually makes a lot of sense, since that appears to be a backwards-copatible change (other than what we could see in the typescript definitions).
Hello!
I was testing the library with this simple component:
but the zoom control is not being position at the LEFT_TOP:
If I use the same constant from
google.maps.ControlPosition
it works as expected. Although they both seem to point to17
, at runtimegoogle.maps.ControlPosition
seems to evaluate to5
:The text was updated successfully, but these errors were encountered: