`map` is a Flight [component](https://github.com/flightjs/flight/blob/master/doc/component_api.md), which means it's wrapping the map functionality.  Instead of setting `map` to the Leaflet map, you can initialize it further down (I'll add another comment).