I'm so sorry! I didn't notice line 9 and so the doc.ready isn't necessary since ```mainMapInit``` is a callback.

However, we still don't want ```mainMapInit``` in the global scope so I propose we create a JS file that defines a global namespace for our custom code. So, our JS file might look like

```
var Mapusaurus = {
    var mainMapInit(map, options) {
        // stuff
    }
}
```

and then the template tag will look like

```
{% leaflet_map "map" callback="Mapusaurus.mainMapInit"%}
```