(function (ns) { ns.Map = qs.createObject(); ns.Map.prototype = { initialize: function (coordinates, center) { this.coordinates = coordinates; this.center = center; $($.proxy(this.initMap, this)); return this; }, initMap: function () { var coordinates = this.coordinates; var center = this.center; var mapOptions = { zoom: 8, center: new google.maps.LatLng(center.x, center.y) }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); for (var index in coordinates) { if (coordinates.hasOwnProperty(index)) { new google.maps.Marker({ position: new google.maps.LatLng(coordinates[index].x, coordinates[index].y), map: map, title: coordinates[index].title }); } } } }; }) (qs.defineNS('app.contactMap'));