move out of dom and into map.js