public function renderJavascripts(Map $map)
    {
        $output = array();

        if (!$map->isAsync()) {
            $output[] = $this->renderJsLibraries($map);
        }

        $output[] = '<script type="text/javascript">'.PHP_EOL;
        $output[] = $this->renderJsBefore($map);
        $output[] = $this->renderJsContainer($map);
        $output[] = $this->renderJsAfter($map);
        $output[] = '</script>'.PHP_EOL;

        if ($map->isAsync()) {
            $output[] = $this->renderJsLibraries($map);
        }

        return implode('', $output);
    }