question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
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.

1reaction
ghostcommented, Jun 3, 2019

done

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'currentValue' of undefined" when only ...
currentValue throws TypeError: Cannot read property 'currentValue' of undefined . The same happens if only longitude changes, and not latitude .
Read more >
How to fix Cannot read property 'Latitude' of undefined
I need to compare the value of the array to the value that was entered and return the latitude and longitude values in...
Read more >
cannot read properties of undefined (reading 'latlng') - You.com
The first argument of map.on is the event name. The second argument is the callback function to call when the event occurs. The...
Read more >
Uncaught TypeError: Cannot read property 'lat' of undefined
... this 'Uncaught TypeError: Cannot read property 'lat' of undefined' error ? I am trying to store longitude and latitude in an array....
Read more >
Geocoding Service | Maps JavaScript API - Google Developers
If you see the API in the list, you're all set. ... The type of the component can change. ... location contains the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found