Fixed #20998 -- Allow custom (de)serialization for GIS widgets

Thanks Mathieu Leplatre for the report and the initial patch.