Angular-google-maps: "TypeError: Cannot read property 'currentValue' of undefined" when only latitude or longitude changes on PolylinePoint

Created on 20 Dec 2017  路  7Comments  路  Source: SebastianM/angular-google-maps

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

All 7 comments

Bump!

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

@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 :/

@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.
however, when I push my branch I am getting a 403. Followed the steps on the repo.

@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

Was this page helpful?
0 / 5 - 0 ratings