o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1319757936.2201149]: @value{ I" length:EFiä I" digest; F"%d4beba1da9d39cf4feb6c06075e24255I" source; FI"ä (function() { window.LabListView = (function() { function LabListView(lab_list) { var view; this.lab_list = lab_list; this.el = $('#lab_list'); this.template = null; if (this.lab_list) { this.render(); } view = this; LabList.tracker_elem.change(function() { return view.render(); }); } LabListView.prototype.render = function() { var view; if (!this.template) { this.template = Handlebars.compile($('#lab_item_template').html()); } view = this; view.el.empty(); return $.each(this.lab_list.getLabs(), function(index, lab) { return view.el.append($(view.template(lab))); }); }; return LabListView; })(); window.MapView = (function() { function MapView(collection, center_point) { var view; this.collection = collection; this.center_point = center_point; this.render(); view = this; LabList.tracker_elem.change(function() { return view.render(); }); } MapView.prototype.el = $('#map_canvas'); MapView.prototype.center_marker = null; MapView.prototype.view = null; MapView.prototype.markerBounds = new google.maps.LatLngBounds(); MapView.prototype.markerBoundsZoomOut = 0.1; MapView.prototype.options = { mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false }; MapView.prototype.prepareMap = function() { if (!this.view) { return this.view = new google.maps.Map(document.getElementById("map_canvas"), this.options); } }; MapView.prototype.createCenterMarker = function() { var point; if (this.center_point) { point = new google.maps.LatLng(this.center_point.lat, this.center_point.lng); this.center_marker = new google.maps.Marker({ position: point, map: this.view, title: this.center_point.title, icon: "/assets/medivo/arrow.png" }); } if (this.markerBounds && this.center_marker) { return this.markerBounds.extend(this.center_marker.position); } }; MapView.prototype.setMarkers = function(map, markerBounds) { return $.each(this.collection.getLabs(), function(index, model) { return model.setMarker(map, markerBounds); }); }; MapView.prototype.clear = function() { this.collection.clearMarkers(); if (this.center_marker) { this.center_marker.setMap(null); this.center_marker = null; } return this.markerBounds = new google.maps.LatLngBounds(); }; MapView.prototype.render = function() { var extendPoint; if (!this.collection) { return; } this.clear(); this.prepareMap(); this.createCenterMarker(); this.setMarkers(this.view, this.markerBounds); if (this.markerBounds.getNorthEast().equals(this.markerBounds.getSouthWest())) { extendPoint = new google.maps.LatLng(this.markerBounds.getNorthEast().lat() + this.markerBoundsZoomOut, this.markerBounds.getNorthEast().lng() + this.markerBoundsZoomOut); this.markerBounds.extend(extendPoint); } return this.view.fitBounds(this.markerBounds); }; return MapView; })(); }).call(this); ; FI" _version; F"%cf4501b91a87dba180a42cce214c8106