Open prestonbourne opened 1 year ago
You can transform LatLngLiteral into LatLng before passing it. I was fixing types based on latest types provided by google maps itself.
You can transform LatLngLiteral into LatLng before passing it. I was fixing types based on latest types provided by google maps itself.
Sorry if this is a silly question but what's the best practice to do so? Would I just typecast it or manually add the missing methods.
Hi @Saintpreston ,
I'm pretty much a beginner so not sure if this is helpful but I ran into the same issue and got it working like this:
const center = {
lat: 50.7,
lng: 4.257,
};
const centerLatLng = new google.maps.LatLng(center.lat, center.lng);
Infobox Component not accepting LatLngLiteral
My Environment
How does it behave?
It throws this error when ever I pass in a LatLngLiteral
How should it behave correctly?
As per the docs, it should accept a
LatLngLiteral
Update: So before I the page would crash, however the component is in fact being rendered but the error message persists: This is a personal project so I'm fine ignoring type safety for now but would still like to see this come to resolution.