<commit_before>/*
Link Calculator for Ingress
*/
var map;
var marker;
var circle;
var infowindow;

function initialize(lat, lng, range) {
	var myLatlng = new google.maps.LatLng(lat, lng);				
	var mapOptions = {
		center: myLatlng,
		zoom: getZoomLevel(range)
	    //,scrollwheel: false
	};
	map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
	
	/*
	google.maps.ControlPosition
	TOP_CENTER, TOP_LEFT, TOP_RIGHT, LEFT_TOP, RIGHT_TOP, LEFT_CENTER, RIGHT_CENTER, LEFT_BOTTOM, RIGHT_BOTTOM, BOTTOM_CENTER, BOTTOM_LEFT, BOTTOM_RIGHT
	*/

	// Add custom button
	var mapBackButtonDiv = document.createElement('div');
	var mapBackButton = new funcMapBackButton(mapBackButtonDiv, map);
	mapBackButtonDiv.index = 1;
	map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(mapBackButtonDiv);
				
	// Add custom button
	var mapCurrentLocationButtonDiv = document.createElement('div');
  mapCurrentLocationButtonDiv.id = 'map-current-location-button-div';
  mapCurrentLocationButtonDiv.title = 'Move current location.';
  mapCurrentLocationButtonDiv.innerHTML = '';
	if(isTouchDevice){
		google.maps.event.addDomListener(
			mapCurrentLocationButtonDiv, 'touchend', getCurrentLocation
		);
	} else {
		google.maps.event.addDomListener(
			mapCurrentLocationButtonDiv, 'click', getCurrentLocation
		);
	}
	map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(mapCurrentLocationButtonDiv);
				
	// Add custom button
	var mapMarkerButtonDiv = document.createElement('div');
	mapMarkerButtonDiv.id = 'map-marker-button-div';
	mapMarkerButtonDiv.title = 'drop marker';
	mapMarkerButtonDiv.innerHTML = '';
	if(isTouchDevice){
		google.maps.event.addDomListener(mapMarkerButtonDiv, 'touchend', function(e) {
			relocateMarker(map.getCenter().lat(), map.getCenter().lng());
		} );
	} else {
		google.maps.event.addDomListener(mapMarkerButtonDiv, 'click', function(e) {
			relocateMarker(map.getCenter().lat(), map.getCenter().lng());
		} );
	}
	map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(mapMarkerButtonDiv);

	// Add custom button (InputLocation)
	var inputLocationButtonDiv = document.createElement('div');
	inputLocationButtonDiv.id = 'map-inputLocation-button-div';
	inputLocationButtonDiv.title = 'input location';
	inputLocationButtonDiv.innerHTML = 'LOCATION';
	if(isTouchDevice){
		google.maps.event.addDomListener(inputLocationButtonDiv, 'touchend', function(e) {
			funcInputLocationDiv(inputLocationButtonDiv);
		} );
	} else {
		google.maps.event.addDomListener(inputLocationButtonDiv, 'click', function(e) {
			funcInputLocationDiv(inputLocationButtonDiv);
		} );
	}
	map.controls[google.maps.ControlPosition.LEFT_BOTTOM].push(inputLocationButtonDiv);
}

function funcInputLocationDiv(controlDiv) {
  if (document.getElementById('map-inputLocation-div')) {
    document.getElementById('map-inputLocation-div').visibility = true;
  } else {
  	var controlUI = document.createElement('div');
  	controlUI.id = 'map-inputLocation-div';
  	controlUI.innerHTML = 'Input to IntelMap portal URL or LatLng data.<br><input type="text" id="locURL"><br><input type="button" id="locURL_submit" value="mark">';
  	controlDiv.appendChild(controlUI);
	}
}

function relocateMarker(lat, lng) {
	var latLng = {};
	latLng['lat'] = lat;<commit_msg>function marking<commit_after>/*
Link Calculator for Ingress
*/
var map;
var marker;
var circle;
var infowindow;

function initialize(lat, lng, range) {
	var myLatlng = new google.maps.LatLng(lat, lng);				
	var mapOptions = {
		center: myLatlng,
		zoom: getZoomLevel(range)
	    //,scrollwheel: false
	};
	map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
	
	/*
	google.maps.ControlPosition
	TOP_CENTER, TOP_LEFT, TOP_RIGHT, LEFT_TOP, RIGHT_TOP, LEFT_CENTER, RIGHT_CENTER, LEFT_BOTTOM, RIGHT_BOTTOM, BOTTOM_CENTER, BOTTOM_LEFT, BOTTOM_RIGHT
	*/

	// Add custom button
	var mapBackButtonDiv = document.createElement('div');
	var mapBackButton = new funcMapBackButton(mapBackButtonDiv, map);
	mapBackButtonDiv.index = 1;
	map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(mapBackButtonDiv);
				
	// Add custom button
	var mapCurrentLocationButtonDiv = document.createElement('div');
  mapCurrentLocationButtonDiv.id = 'map-current-location-button-div';
  mapCurrentLocationButtonDiv.title = 'Move current location.';
  mapCurrentLocationButtonDiv.innerHTML = '';
	if(isTouchDevice){
		google.maps.event.addDomListener(
			mapCurrentLocationButtonDiv, 'touchend', getCurrentLocation
		);
	} else {
		google.maps.event.addDomListener(
			mapCurrentLocationButtonDiv, 'click', getCurrentLocation
		);
	}
	map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(mapCurrentLocationButtonDiv);
				
	// Add custom button
	var mapMarkerButtonDiv = document.createElement('div');
	mapMarkerButtonDiv.id = 'map-marker-button-div';
	mapMarkerButtonDiv.title = 'drop marker';
	mapMarkerButtonDiv.innerHTML = '';
	if(isTouchDevice){
		google.maps.event.addDomListener(mapMarkerButtonDiv, 'touchend', function(e) {
			relocateMarker(map.getCenter().lat(), map.getCenter().lng());
		} );
	} else {
		google.maps.event.addDomListener(mapMarkerButtonDiv, 'click', function(e) {
			relocateMarker(map.getCenter().lat(), map.getCenter().lng());
		} );
	}
	map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(mapMarkerButtonDiv);

	// Add custom button (InputLocation)
	var inputLocationButtonDiv = document.createElement('div');
	inputLocationButtonDiv.id = 'map-inputLocation-button-div';
	inputLocationButtonDiv.title = 'input location';
	inputLocationButtonDiv.innerHTML = 'LOCATION';
	if(isTouchDevice){
		google.maps.event.addDomListener(inputLocationButtonDiv, 'touchend', function(e) {
			funcInputLocationDiv(inputLocationButtonDiv);
		} );
	} else {
		google.maps.event.addDomListener(inputLocationButtonDiv, 'click', function(e) {
			funcInputLocationDiv(inputLocationButtonDiv);
		} );
	}
	map.controls[google.maps.ControlPosition.LEFT_BOTTOM].push(inputLocationButtonDiv);
}

function funcInputLocationDiv(controlDiv) {
  if (document.getElementById('map-inputLocation-div')) {
    document.getElementById('map-inputLocation-div').visibility = true;
  } else {
  	var controlUI = document.createElement('div');
  	controlUI.id = 'map-inputLocation-div';
  	controlUI.innerHTML = 'Input to IntelMap portal URL or LatLng data.<br><input type="text" id="locURL"><br><input type="button" id="locURL_submit" value="mark">';
  	controlDiv.appendChild(controlUI);
  	document.addEventListener("click", function(){
  	  funcAddMapMarking();
  	  document.getElementById('map-inputLocation-div').visibility = false;
  	}, false);
	}
}
function funcAddMapMarking() {
  alert("test test marking");
}


function relocateMarker(lat, lng) {
	var latLng = {};
	latLng['lat'] = lat;
{'fraction_non_alphanumeric': 0.13135031659549404, 'fraction_numerical': 0.0002945074363127669, 'mean_word_length': 5.771684945164506, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6663290', 'n_tokens_mistral': 2269, 'n_tokens_neox': 2153, 'n_words': 349}