-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"TypeError: Cannot read property 'currentValue' of undefined" when only latitude or longitude changes on PolylinePoint #1268
Comments
Bump! |
Any word on this? It's a problem in my project as well. |
@markmssd, did you end up working around this somehow? |
@brianpetersencornell No, in my case it's used in an "admin" page only, so i just live with it and refresh the page when it happens. Also i didn't create a PR yet, waiting for @SebastianM's GO so i don't do it for nothing. |
I have fixed this bug and created unit tests validating. @SebastianM is this locked down now? |
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 |
Issue 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
throwsTypeError: Cannot read property 'currentValue' of undefined
.The same happens if only
longitude
changes, and notlatitude
.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 :)
The text was updated successfully, but these errors were encountered: