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

Add support for converting Geolocation Position+Coordinates to JSON (object) #145

Closed
marcoscaceres opened this issue Apr 8, 2024 · 4 comments · Fixed by #147
Closed

Comments

@marcoscaceres
Copy link
Member

Given GeolocationCoordinates are just nullable doubles, it would be nice if GeolocationCoordinates exposed a (WebIDL) default .toJSON() method.

@reillyeon
Copy link
Member

That would be nice given that JSON.stringify() does not work on GeolocationCoordinates.

@marcoscaceres
Copy link
Member Author

Another question is if we should also add a toJSON() method on GeolocationPosition? I don't know if there is much value to getting the timestamp...

@reillyeon
Copy link
Member

Less value but it would still feel weird if you could stringify the coordinates but not the full object passed to your callback so I say yes, let's add a toJSON() method to both interfaces.

@marcoscaceres
Copy link
Member Author

Sounds good.

@marcoscaceres marcoscaceres changed the title Add support for converting GeolocationCoordinates to JSON (object) Add support for converting Geolocation Position+Coordinates to JSON (object) Apr 10, 2024
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

Successfully merging a pull request may close this issue.

2 participants