<commit_before>$(function () {
	var map = new L.Map('map',{
		center: [0, 0],
		zoom: 3,
		minZoom: 3
	});
	var marker;
	var isUserSelectingByClick = false;
	var startPosition;
	var endPosition;

	new L.TileLayer(
	  'http://{s}.tiles.mapbox.com/v3/osmbuildings.kbpalbpk/{z}/{x}/{y}.png',
	  { attribution: 'Map tiles &copy; <a href="http://mapbox.com">MapBox</a>', maxNativeZoom: 19, maxZoom: 21 }
	).addTo(map);

	var osmb = new OSMBuildings(map)
	  .date(new Date(2014, 5, 15, 17, 30))
	  .load()
	  .click(function(id) {
	    console.log('feature id clicked:', id);
	  });

	L.control.layers({}, { Buildings: osmb }).addTo(map);

	$("#myLocationButton").on('click', function (event) {
		navigator.geolocation.getCurrentPosition(showCurrentLocation, handleCurrentLocationError);
	});

	showCurrentLocation = function (position) {
		var lat = position.coords.latitude;
		var lng = position.coords.longitude;
		map.setView([lat, lng], 17);
		marker = L.marker([lat, lng]).addTo(map);
	};

	handleCurrentLocationError = function (err) {
		console.log("There seems to be an error :"+err);
	};

	function getUserSelectedPosition (event) {
		if (!startPosition) {
			startPosition = event.latlng;
		} else {
			endPosition = event.latlng;
			map.off('click',getUserSelectedPosition);
		}
	}

	$("#searchChoiceButton").on('click', function (event) {
		$("#pickDestination").modal('hide');
		if ($("#selectByClick").is(":checked")) {
			isUserSelectingByClick = true;
			map.on('click', getUserSelectedPosition);
		} else {

		}
	});	
});<commit_msg>Adding ajax to load path info<commit_after>$(function () {
	var map = new L.Map('map',{
		center: [0, 0],
		zoom: 3,
		minZoom: 3 
	});
	var marker;
	var isUserSelectingByClick = false;
	var startPosition;
	var endPosition;

	new L.TileLayer(
	  'http://{s}.tiles.mapbox.com/v3/osmbuildings.kbpalbpk/{z}/{x}/{y}.png',
	  { attribution: 'Map tiles &copy; <a href="http://mapbox.com">MapBox</a>', maxNativeZoom: 19, maxZoom: 21 }
	).addTo(map);

	var osmb = new OSMBuildings(map)
	  .date(new Date(2014, 5, 15, 17, 30))
	  .load()
	  .click(function(id) {
	    console.log('feature id clicked:', id);
	  });

	L.control.layers({}, { Buildings: osmb }).addTo(map);

	$("#myLocationButton").on('click', function (event) {
		navigator.geolocation.getCurrentPosition(showCurrentLocation, handleCurrentLocationError);
	});

	showCurrentLocation = function (position) {
		var lat = position.coords.latitude;
		var lng = position.coords.longitude;
		map.setView([lat, lng], 17);
		marker = L.marker([lat, lng]).addTo(map);
	};

	handleCurrentLocationError = function (err) {
		console.log("There seems to be an error :"+err);
	};

	function getUserSelectedPosition (event) {
		if (!startPosition) {
			startPosition = event.latlng;
		} else {
			endPosition = event.latlng;
			map.off('click',getUserSelectedPosition);
			getPath();
			startPosition = null;
			endPosition = null;
			$("#map").css({
				cursor: "grab"
			});
		}
	}

	var getPath = function () {
		$.getJSON('http://1172.16.31.10:8080/postgis/postgisdb/ways/pgr_aStarFromAtoB/'+startPosition.lat+'/'+startPosition.lng+'/'+endPosition.lat+'/'+endPosition.lng)
			.done(function (data) {
				console.log(data);
			});
	};

	$("#searchChoiceButton").on('click', function (event) {
		$("#pickDestination").modal('hide');
		if ($("#selectByClick").is(":checked")) {
			isUserSelectingByClick = true;
			map.on('click', getUserSelectedPosition);
			$("#map").css({
				cursor: "default"
			});
		} else {

		}
	});	
});
{'fraction_non_alphanumeric': 0.18742889647326508, 'fraction_numerical': 0.016496018202502846, 'mean_word_length': 4.194977843426884, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1907004', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1265, 'n_words': 237}