<commit_before>var googlemap;
var heatmap;

function initHeatmap() {
	google.maps.event.addDomListener(window, 'load', function() {
		var newYorkCity = new google.maps.LatLng(40.76103210449219, -73.97576141357422);

		googlemap = new google.maps.Map(document.getElementById('map-canvas'), {
		  center: newYorkCity,
		  zoom: 11,
		  mapTypeId: google.maps.MapTypeId.SATELLITE
		})

		google.maps.event.addListener(googlemap, 'idle', adjustBoundsData)

		// heatMapDummy(); // TODO: Durch Backend implementierung ersetzen
	});
}

function heatMapCallback(data){
	data = JSON.parse(data)
	heatLayer = []
	for(var i = 0; i < data.length; i++){
		var current = data[i]
		heatLayer.push(new google.maps.LatLng(current.lat, current.long))
	}
	if (heatmap) heatmap.setMap(null)
	heatmap = new google.maps.visualization.HeatmapLayer({
		data: heatLayer
	})
	heatmap.setMap(googlemap)
}

function adjustBoundsData(){
	var southWestBound = googlemap.getBounds().getSouthWest()
	var northEastBound = googlemap.getBounds().getNorthEast()
	setHeatmapBounds(southWestBound, northEastBound)
}<commit_msg>fixed idle-bug and removed visual controls of google map<commit_after>var googlemap;
var heatmap;

function initHeatmap() {
	var boundsChanged = false;
	google.maps.event.addDomListener(window, 'load', function() {
		var newYorkCity = new google.maps.LatLng(40.76103210449219, -73.97576141357422);

		googlemap = new google.maps.Map(document.getElementById('map-canvas'), {
		  center: newYorkCity,
		  zoom: 11,
		  mapTypeId: google.maps.MapTypeId.SATELLITE,
		  disableDefaultUI: true
		})
		google.maps.event.addListener(googlemap, 'bounds_changed', setBoundsChanged)
		google.maps.event.addListener(googlemap, 'idle', adjustBoundsData)

		// heatMapDummy(); // TODO: Durch Backend implementierung ersetzen
	});
}

function heatMapCallback(data){
	data = JSON.parse(data)
	heatLayer = []
	for(var i = 0; i < data.length; i++){
		var current = data[i]
		heatLayer.push(new google.maps.LatLng(current.lat, current.long))
	}
	if (heatmap) heatmap.setMap(null)
	heatmap = new google.maps.visualization.HeatmapLayer({
		data: heatLayer
	})
	heatmap.setMap(googlemap)
}

function adjustBoundsData(){
	if (boundsChanged == true){
		var southWestBound = googlemap.getBounds().getSouthWest()
		var northEastBound = googlemap.getBounds().getNorthEast()
		setHeatmapBounds(southWestBound, northEastBound)
		boundsChanged = false
	}
}

function setBoundsChanged(){
	boundsChanged = true
}
{'fraction_non_alphanumeric': 0.12793522267206478, 'fraction_numerical': 0.02834008097165992, 'mean_word_length': 5.162094763092269, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '7528381', 'n_tokens_mistral': 939, 'n_tokens_neox': 833, 'n_words': 161}