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

Issue mapping latitude or longitude 0 #18

Closed
JoseGoncalves opened this issue Mar 28, 2019 · 1 comment
Closed

Issue mapping latitude or longitude 0 #18

JoseGoncalves opened this issue Mar 28, 2019 · 1 comment

Comments

@JoseGoncalves
Copy link

Found an issue mapping a custom marker with latitude 0 and longitude 0.
With that coordinates the marker is always displayed on the center of the viewport, whatever position that is.
Looking at the source code it seems to me that the issue is due to this code:

    lat() {
      return parseFloat(this.marker.lat || this.marker.latitude);
    },
    lng() {
      return parseFloat(this.marker.lng || this.marker.longitude);
    },

this.marker.lat (or this.marker.lng) should not be used to check if the prop is available, because when it's 0, it will return false.
A check like typeof this.marker.lat === 'undefined' should be used instead.

@eregnier
Copy link
Owner

Solved. thank you @JoseGoncalves

eregnier added a commit that referenced this issue Mar 28, 2019
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