Skip to content
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

Closed
markmssd opened this issue Dec 20, 2017 · 7 comments

Comments

@markmssd
Copy link

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 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 :)

@markmssd
Copy link
Author

Bump!

@brianpetersencornell
Copy link

Any word on this? It's a problem in my project as well.

@brianpetersencornell
Copy link

@markmssd, did you end up working around this somehow?
I need to get this working, so I might have to either fork this or write my own google line component in the mean time :/

@markmssd
Copy link
Author

markmssd commented Jan 30, 2018

@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.

@brianpetersencornell
Copy link

I have fixed this bug and created unit tests validating.
however, when I push my branch I am getting a 403. Followed the steps on the repo.

@SebastianM is this locked down now?

@stale
Copy link

stale bot commented Nov 13, 2018

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.

@ghost
Copy link

ghost commented Jun 3, 2019

done

@ghost ghost closed this as completed Jun 3, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants