I am trying to draw curved lines using google-maps-react. In order to do this, I searched and found this question "How to curve a Polyline in react-google-maps?". In this question, the answer refers to a sandbox project, in which such an implmentation is done.
I tried to adapt this code to work for me, but I am having problems getting the "projection" of the map, which is necessary to calculate the "point", using
const p1 = mapProjection.fromLatLngToPoint(pos1),
After searching the props and state of the map component, I found that the "getProjection" method is inside: props -> google -> maps -> Map -> prototype -> getProjection.
I tried to access it using:
mapProjection = {this.props.google.maps.Map.getProjection()}
and this results in an error "TypeError: this.props.google.maps.Map.getProjection is not a function".
Using
mapProjection = {this.props.google.maps.Map.prototype.getProjection()}
results in undefined
I am really stuck and I have no clue how to get around this. Can any of you point me in the right direction? Thank you very much.