How to select MapFeature by custom type

If have a custom type (hashable) for map selection:

@State var mapSelection: CustomType
Map(selection: $mapSelection ) {
    ...
}

However, if I want to selet MapFeature, I need to use MapFeature type for the state variable

@State var mapSelection: MapFeature

But I want to display some Markers by using my CustomType. MapFeature can't be initialized so that I can't map my CustomType to MapFeature to display my Markers.

Is there a way to select MapFeature by custom type?

You can keep using MapFeature as selection, and use onTapGesture to select the CustomType

How to select MapFeature by custom type
 
 
Q