Código:
BGMap = (function () { var map, $mapEl = $('#map'), address = 'Calle Sin Numero, Avila', lat = 41.063418, lng = -4.718995, display = false, showMap = function () { hideMap(); display = true; var point = new google.maps.LatLng(lat, lng), mapOptions = { zoom: 8, center: point, mapTypeId: google.maps.MapTypeId.HYBRID, mapTypeControl: false, panControl: true, panControlOptions: { position: google.maps.ControlPosition.TOP_RIGHT }, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.TOP_RIGHT }, streetViewControl: true, streetViewControlOptions: { position: google.maps.ControlPosition.TOP_RIGHT } }; map = new google.maps.Map(document.getElementById("map"), mapOptions); map.setTilt(45); resizeMap(); var coordInfoWindow = new google.maps.InfoWindow({ maxWidth: 2 }), latlngStr = address + "<br />LatLng: " + lat + " , " + lng + "<br />"; coordInfoWindow.setContent(latlngStr); coordInfoWindow.setPosition(point); coordInfoWindow.open(map); BGImageController.fadeBG(false) }, resizeMap = function () { $mapEl.css({ width: $(window).width() + 'px', height: $(window).height() + 'px' }) }, hideMap = function () { display = false; $mapEl.empty() }, active = function () { return display }; return { showMap: showMap, hideMap: hideMap, active: active, resizeMap: resizeMap } })