"TypeError: Cannot read property 'currentValue' of undefined" when only latitude or longitude changes on PolylinePoint
See original GitHub issueIssue description
Steps to reproduce and a minimal demo of the problem
Here is a “plunkr” reproducing the bug: https://angular-google-maps-demo-xweauf.stackblitz.io/
In 5 seconds, I will update only the latitude of the Polyline Point, and you can see the error in the console.
Current behavior When changing Polyline Point (e.g. by dragging it) in one axis only (latitude OR longitude), an error is thrown. I boiled it down to this piece of code: https://github.com/SebastianM/angular-google-maps/blob/master/packages/core/directives/polyline-point.ts#L28
What happens is that if, for example, only latitude
changes, changes['longitude']
is undefined (since it did not change). Thus, changes['longitude'].currentValue
throws TypeError: Cannot read property 'currentValue' of undefined
.
The same happens if only longitude
changes, and not latitude
.
angular2 & angular-google-maps version angular v5.1.0 angular-google-maps v1.0.0-beta.2
Let me know if it makes sense, and I’ll PR 😃
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top GitHub Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
done