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

bug fix on polyline-point #1229

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/directives/polyline-point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export class AgmPolylinePoint implements OnChanges {
ngOnChanges(changes: SimpleChanges): any {
if (changes['latitude'] || changes['longitude']) {
const position: LatLngLiteral = <LatLngLiteral>{
lat: changes['latitude'].currentValue,
lng: changes['longitude'].currentValue
lat: changes['latitude'] ? changes['latitude'].currentValue : null, // before this change it will fail if the there was no change in both latitude and longitude
lng: changes['longitude'] ? changes['longitude'].currentValue : null // before this change it will fail if the there was no change in both latitude and longitude
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomokohn those values are checked in the if, I haven't found this issue, but I would suggest a more strong check like:
if (!!changes['latitude'] || !!changes['longitude']) {
instead of double checking those values.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change was made after i found a bug when only one of these parameters changes.
it fix this issue : #1100

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see @tomokohn in that case the if is useless

};
this.positionChanged.emit(position);
}
Expand Down