Factored out code to produce reusable FreemapWidget