Add Kotlin KSerializer for LatLng
Is your feature request related to a problem? Please describe.
In my fairly pure Kotlin app I need to persist various types of data to disk, including List<LatLng>. I am switching to Kotlin serialization to do this, as it provides a straightforward framework that has recently seen a stable release. For now I intend to use stable Json-based Kotlin serialization, but may switch to a more compact format such as CBOR or protobuf as the respective library artifacts stabilize. LatLng from google-maps is a Java class and needs an external KSerializer to enable this.
Describe the solution you'd like Add performant KSerializer implementation for LatLng that supports different Kotlin serialization formats, perhaps using the approach from https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md#hand-written-composite-serializer
Describe alternatives you've considered I am writing my own KSerializer based on https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md#composite-serializer-via-surrogate. It is not as performant as the suggested hand-written composite serializer approach. It seems unnecessary for app developers to reinvent the wheel - LatLng is essentially a POJO that lends itself to serialization.
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!
Personally I don't need this anymore at this time, I've largely moved this app away from LatLng dependencies to a custom domain-specific typing system. Might still make sense to keep this open, though; others may be interested, and custom typing does imply overhead.
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!
Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution.