Moved js from layouts to map