Index: /gs3-extensions/map-editor/DrawingManager/checkpt23/index.css
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt23/index.css	(revision 32721)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt23/index.css	(revision 32721)
@@ -0,0 +1,70 @@
+/* Always set the map height explicitly to define the size of the div
+* element that contains the map. */
+#map {
+	height: 83%;
+	width: 90;
+	float: bottom;
+	clear: both;
+}
+
+  /* Optional: Makes the sample page fill the window. */
+  html, body {
+	height: 100%;
+	width: 99%;
+	margin: 0;
+	padding: 0;
+
+  }
+  
+  #DeleteButtons{
+  display: inline-block;
+  float: left;
+  padding-left: 10px;
+  padding-top: 5px;
+  width: 100%
+
+  }
+  
+  #LineThickness{
+  display: inline-block;
+  float: left;
+  padding-left: 10px;
+  padding-top: 5px;
+
+  }
+  
+  #ColourOpacity{
+  display: inline-block;
+  float: left;
+  padding-left: 10px;
+  padding-top: 5px;
+
+  }
+  
+  #buttons3{
+  display: inline-block;
+  float: left;
+  padding-left: 10px;
+  padding-top: 5px;
+
+  }	  
+  
+  #FillColour {
+  display: inline-block;
+  float: left;
+  padding-left: 10px;
+  padding-top: 5px;
+  }
+  
+  #color-palette1 {
+  clear: both;
+  }
+  
+  .color-buttons1 {
+  width: 14px;
+  height: 14px;
+  font-size: 0;
+  margin: 2px;
+  float: left;
+  cursor: pointer;
+  }
Index: /gs3-extensions/map-editor/DrawingManager/checkpt23/index.html
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt23/index.html	(revision 32721)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt23/index.html	(revision 32721)
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+  <head>
+	<title>Drawing Tools</title>
+	<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
+	<meta charset="utf-8">
+
+	<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
+	<script src="index.js"></script>	
+	<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBzunGwIF2OwsfrOkIC_8bhh0OPGZXo52Y&libraries=drawing&callback=initMap" async defer></script>
+	<script src="shortcuts.js"></script>
+	
+    <link rel="stylesheet" type="text/css" href="index.css">
+
+  </head>
+  <body>
+	<div id = "DeleteButtons">
+	<button onclick="deleteAllShape()" accesskey="c">Clear All</button>
+	<button onclick="deleteSelectedShape()" accesskey="b">Delete Selected</button>
+	<button onclick="polygonGetPath()" accesskey="q">Get Path</button>
+	<button onclick="undoMovement()" accesskey="n">Undo</button>
+	<button onclick="redoMovement()" accesskey="n">Redo</button>
+	
+	</div>
+	
+	<div id = "LineThickness">
+	<p>Line thickness: <input type="range" min="20" max="100" value="1" class="slider" id="thicknessRange"> </p>
+	<p>Value: <span id="thicknessRangeVal"></span></p>
+	</div>	
+	
+	<div id = "ColourOpacity">
+	<p>Colour opacity: <input type="range" min="10" max="100" value="40" class="slider" id="colourOpacity"> </p>
+	<p>Value: <span id="opacityRangeVal"></span></p>
+	</div>
+	
+
+
+	<div id="FillColour">
+     <p> Fill Colour:</p> <div id="color-palette1"></div> 
+	</div>
+
+	
+	
+	<div id="map"></div>
+	
+
+  </body>
+</html>
Index: /gs3-extensions/map-editor/DrawingManager/checkpt23/index.js
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt23/index.js	(revision 32721)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt23/index.js	(revision 32721)
@@ -0,0 +1,658 @@
+var debug = false;
+var redoPressed = false;
+var undoPressed = 0;
+var shiftKeyPressed = false;
+var dragFired = false;
+var selectionPass = true;
+var chosen;
+
+var overlays_copy_obj = {};
+
+var prevEdge = {
+	east: "",
+	north: "",
+	south: "",
+	west: ""
+}
+var nextEdge = {
+	east: "",
+	north: "",
+	south: "",
+	west: ""
+}
+var prevVertex = {
+	lat: "",
+	lng: ""
+};
+var nextVertex = {
+	lat: "",
+	lng: ""
+};
+var deselectedLog = []
+var selectedShapesLog = [];
+var prevShape = [];
+var nextShape = [];
+var prevLog = [];
+var nextLog = [];
+
+var prevOverlays = [];
+
+
+var dragged = 0;
+var colors = ['#1E90FF', '#FF1493', '#4B0082', '#32CD32', '#FF8C00', '#000000'];
+var selectedColor;
+var colorButtons = {};
+var thicknessValue = 1;
+var opacityValue = 0.4;
+var polyOptions = {
+	fillColor: '#CA4A2F',
+	strokeWeight: thicknessValue,
+	fillOpacity: opacityValue,
+	editable: true,
+	draggable: true,
+	geodesic: false,
+};
+
+var overlays = [];
+var drawingManager;
+var selectedShape;
+var selectedShapes = [];
+
+var map = null;
+
+
+$(document).ready(function() {
+	//Update thickness
+	var thicknessSlider = document.getElementById("thicknessRange");
+	var thicknessSliderOutput = document.getElementById("thicknessRangeVal");
+	thicknessSliderOutput.innerHTML = thicknessSlider.value / 20;
+
+	thicknessSlider.oninput = function () {
+		thicknessSliderOutput.innerHTML = this.value / 20;
+		thicknessValue = this.value / 20;
+		polyOptions.strokeWeight = thicknessValue;
+		setSelectedThickness(thicknessValue);
+	}
+	//Update opacity
+	var opacitySlider = document.getElementById("colourOpacity");
+	var opacitySliderOutput = document.getElementById("opacityRangeVal");
+	opacitySliderOutput.innerHTML = "% " + Math.round(opacitySlider.value);
+
+	opacitySlider.oninput = function () {
+		opacityValue = this.value / 100;
+		polyOptions.fillOpacity = opacityValue;
+		opacitySliderOutput = opacityValue;
+		opacityRangeVal.innerHTML = "% " + Math.round(opacitySliderOutput * 100);
+		setSelectedOpacity(opacityValue);
+	}
+});
+
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+function makeColorButton(color) {
+	var button = document.createElement('span');
+	button.className = 'color-buttons1';
+	button.style.backgroundColor = color;
+	google.maps.event.addDomListener(button, 'click', function () {
+		selectColor(color);
+		setSelectedShapeColor(color);
+	});
+	return button;
+}
+function buildColorPalette() {
+	var colorPalette = document.getElementById('color-palette1');
+	for (var i = 0; i < colors.length; ++i) {
+		var currColor = colors[i];
+		var colorButton = makeColorButton(currColor);
+		colorPalette.appendChild(colorButton);
+		colorButtons[currColor] = colorButton;
+	}
+	selectColor(colors[0]);
+};
+function selectColor(color) {
+	selectedColor = color;
+	for (var i = 0; i < colors.length; ++i) {
+		var currColor = colors[i];
+		colorButtons[currColor].style.border = currColor == color ? '2px solid #789' : '2px solid #fff';
+	}
+
+	// Retrieves the current options from the drawing manager and replaces the
+	// stroke or fill color as appropriate.
+	var polylineOptions = drawingManager.get('polylineOptions');
+	polylineOptions.strokeColor = color;
+	drawingManager.set('polylineOptions', polylineOptions);
+
+	var rectangleOptions = drawingManager.get('rectangleOptions');
+	rectangleOptions.fillColor = color;
+	drawingManager.set('rectangleOptions', rectangleOptions);
+
+	var circleOptions = drawingManager.get('circleOptions');
+	circleOptions.fillColor = color;
+	drawingManager.set('circleOptions', circleOptions);
+
+	var polygonOptions = drawingManager.get('polygonOptions');
+	polygonOptions.fillColor = color;
+	drawingManager.set('polygonOptions', polygonOptions);
+}
+
+function initMap() {
+
+	map = new google.maps.Map(document.getElementById('map'), {
+			center: {
+				lat: -34.397,
+				lng: 150.644
+			},
+			zoom: 2,
+			//mapTypeId: 'map'
+
+		});
+
+	drawingManager = new google.maps.drawing.DrawingManager({
+			drawingMode: google.maps.drawing.OverlayType.RECTANGLE,
+			drawingControl: true,
+			drawingControlOptions: {
+				position: google.maps.ControlPosition.TOP_CENTER,
+				drawingModes: ['marker', 'circle', 'polygon', 'polyline', 'rectangle']
+			},
+			markerOptions: {
+				draggable: true
+			},
+			circleOptions: polyOptions,
+			polylineOptions: polyOptions,
+			polygonOptions: polyOptions,
+			rectangleOptions: polyOptions,
+		});
+
+	drawingManager.setMap(map);
+
+	//overlays.push(event.overlay); // store reference to added overlay
+	google.maps.event.addListener(drawingManager, 'overlaycomplete', function (e) {
+		
+		
+		overlays.push(e.overlay); // store reference to added overlay
+		var newShape = e.overlay;
+		newShape.type = e.type;
+
+		newShapeCreated(e);
+		
+		historyOverlayPush();
+		
+		if (e.type !== google.maps.drawing.OverlayType.MARKER) {
+
+			// Switch back to non-drawing mode after drawing a shape.
+			//drawingManager.setDrawingMode(null);
+
+			// Add an event listener that selects the newly-drawn shape when the user
+			// mouses down on it.
+			google.maps.event.addListener(newShape, 'click', function (e) {
+
+				vertexAndPolyDel(e, newShape);
+				dragFired = false;
+				return;
+
+			});
+
+			//Stores past event information
+			google.maps.event.addListener(newShape, 'dragstart', function () {
+				dragStartFunction(e, newShape);
+			});
+
+			//Store information after the event ends
+			google.maps.event.addListener(newShape, 'dragend', function () {
+				historyOverlayPush();
+				dragEndFunction(e, newShape);
+			});
+
+			//Add an event listener to select a shape if the mouse hovers over it
+			google.maps.event.addListener(newShape, 'mousedown', function (e) {
+				if (drawingManager.drawingMode == null) {
+					setSelection(newShape, e);
+					dragFired = false;
+				}
+			});
+			setSelection(newShape, e);
+		} else {
+			//cLICK EVENT IF A MARKER IS CREATED
+			google.maps.event.addListener(newShape, 'click', function (e) {
+				setSelection(newShape, e);
+			});
+			setSelection(newShape, e);
+		}
+	});
+
+	//Deletes a vertex if clicked on it
+	function vertexAndPolyDel(e, newShape) {
+		var vertex = e.vertex;
+
+		if (e.vertex !== undefined) {
+			if (newShape.type === google.maps.drawing.OverlayType.POLYGON) {
+				var path = newShape.getPaths().getAt(e.path);
+				path.removeAt(e.vertex);
+				if (path.length < 3) {
+					newShape.setMap(null);
+				}
+			}
+			if (newShape.type === google.maps.drawing.OverlayType.POLYLINE) {
+				var path = newShape.getPath();
+				path.removeAt(e.vertex);
+				if (path.length < 2) {
+					newShape.setMap(null);
+				}
+			}
+		}
+	}
+
+	function clearSelection() {
+		if (selectedShape) {
+			if (selectedShape.type !== 'marker') {
+				selectedShape.setEditable(false);
+				if (shiftKeyPressed == false) {
+					for (var i = 0; i < selectedShapes.length; i++) {
+						selectedShapes[i].setEditable(false);
+					}
+					selectedShapes = [];
+				}
+			}
+			selectedShape = null;
+		}
+	}
+	var i = 0;
+
+	//Set selection for the selected overlay
+	function setSelection(shape, e) {
+		if (shape.type !== 'marker') {
+			if (shiftKeyPressed == false) {
+				if (e.vertex == undefined) {
+					clearSelection();
+					shape.setEditable(true);
+				}
+			}
+			if (selectedShapes.includes(shape)) {
+
+				//shape.setEditable(false);
+				const index = selectedShapes.indexOf(shape);
+				selectedShapes.splice(index, 1);
+			} else {
+				shape.setEditable(true);
+				selectedShapes.push(shape);
+			}
+
+			if (debug) {
+				console.log(" len = " + selectedShapes.length);
+			}
+			//Send the values to be updated
+			var thi = shape.strokeWeight;
+			var opa = shape.fillOpacity;
+			var fCol = shape.fillColor;
+			var sCol = shape.strokeColor;
+			updateMenuValues(thi, opa, fCol, sCol);
+
+		} else if (shape.type == 'marker') {
+			clearSelection();
+		}
+
+		selectedShape = shape;
+
+		if (selectionPass == true) {
+
+			selectedShapesLog.push("selected", shiftKeyPressed, selectedShape);
+			nextLog.push(selectedShapesLog);
+			chosen = selectedShape;
+			selectionPass = false
+		}
+
+		var lastItem = nextLog[nextLog.length - 1];
+
+		if (chosen !== selectedShape) {
+			if (dragFired == false) {
+				selectedShapesLog.push("selected", shiftKeyPressed, selectedShape)
+				updateHistory(selectedShapesLog);
+				chosen = selectedShape;
+			}
+		}
+
+		//console.log(prevLog);
+		selectedShapesLog = [];
+	}
+
+	//Clears selection if clicked on the map when shift is not presseed
+	google.maps.event.addListener(map, 'click', function () {
+		if (shiftKeyPressed == false) {
+			clearSelection();
+			if (chosen !== null) {
+				deselectedLog.push("deselected")
+				updateHistory(deselectedLog);
+				deselectedLog = [];
+				chosen = null;
+
+			}
+		}
+	});
+
+	//Setting drawing tool option
+	document.addEventListener('keydown', function () {
+		//if (event.code == 'KeyX' && (event.ctrlKey || event.metaKey))
+		if (event.code == 'Digit0' || event.code == 'Numpad0' || event.code == 'Backquote') {
+			//clearSelection();
+			drawingManager.setDrawingMode(null);
+		} else if (event.code == 'Digit1') {
+			drawingManager.setDrawingMode('marker');
+		} else if (event.code == 'Digit2') {
+			drawingManager.setDrawingMode('circle');
+		} else if (event.code == 'Digit3') {
+			drawingManager.setDrawingMode('polygon');
+		} else if (event.code == 'Digit4') {
+			drawingManager.setDrawingMode('polyline');
+		} else if (event.code == 'Digit5') {
+			drawingManager.setDrawingMode('rectangle');
+		} else if (event.code == 'KeyQ') {
+			polygonGetPath();
+		}
+		//					console.log(event.code);
+	});
+
+	//Sets shift as pressed
+	document.addEventListener('keydown', function () {
+		if (event.code == 'ShiftLeft' || event.code == 'ShiftRight') {
+			shiftKeyPressed = true;
+
+		}
+
+	});
+
+	//Sets shift as unpressed
+	document.addEventListener('keyup', function () {
+		if (event.code == 'ShiftLeft' || event.code == 'ShiftRight') {
+			shiftKeyPressed = false;
+		}
+
+	});
+
+	buildColorPalette();
+}
+//Set selected thickness
+function setSelectedThickness(sWeight) {
+	if (selectedShape) {
+		//selectedShape.set('strokeWeight', sWeight)
+	}
+	if (selectedShapes !== 0) {
+		for (var i = 0; i < selectedShapes.length; i++) {
+			selectedShapes[i].set('strokeWeight', sWeight);
+			//console.log(selectedShapes.length);
+		}
+	}
+}
+
+//Set selected opacity
+function setSelectedOpacity(fOpacity) {
+	if (selectedShape) {
+		//selectedShape.set('fillOpacity', fOpacity)
+	}
+	if (selectedShapes !== 0) {
+		for (var i = 0; i < selectedShapes.length; i++) {
+			selectedShapes[i].set('fillOpacity', fOpacity);
+		}
+	}
+}
+
+//set selected fill colour
+function setSelectedShapeColor(color) {
+	if (selectedShapes !== 0) {
+		for (var i = 0; i < selectedShapes.length; i++) {
+			selectedShapes[i].set('fillColor', color);
+			selectedShapes[i].set('strokeColor', color);
+		}
+	}
+}
+
+function updateMenuValues(thi, opa, fCol, sCol) {
+
+	//Update thickness slider and value on the settings menu
+	var thicknessSliderOutput = document.getElementById("thicknessRangeVal");
+	thicknessSliderOutput.innerHTML = thi;
+	document.getElementById("thicknessRange").value = thi * 20;
+
+	//Update the opacity slider and value on the settings menu
+	var opacitySliderOutput = document.getElementById("opacityRangeVal");
+	opacitySliderOutput.innerHTML = "% " + opa * 100;
+	document.getElementById("colourOpacity").value = opa * 100;
+
+	if (drawingManager.drawingMode == null) {
+		selectColor(fCol);
+	}
+}
+
+function undoMovement() {
+	console.log("*** undoMovement called");
+	for (var i = 0; i < overlays.length; i++) {
+		overlays[i].setMap(null);
+
+	}
+	
+	overlays = [];
+	
+	var prev_overlay = prevOverlays.pop();
+	
+	for (var i = 0; i < prev_overlay.length; i++) {
+		overlays[i] = prev_overlay[i];
+		overlays[i].setMap(map);
+	}
+	
+}
+
+function undoMovementDragSelection() {
+	var lastItem = prevLog[prevLog.length - 1];
+
+	//If history array is not empty
+	if (prevLog.length !== 0) {
+		if (lastItem[0] = "dragStart") {
+			//If the array has more than one index (polygons and polylines)
+			if (lastItem[1] == ("polygon") || lastItem[1] == ("polyline")) {
+				nextLog.push(lastItem);
+				selectedShape.setPath(lastItem[2]);
+
+				//If the array has only one index(rectangles and circles)
+			} else {
+				nextLog.push(lastItem);
+				selectedShape.setBounds(lastItem[2]);
+			}
+		} else if (lastItem[0] = "selected") {}
+		else if (lastItem[0] = "deselected") {}
+		undoPressed = false;
+		undoPressed = 0;
+		prevLog.pop();
+	}
+
+}
+
+function redoMovement() {
+
+	var lastItem = nextLog[nextLog.length - 1];
+	var secondToLastItem = nextLog[nextLog.length - 2];
+	var correctIndex;
+
+	if (undoPressed >= 1) {
+		correctIndex = lastItem;
+	} else {
+		correctIndex = secondToLastItem;
+		undoPressed++;
+	}
+
+	//If the history log is not empty
+	if (nextLog.length > 1) {
+		prevLog.push(lastItem);
+
+		//If undo has been pressed
+
+		if (lastItem[1] == ("polygon") || lastItem[1] == ("polyline")) {
+			selectedShape.setPath(correctIndex[2]);
+		} else {
+			selectedShape.setBounds(correctIndex[2]);
+		}
+
+		undoPressed = false;
+		redoPressed = true;
+		nextLog.pop();
+	}
+}
+
+function dragStartFunction(e, selectedShape) {
+	var newShape = e.overlay;
+	newShape.type = e.type;
+	if (selectedShape) {
+		var polyG = newShape.type === google.maps.drawing.OverlayType.POLYLINE;
+		var polyL = newShape.type === google.maps.drawing.OverlayType.POLYGON;
+
+		if (polyL || polyG) {
+			var latLngi = []
+			var lati,
+			lngi;
+			for (var i = 0; i < selectedShape.getPath().length; i++) {
+				lati = selectedShape.getPath().getAt(i).lat();
+				lngi = selectedShape.getPath().getAt(i).lng();
+				//console.log("Vertex number",i, "'s latitude is", lati, "and longitude is", lngi);
+				prevVertex = {
+					lat: lati,
+					lng: lngi
+				};
+				latLngi.push(prevVertex);
+			}
+			prevShape.push("dragStart", selectedShape.type, latLngi);
+		} else {
+			prevEdge = {
+				east: selectedShape.getBounds().ea.l,
+				north: selectedShape.getBounds().la.l,
+				south: selectedShape.getBounds().la.j,
+				west: selectedShape.getBounds().ea.j
+			}
+			prevShape.push("dragStart", selectedShape.type, prevEdge);
+		}
+
+		var lastItem = nextLog[nextLog.length - 1];
+		if (lastItem[0] !== "dragEnd") {
+			prevLog.push(nextLog[nextLog.length - 1]);
+		}
+
+		prevLog.push(prevShape);
+		prevShape = [];
+		nextLog = [];
+		chosen = selectedShape;
+		dragFired = true;
+	}
+}
+
+function dragEndFunction(e, newShape) {
+
+	var newShape = e.overlay;
+	newShape.type = e.type;
+	if (selectedShape) {
+		var polyG = newShape.type === google.maps.drawing.OverlayType.POLYLINE;
+		var polyL = newShape.type === google.maps.drawing.OverlayType.POLYGON;
+
+		if (polyL || polyG) {
+
+			var latLngi = []
+			var lati,
+			lngi;
+
+			for (var i = 0; i < selectedShape.getPath().length; i++) {
+				lati = selectedShape.getPath().getAt(i).lat();
+				lngi = selectedShape.getPath().getAt(i).lng();
+				nextVertex = {
+					lat: lati,
+					lng: lngi
+				};
+				latLngi.push(nextVertex);
+			}
+			nextShape.push("dragEnd", selectedShape.type, latLngi);
+		} else {
+
+			nextEdge.east = selectedShape.getBounds().ea.l;
+			nextEdge.north = selectedShape.getBounds().la.l;
+			nextEdge.south = selectedShape.getBounds().la.j;
+			nextEdge.west = selectedShape.getBounds().ea.j;
+
+			nextShape.push("dragEnd", selectedShape.type, nextEdge);
+		}
+	}
+	for (var i = 0; i < prevLog.length; i++) {
+		if (prevLog[i][0] == "dragEnd") {
+			const index = i;
+			prevLog.splice(index, 1);
+		}
+	}
+	nextLog.push(nextShape);
+	nextShape = [];
+	chosen = selectedShape;
+}
+
+function updateHistory(eventArray) {
+	var lastItem = nextLog[nextLog.length - 1];
+	if (nextLog.length > 0) {
+		prevLog.push(lastItem);
+	}
+	nextLog = [];
+	nextLog.push(eventArray);
+	eventArray = [];
+	dragFired = false;
+
+}
+
+function newShapeCreated(e) {
+	//nextLog
+}
+
+function polygonGetPath() {
+	console.log(nextLog);
+	console.log(prevLog);
+
+}
+
+function deleteSelectedShape() {
+	for (var i = 0; i < selectedShapes.length; i++) {
+		selectedShapes[i].setMap(null);
+	}
+	selectedShapes = [];
+}
+
+function deleteAllShape() {
+	for (var i = 0; i < overlays.length; i++) {
+		overlays[i].setMap(null);
+
+	}
+	overlays = [];
+}
+
+function historyOverlayPush()
+{
+	//console.log("historyOverlayPush()");
+	//var overlays_copy = [];
+	//for (var i = 0; i<overlays.length; i++) {
+	//	overlays_copy[i] = new google.maps.Rectangle(overlays[i]);
+	//}
+	//var overlay_copy = JSON.parse(JSON.stringify(overlays));
+	//prevOverlays.push(overlays_copy); 
+	//
+	//prevOverlays.push(overlays.slice()); // shallow copy !!!
+	
+	console.log("historyOverlayPush()");
+	var overlays_copy = [];
+	for (var i = 0; i<overlays.length; i++) {
+		
+		overlays_copy[i] = overlays[i];
+		
+	}
+	overlays_copy_obj = overlays_copy;
+	console.log(overlays_copy_obj);
+	console.log(overlays);
+	console.log(prevOverlays);
+	//console.log(JSON.stringify(overlays_copy_obj));
+	
+	var overlay_copy = overlays;
+	prevOverlays.push(overlays_copy_obj); 
+	
+	//prevOverlays.push(overlays.slice()); // shallow copy !!!
+	
+	
+}
Index: /gs3-extensions/map-editor/DrawingManager/checkpt23/shortcuts.js
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt23/shortcuts.js	(revision 32721)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt23/shortcuts.js	(revision 32721)
@@ -0,0 +1,223 @@
+/**
+ * http://www.openjs.com/scripts/events/keyboard_shortcuts/
+ * Version : 2.01.B
+ * By Binny V A
+ * License : BSD
+ */
+shortcut = {
+	'all_shortcuts':{},//All the shortcuts are stored in this array
+	'add': function(shortcut_combination,callback,opt) {
+		//Provide a set of default options
+		var default_options = {
+			'type':'keydown',
+			'propagate':false,
+			'disable_in_input':false,
+			'target':document,
+			'keycode':false
+		}
+		if(!opt) opt = default_options;
+		else {
+			for(var dfo in default_options) {
+				if(typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo];
+			}
+		}
+
+		var ele = opt.target;
+		if(typeof opt.target == 'string') ele = document.getElementById(opt.target);
+		var ths = this;
+		shortcut_combination = shortcut_combination.toLowerCase();
+
+		//The function to be called at keypress
+		var func = function(e) {
+			e = e || window.event;
+			
+			if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields
+				var element;
+				if(e.target) element=e.target;
+				else if(e.srcElement) element=e.srcElement;
+				if(element.nodeType==3) element=element.parentNode;
+
+				if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return;
+			}
+	
+			//Find Which key is pressed
+			if (e.keyCode) code = e.keyCode;
+			else if (e.which) code = e.which;
+			var character = String.fromCharCode(code).toLowerCase();
+			
+			if(code == 188) character=","; //If the user presses , when the type is onkeydown
+			if(code == 190) character="."; //If the user presses , when the type is onkeydown
+
+			var keys = shortcut_combination.split("+");
+			//Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked
+			var kp = 0;
+			
+			//Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken
+			var shift_nums = {
+				"`":"~",
+				"1":"!",
+				"2":"@",
+				"3":"#",
+				"4":"$",
+				"5":"%",
+				"6":"^",
+				"7":"&",
+				"8":"*",
+				"9":"(",
+				"0":")",
+				"-":"_",
+				"=":"+",
+				";":":",
+				"'":"\"",
+				",":"<",
+				".":">",
+				"/":"?",
+				"\\":"|"
+			}
+			//Special Keys - and their codes
+			var special_keys = {
+				'esc':27,
+				'escape':27,
+				'tab':9,
+				'space':32,
+				'return':13,
+				'enter':13,
+				'backspace':8,
+	
+				'scrolllock':145,
+				'scroll_lock':145,
+				'scroll':145,
+				'capslock':20,
+				'caps_lock':20,
+				'caps':20,
+				'numlock':144,
+				'num_lock':144,
+				'num':144,
+				
+				'pause':19,
+				'break':19,
+				
+				'insert':45,
+				'home':36,
+				'delete':46,
+				'end':35,
+				
+				'pageup':33,
+				'page_up':33,
+				'pu':33,
+	
+				'pagedown':34,
+				'page_down':34,
+				'pd':34,
+	
+				'left':37,
+				'up':38,
+				'right':39,
+				'down':40,
+	
+				'f1':112,
+				'f2':113,
+				'f3':114,
+				'f4':115,
+				'f5':116,
+				'f6':117,
+				'f7':118,
+				'f8':119,
+				'f9':120,
+				'f10':121,
+				'f11':122,
+				'f12':123
+			}
+	
+			var modifiers = { 
+				shift: { wanted:false, pressed:false},
+				ctrl : { wanted:false, pressed:false},
+				alt  : { wanted:false, pressed:false},
+				meta : { wanted:false, pressed:false}	//Meta is Mac specific
+			};
+                        
+			if(e.ctrlKey)	modifiers.ctrl.pressed = true;
+			if(e.shiftKey)	modifiers.shift.pressed = true;
+			if(e.altKey)	modifiers.alt.pressed = true;
+			if(e.metaKey)   modifiers.meta.pressed = true;
+                        
+			for(var i=0; k=keys[i],i<keys.length; i++) {
+				//Modifiers
+				if(k == 'ctrl' || k == 'control') {
+					kp++;
+					modifiers.ctrl.wanted = true;
+
+				} else if(k == 'shift') {
+					kp++;
+					modifiers.shift.wanted = true;
+
+				} else if(k == 'alt') {
+					kp++;
+					modifiers.alt.wanted = true;
+				} else if(k == 'meta') {
+					kp++;
+					modifiers.meta.wanted = true;
+				} else if(k.length > 1) { //If it is a special key
+					if(special_keys[k] == code) kp++;
+					
+				} else if(opt['keycode']) {
+					if(opt['keycode'] == code) kp++;
+
+				} else { //The special keys did not match
+					if(character == k) kp++;
+					else {
+						if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase
+							character = shift_nums[character]; 
+							if(character == k) kp++;
+						}
+					}
+				}
+			}
+			
+			if(kp == keys.length && 
+						modifiers.ctrl.pressed == modifiers.ctrl.wanted &&
+						modifiers.shift.pressed == modifiers.shift.wanted &&
+						modifiers.alt.pressed == modifiers.alt.wanted &&
+						modifiers.meta.pressed == modifiers.meta.wanted) {
+				callback(e);
+	
+				if(!opt['propagate']) { //Stop the event
+					//e.cancelBubble is supported by IE - this will kill the bubbling process.
+					e.cancelBubble = true;
+					e.returnValue = false;
+	
+					//e.stopPropagation works in Firefox.
+					if (e.stopPropagation) {
+						e.stopPropagation();
+						e.preventDefault();
+					}
+					return false;
+				}
+			}
+		}
+		this.all_shortcuts[shortcut_combination] = {
+			'callback':func, 
+			'target':ele, 
+			'event': opt['type']
+		};
+		//Attach the function with the event
+		if(ele.addEventListener) ele.addEventListener(opt['type'], func, false);
+		else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func);
+		else ele['on'+opt['type']] = func;
+	},
+
+	//Remove the shortcut - just specify the shortcut and I will remove the binding
+	'remove':function(shortcut_combination) {
+		shortcut_combination = shortcut_combination.toLowerCase();
+		var binding = this.all_shortcuts[shortcut_combination];
+		delete(this.all_shortcuts[shortcut_combination])
+		if(!binding) return;
+		var type = binding['event'];
+		var ele = binding['target'];
+		var callback = binding['callback'];
+
+		if(ele.detachEvent) ele.detachEvent('on'+type, callback);
+		else if(ele.removeEventListener) ele.removeEventListener(type, callback, false);
+		else ele['on'+type] = false;
+	}
+}
Index: /gs3-extensions/map-editor/DrawingManager/historyManager.js
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/historyManager.js	(revision 32720)
+++ /gs3-extensions/map-editor/DrawingManager/historyManager.js	(revision 32721)
@@ -1,19 +1,36 @@
 var prevOverlays = [];
 
-function undoMovement() {
-	console.log("*** undoMovement called");
+function undo() {
+
 	for (var i = 0; i < overlays.length; i++) {
 		overlays[i].setMap(null);
 
 	}
-	
-	overlays = [];
-	
-	var prev_overlay = prevOverlays.pop();
-	
-	for (var i = 0; i < prev_overlay.length; i++) {
-		overlays[i] = prev_overlay[i];
-		overlays[i].setMap(map);
-	}
+	if (prevOverlays.length != 0){
+		overlays = [];
+		console.log(prevOverlays);
+		var prev_overlay = prevOverlays.pop();
+		
+		for (var i = 0; i < prev_overlay.length; i++) {
+			overlays[i] = prev_overlay[i];
+			overlays[i].setMap(map);
+		}
+		
+	}
+	
+	//Deactivated at the moment
+	if(enableSelectionFeature){
+		selectedShapes = [];
+		var i = 0;
+		var lastEntry = prevOverlays[prevOverlays.length-1][i];
+		console.log(prevOverlays[prevOverlays.length-1].length);
+		
+		for(var i = 0; i < lastEntry.length; i++){
+			selectedShapes.push(prevOverlays)
+			console.log("comes here");
+		}
+		
+	}
+	
 	
 }
@@ -43,6 +60,6 @@
 	var strokeOpacity = polyline.strokeOpacity;
 	var strokeWeight  = polyline.strokeWeight;
-	
 	var clone_path    = clonePath(path);
+	//var editable      = rect.editable;
 	
 	var clone_polyline = new google.maps.Polyline({
@@ -51,5 +68,7 @@
 		strokeOpacity: strokeOpacity,
 		strokeWeight: strokeWeight,
-		path: clone_path
+		path: clone_path,
+		draggable: true,
+		editable: false
 	});
 	
@@ -68,6 +87,6 @@
 	var fillColor     = polygon.fillColor;
 	var fillOpacity   = polygon.fillOpacity;
-	
 	var clone_path    = clonePath(path);
+	//var editable      = rect.editable;
 	
 	var clone_polygon = new google.maps.Polygon({
@@ -78,5 +97,7 @@
 		fillColor: fillColor,
 		fillOpacity: fillOpacity,
-		path: clone_path
+		path: clone_path,
+		draggable: true,
+		editable: false
 	});
 	
@@ -94,4 +115,5 @@
 	var fillOpacity   = rect.fillOpacity;
 	var bounds        = rect.getBounds();
+	//var editable      = rect.editable;
 	
 	var clone_rect = new google.maps.Rectangle({
@@ -101,5 +123,7 @@
 		fillColor: fillColor,
 		fillOpacity: fillOpacity,
-		bounds: bounds
+		bounds: bounds,
+		draggable: true,
+		editable: false
 	});
 	
@@ -118,4 +142,5 @@
 	var center        = circ.center;
 	var radius        = circ.radius;
+	//var editable      = rect.editable;
 	
 	var clone_circ = new google.maps.Circle({
@@ -126,5 +151,7 @@
 		fillOpacity: fillOpacity,
 		center: center,
-		radius: radius
+		radius: radius,
+		draggable: true,
+		editable: false
 	});
 	
@@ -161,17 +188,29 @@
 }
 
+function overlayItemIsShape(overlay_item)
+{
+	var type = overlay_item.type;
+	
+	is_shape = (type === google.maps.drawing.OverlayType.POLYLINE)
+	 || (type === google.maps.drawing.OverlayType.POLYGON)
+	 || (type === google.maps.drawing.OverlayType.RECTANGLE)
+	 || (type === google.maps.drawing.OverlayType.CIRCLE);
+	 
+	 return is_shape;
+}
+
 function historyOverlayPush()
 {
-	console.log("historyOverlayPush()");
+	console.log("comes here");
 	var overlays_copy = [];
 	for (var i = 0; i<overlays.length; i++) {
 		var clone_shape = cloneShape(overlays[i]);
-		
-		google.maps.event.addListener(clone_shape, 'click', function () {
-			setSelection(clone_shape);
-		});
-			
+		if (overlayItemIsShape(clone_shape)) {
+			addShapeListeners(clone_shape,null); // don't have an overlay event!
+		}
+		else {
+			addMarkerListeners(clone_shape,null); // don't have an overlay event!
+		}
 		overlays_copy[i] = clone_shape;
-		
 	}
 	
Index: /gs3-extensions/map-editor/DrawingManager/index.html
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/index.html	(revision 32720)
+++ /gs3-extensions/map-editor/DrawingManager/index.html	(revision 32721)
@@ -18,6 +18,6 @@
 	<button onclick="deleteAllShape()" accesskey="c">Clear All</button>
 	<button onclick="deleteSelectedShape()" accesskey="b">Delete Selected</button>
-	<button onclick="polygonGetPath()" accesskey="q">Get Path</button>
-	<button onclick="undoMovement()" accesskey="n">Undo</button>
+	<button onclick="printHistory()" accesskey="q">Print History</button>
+	<button onclick="undo()" accesskey="n">Undo</button>
 	<button onclick="redoMovement()" accesskey="n">Redo</button>
 	
Index: /gs3-extensions/map-editor/DrawingManager/index.js
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/index.js	(revision 32720)
+++ /gs3-extensions/map-editor/DrawingManager/index.js	(revision 32721)
@@ -6,27 +6,8 @@
 var selectionPass = true;
 var chosen;
-
-var overlays_copy_obj = {};
-
-var prevEdge = {
-	east: "",
-	north: "",
-	south: "",
-	west: ""
-}
-var nextEdge = {
-	east: "",
-	north: "",
-	south: "",
-	west: ""
-}
-var prevVertex = {
-	lat: "",
-	lng: ""
-};
-var nextVertex = {
-	lat: "",
-	lng: ""
-};
+var enableSelectionFeature = false;
+var beingDragged = false;
+
+
 var deselectedLog = []
 var selectedShapesLog = [];
@@ -35,8 +16,4 @@
 var prevLog = [];
 var nextLog = [];
-
-
-
-
 var dragged = 0;
 var colors = ['#1E90FF', '#FF1493', '#4B0082', '#32CD32', '#FF8C00', '#000000'];
@@ -62,4 +39,5 @@
 
 
+
 $(document).ready(function() {
 	//Update thickness
@@ -86,9 +64,17 @@
 		setSelectedOpacity(opacityValue);
 	}
+	
+	document.getElementById("thicknessRange").addEventListener("mousedown", shapeSpecsChange);
+	document.getElementById("colourOpacity").addEventListener("mousedown", shapeSpecsChange);
+	document.getElementById("color-palette1").addEventListener("mousedown", shapeSpecsChange);
 });
 
-
-
-////////////////////////////////////////////////////////////////////////////////////////
+function shapeSpecsChange() {
+	if (selectedShapes.length > 0) {
+		historyOverlayPush();
+
+	}
+}
+
 function makeColorButton(color) {
 	var button = document.createElement('span');
@@ -170,5 +156,5 @@
 	google.maps.event.addListener(drawingManager, 'overlaycomplete', function (e) {
 		
-		
+		console.log(e)
 		
 		historyOverlayPush();
@@ -177,76 +163,16 @@
 		var newShape = e.overlay;
 		newShape.type = e.type;
-
-	
+		
+		//historyOverlayPush();
 		
 		if (e.type !== google.maps.drawing.OverlayType.MARKER) {
-
-			// Switch back to non-drawing mode after drawing a shape.
-			//drawingManager.setDrawingMode(null);
-
-			// Add an event listener that selects the newly-drawn shape when the user
-			// mouses down on it.
-			google.maps.event.addListener(newShape, 'click', function (e) {
-
-				vertexAndPolyDel(e, newShape);
-				dragFired = false;
-				return;
-
-			});
-
-			//Stores past event information
-			google.maps.event.addListener(newShape, 'dragstart', function () {
-				dragStartFunction(e, newShape);
-			});
-
-			//Store information after the event ends
-			google.maps.event.addListener(newShape, 'dragend', function () {
-				historyOverlayPush();
-				dragEndFunction(e, newShape);
-			});
-
-			//Add an event listener to select a shape if the mouse hovers over it
-			google.maps.event.addListener(newShape, 'mousedown', function (e) {
-				if (drawingManager.drawingMode == null) {
-					setSelection(newShape, e);
-					dragFired = false;
-				}
-			});
+			addShapeListeners(newShape,e);
 			setSelection(newShape, e);
 		} else {
-			//cLICK EVENT IF A MARKER IS CREATED
-			google.maps.event.addListener(newShape, 'click', function (e) {
-				setSelection(newShape, e);
-			});
+			
+			addMarkerListeners(newShape,e);
 			setSelection(newShape, e);
 		}
 	});
-
-	//Deletes a vertex if clicked on it
-	function vertexAndPolyDel(e, newShape) {
-		var vertex = e.vertex;
-
-		if (e.vertex !== undefined) {
-			if (newShape.type === google.maps.drawing.OverlayType.POLYGON) {
-				var path = newShape.getPaths().getAt(e.path);
-				path.removeAt(e.vertex);
-				if (path.length < 3) {
-					newShape.setMap(null);
-				}
-			}
-			if (newShape.type === google.maps.drawing.OverlayType.POLYLINE) {
-				var path = newShape.getPath();
-				path.removeAt(e.vertex);
-				if (path.length < 2) {
-					newShape.setMap(null);
-				}
-			}
-		}
-	}
-
-	
-	var i = 0;
-
-	
 
 	//Clears selection if clicked on the map when shift is not presseed
@@ -256,7 +182,7 @@
 			if (chosen !== null) {
 				deselectedLog.push("deselected")
-				updateHistory(deselectedLog);
 				deselectedLog = [];
 				chosen = null;
+				selectedShape = null;
 
 			}
@@ -281,5 +207,5 @@
 			drawingManager.setDrawingMode('rectangle');
 		} else if (event.code == 'KeyQ') {
-			polygonGetPath();
+			printHistory();
 		}
 		//					console.log(event.code);
@@ -306,5 +232,75 @@
 }
 
-
+	//Deletes a vertex if clicked on it
+	function vertexAndPolyDel(e, newShape) {
+		var vertex = e.vertex;
+
+		if (e.vertex !== undefined) {
+			if (newShape.type === google.maps.drawing.OverlayType.POLYGON) {
+				var path = newShape.getPaths().getAt(e.path);
+				path.removeAt(e.vertex);
+				if (path.length < 3) {
+					newShape.setMap(null);
+				}
+			}
+			if (newShape.type === google.maps.drawing.OverlayType.POLYLINE) {
+				var path = newShape.getPath();
+				path.removeAt(e.vertex);
+				if (path.length < 2) {
+					newShape.setMap(null);
+				}
+			}
+		}
+	}
+	
+function addMarkerListeners(newShape,e)
+{
+	//cLICK EVENT IF A MARKER IS CREATED
+			google.maps.event.addListener(newShape, 'click', function (e) {
+				setSelection(newShape, e);
+			});
+}
+function addShapeListeners(newShape,e)
+{
+		// Switch back to non-drawing mode after drawing a shape.
+			//drawingManager.setDrawingMode(null);
+
+			// Add an event listener that selects the newly-drawn shape when the user
+			// mouses down on it.
+			google.maps.event.addListener(newShape, 'click', function (e) {
+				vertexAndPolyDel(e, newShape);
+				console.log(e.edge);
+			});
+
+			google.maps.event.addListener(newShape, 'dragstart', function () {
+				beingDragged = true;
+				historyOverlayPush();
+			});
+			
+			google.maps.event.addListener(newShape, 'dragend', function () {
+				beingDragged = false;
+			});
+			
+			//Store information after the event ends
+			google.maps.event.addListener(newShape, 'bounds_changed', function () {
+				console.log("bounds_changed");
+				if (beingDragged == false){
+					historyOverlayPush();
+				}
+			});
+						
+			google.maps.event.addListener(newShape, 'resize', function () {
+				console.log("lmao");
+				//historyOverlayPush();
+					
+			});
+
+			//Add an event listener to select a shape if the mouse hovers over it
+			google.maps.event.addListener(newShape, 'mousedown', function (e) {
+				if (drawingManager.drawingMode == null) {
+					setSelection(newShape, e);
+				}
+			});
+}
 function clearSelection() {
 		if (selectedShape) {
@@ -326,9 +322,7 @@
 		if (shape.type !== 'marker') {
 			if (shiftKeyPressed == false) {
-				//if (e.vertex == undefined) {
-					console.log("**** e.vertex = " + e.vertex);
-					
-				if ((shape.type != google.maps.drawing.OverlayType.POLYLINE) 
-					&& (shape.type != google.maps.drawing.OverlayType.POLYGON)) {
+				if (e.vertex == undefined) {	
+				//if ((shape.type != google.maps.drawing.OverlayType.POLYLINE) 
+					//&& (shape.type != google.maps.drawing.OverlayType.POLYGON)) {
 					clearSelection();
 					shape.setEditable(true);
@@ -374,5 +368,4 @@
 			if (dragFired == false) {
 				selectedShapesLog.push("selected", shiftKeyPressed, selectedShape)
-				updateHistory(selectedShapesLog);
 				chosen = selectedShape;
 			}
@@ -382,6 +375,5 @@
 		selectedShapesLog = [];
 	}
-	
-	
+		
 //Set selected thickness
 function setSelectedThickness(sWeight) {
@@ -399,5 +391,4 @@
 
 	if (selectedShapes.length > 0) {
-		//historyOverlayPush();
 		for (var i = 0; i < selectedShapes.length; i++) {
 			selectedShapes[i].set('fillOpacity', fOpacity);
@@ -409,5 +400,4 @@
 function setSelectedShapeColor(color) {
 	if (selectedShapes.length >	0) {
-		historyOverlayPush();
 		for (var i = 0; i < selectedShapes.length; i++) {
 			selectedShapes[i].set('fillColor', color);
@@ -432,31 +422,4 @@
 		selectColor(fCol);
 	}
-}
-
-
-
-function undoMovementDragSelection() {
-	var lastItem = prevLog[prevLog.length - 1];
-
-	//If history array is not empty
-	if (prevLog.length !== 0) {
-		if (lastItem[0] = "dragStart") {
-			//If the array has more than one index (polygons and polylines)
-			if (lastItem[1] == ("polygon") || lastItem[1] == ("polyline")) {
-				nextLog.push(lastItem);
-				selectedShape.setPath(lastItem[2]);
-
-				//If the array has only one index(rectangles and circles)
-			} else {
-				nextLog.push(lastItem);
-				selectedShape.setBounds(lastItem[2]);
-			}
-		} else if (lastItem[0] = "selected") {}
-		else if (lastItem[0] = "deselected") {}
-		undoPressed = false;
-		undoPressed = 0;
-		prevLog.pop();
-	}
-
 }
 
@@ -492,110 +455,8 @@
 }
 
-function dragStartFunction(e, selectedShape) {
-	var newShape = e.overlay;
-	newShape.type = e.type;
-	if (selectedShape) {
-		var polyG = newShape.type === google.maps.drawing.OverlayType.POLYLINE;
-		var polyL = newShape.type === google.maps.drawing.OverlayType.POLYGON;
-
-		if (polyL || polyG) {
-			var latLngi = []
-			var lati,
-			lngi;
-			for (var i = 0; i < selectedShape.getPath().length; i++) {
-				lati = selectedShape.getPath().getAt(i).lat();
-				lngi = selectedShape.getPath().getAt(i).lng();
-				//console.log("Vertex number",i, "'s latitude is", lati, "and longitude is", lngi);
-				prevVertex = {
-					lat: lati,
-					lng: lngi
-				};
-				latLngi.push(prevVertex);
-			}
-			prevShape.push("dragStart", selectedShape.type, latLngi);
-		} else {
-			prevEdge = {
-				east: selectedShape.getBounds().ea.l,
-				north: selectedShape.getBounds().la.l,
-				south: selectedShape.getBounds().la.j,
-				west: selectedShape.getBounds().ea.j
-			}
-			prevShape.push("dragStart", selectedShape.type, prevEdge);
-		}
-
-		var lastItem = nextLog[nextLog.length - 1];
-		if (lastItem[0] !== "dragEnd") {
-			prevLog.push(nextLog[nextLog.length - 1]);
-		}
-
-		prevLog.push(prevShape);
-		prevShape = [];
-		nextLog = [];
-		chosen = selectedShape;
-		dragFired = true;
-	}
-}
-
-function dragEndFunction(e, newShape) {
-
-	var newShape = e.overlay;
-	newShape.type = e.type;
-	if (selectedShape) {
-		var polyG = newShape.type === google.maps.drawing.OverlayType.POLYLINE;
-		var polyL = newShape.type === google.maps.drawing.OverlayType.POLYGON;
-
-		if (polyL || polyG) {
-
-			var latLngi = []
-			var lati,
-			lngi;
-
-			for (var i = 0; i < selectedShape.getPath().length; i++) {
-				lati = selectedShape.getPath().getAt(i).lat();
-				lngi = selectedShape.getPath().getAt(i).lng();
-				nextVertex = {
-					lat: lati,
-					lng: lngi
-				};
-				latLngi.push(nextVertex);
-			}
-			nextShape.push("dragEnd", selectedShape.type, latLngi);
-		} else {
-
-			nextEdge.east = selectedShape.getBounds().ea.l;
-			nextEdge.north = selectedShape.getBounds().la.l;
-			nextEdge.south = selectedShape.getBounds().la.j;
-			nextEdge.west = selectedShape.getBounds().ea.j;
-
-			nextShape.push("dragEnd", selectedShape.type, nextEdge);
-		}
-	}
-	for (var i = 0; i < prevLog.length; i++) {
-		if (prevLog[i][0] == "dragEnd") {
-			const index = i;
-			prevLog.splice(index, 1);
-		}
-	}
-	nextLog.push(nextShape);
-	nextShape = [];
-	chosen = selectedShape;
-}
-
-function updateHistory(eventArray) {
-	var lastItem = nextLog[nextLog.length - 1];
-	if (nextLog.length > 0) {
-		prevLog.push(lastItem);
-	}
-	nextLog = [];
-	nextLog.push(eventArray);
-	eventArray = [];
-	dragFired = false;
-
-}
-
-function polygonGetPath() {
-	console.log(nextLog);
-	console.log(prevLog);
-
+function printHistory() {
+	
+	console.log(prevOverlays);
+	console.log(selectedShapes);
 }
 
