$(document).ready(initializeMap_gm_35617); var map_gm_35617; var markers_gm_35617 = []; var openedInfoWindows_gm_35617 = []; function initializeMap_gm_35617(){ var latlng = new google.maps.LatLng(20.53925, -97.44476); var myOptions = { zoom: 18, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP, streetViewControl: false, mapTypeControl: false, scrollwheel: false, zoomControl: true, disableDoubleClickZoom: false, zoomControlOptions: { position: google.maps.ControlPosition.RIGHT_BOTTOM, style: google.maps.ZoomControlStyle.SMALL } }; map_gm_35617 = new google.maps.Map(document.getElementById('gm_35617'), myOptions); markers_gm_35617.push(new myMarker_gm_35617(0, 20.5392, -97.44476, 'Dr. Fortunato Vargas - Oftalmólogo', 'Calle 20 No. 301 - B, Altos, arriba del consultorio del Dr. Casian', 'http://www.drfortunatovargas.com', '_blank')); for (var i = 0; i< markers_gm_35617.length;i++){ markers_gm_35617[i].Instanciate(); } } function myMarker_gm_35617(id, lat, lng, title, description, linkAddress, linkTarget) { this.id = id; this.lat = lat; this.lng = lng; this.description = description; this.title = title; if (linkAddress){ this.link = new Link_gm_35617(linkAddress, linkTarget); } this.marker = null; this.GetInfoWindowHTML = function() { var result = ''; result += ''; if (this.description != '') result += ''; if (this.link != null) result += ''; result += '
' + this.title + '
' + this.description + '
' + this.link.address + '
'; return result; }; this.Instanciate = function() { var position = new google.maps.LatLng(lat, lng); var options = { clickable: true, draggable: false, position: position, map: map_gm_35617 }; this.marker = new google.maps.Marker(options); this.marker.customId = this.id; google.maps.event.addListener(this.marker, 'click', marker_click_gm_35617); }; } function Link_gm_35617(address, target) { this.address = address; this.target = target; } function marker_click_gm_35617(e) { showInfoWindow_gm_35617(this); } function findMarker_gm_35617(id) { var result = null; for (var i = 0; i < markers_gm_35617.length; i++) { if (markers_gm_35617[i].id == id) { result = markers_gm_35617[i]; break; } } return result; } function showInfoWindow_gm_35617(e) { var marker = findMarker_gm_35617(e.customId); var infoWindow = new google.maps.InfoWindow({ content: marker.GetInfoWindowHTML() }); infoWindow.markerId = marker.id; google.maps.event.addListener(infoWindow, 'closeclick', infowindow_closeclick_gm_35617); closeAllInfoWindows_gm_35617(); infoWindow.open(map_gm_35617, marker.marker); openedInfoWindows_gm_35617.push(infoWindow); } function infowindow_closeclick_gm_35617(e) { closeAllInfoWindows_gm_35617(); } function closeAllInfoWindows_gm_35617() { var infoWindow = openedInfoWindows_gm_35617.pop(); while (infoWindow != null) { infoWindow.close(); infoWindow = openedInfoWindows_gm_35617.pop(); } }