android-maps-ktx icon indicating copy to clipboard operation
android-maps-ktx copied to clipboard

Add Kotlin KSerializer for LatLng

Open bubenheimer opened this issue 5 years ago • 5 comments

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.

bubenheimer avatar Nov 12 '20 22:11 bubenheimer

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!

stale[bot] avatar Mar 19 '21 23:03 stale[bot]

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!

stale[bot] avatar Jul 20 '21 04:07 stale[bot]

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.

bubenheimer avatar Jul 20 '21 16:07 bubenheimer

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!

stale[bot] avatar Apr 16 '22 09:04 stale[bot]

Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution.

stale[bot] avatar Jun 18 '23 14:06 stale[bot]