<commit_before>/* ===== Map ===== */

var map;

// TODO: Change coordinates
var mapOptions = {
	zoom: 15,
	center: {lat: 45.419228, lng: -75.6931989},
	mapTypeControlOptions: {position: google.maps.ControlPosition.TOP_RIGHT}
}

map = new google.maps.Map(document.getElementById('map'), mapOptions);


/* ===== Model ===== */

// Places
// TODO: Change the places
var places = [
	{
		name: '<NAME>',
		latitude: 45.427655,
		longitude: -75.692391
	},
	{
		name: 'Parliament of Canada',
		latitude: 45.425118,
		longitude: -75.699917
	},
	{
		name: 'University of Ottawa',
		latitude: 45.423126,
		longitude: -75.683108
	},
	{
		name: 'Canadian War Museum',
		latitude: 45.417107,
		longitude: -75.716942
	},
	{
		name: 'National Gallery of Canada',
		latitude: 45.429537,
		longitude: -75.698903
	}
];

var Place = function(data) {
	this.name = ko.observable(data.name);
	this.latitude = ko.observable(data.latitude);
	this.longitude = ko.observable(data.longitude);
	this.marker = new google.maps.Marker({
		position: {lat: this.latitude(), lng: this.longitude()},
		map: map,
		animation: null
	});
};


/* ===== ViewModel ===== */

var ViewModel = function() {
	var self = this;
	
	this.placeList = ko.observableArray([]);
	
	places.forEach(function(placeItem) {
		self.placeList.push(new Place(placeItem));
	});<commit_msg>Map Bounds<commit_after>/* ===== Map ===== */

var map;

var mapOptions = {
	mapTypeControlOptions: {position: google.maps.ControlPosition.TOP_RIGHT}
}

map = new google.maps.Map(document.getElementById('map'), mapOptions);


/* ===== Model ===== */

// Places
// TODO: Change the places
var places = [
	{
		name: '<NAME>',
		latitude: 45.427655,
		longitude: -75.692391
	},
	{
		name: 'Parliament of Canada',
		latitude: 45.425118,
		longitude: -75.699917
	},
	{
		name: 'University of Ottawa',
		latitude: 45.423126,
		longitude: -75.683108
	},
	{
		name: 'Canadian War Museum',
		latitude: 45.417107,
		longitude: -75.716942
	},
	{
		name: 'National Gallery of Canada',
		latitude: 45.429537,
		longitude: -75.698903
	}
];

var Place = function(data) {
	this.name = ko.observable(data.name);
	this.latitude = ko.observable(data.latitude);
	this.longitude = ko.observable(data.longitude);
	this.marker = new google.maps.Marker({
		position: {lat: this.latitude(), lng: this.longitude()},
		map: map,
		animation: null
	});
};


/* ===== ViewModel ===== */

var ViewModel = function() {
	var self = this;
	var bounds = new google.maps.LatLngBounds();
	
	this.placeList = ko.observableArray([]);
	this.latLngList = ko.observableArray([]);
	
	places.forEach(function(placeItem) {
		self.placeList.push(new Place(placeItem));
	});
	
	// Populates the latLntList array with the location of all markers
	for (var i = 0; i < self.placeList().length; i++) {
		self.latLngList.push(new google.maps.LatLng(self.placeList()[i].latitude(), self.placeList()[i].longitude()));
	}
	
	// Extends the bounds of the map to fit all markers
	for (var i = 0, latLngLen = self.latLngList().length; i < latLngLen; i++) {
		bounds.extend(self.latLngList()[i]);
	}
	
	// Displays the map with bounds
	map.fitBounds(bounds);
{'fraction_non_alphanumeric': 0.1765834932821497, 'fraction_numerical': 0.05790147152911068, 'mean_word_length': 3.8330757341576507, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2784827', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1142, 'n_words': 249}