Index: /gs3-extensions/map-editor/DrawingManager/checkpt24/historyManager.js
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt24/historyManager.js	(revision 32722)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt24/historyManager.js	(revision 32722)
@@ -0,0 +1,237 @@
+var prevOverlays = [];
+
+function undo() {
+
+	for (var i = 0; i < overlays.length; i++) {
+		overlays[i].setMap(null);
+
+	}
+	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");
+		}
+		
+	}
+	
+	
+}
+
+function clonePath(path)
+{
+	var clone_path = [];
+	
+	for (var i = 0; i < path.length; i++) {
+		var lati = path.getAt(i).lat();
+		var lngi = path.getAt(i).lng();
+		clone_lat_lng = {
+			lat: lati,
+			lng: lngi
+		};
+		clone_path.push(clone_lat_lng);
+	}
+	
+	return clone_path;
+}
+
+function clonePolyline(polyline)
+{
+	var path          = polyline.getPath();
+	var geodesic      = polyline.geodesic;
+	var strokeColor   = polyline.strokeColor;
+	var strokeOpacity = polyline.strokeOpacity;
+	var strokeWeight  = polyline.strokeWeight;
+	var clone_path    = clonePath(path);
+	//var editable      = rect.editable;
+	
+	var clone_polyline = new google.maps.Polyline({
+		geodesic: geodesic,
+		strokeColor: strokeColor,
+		strokeOpacity: strokeOpacity,
+		strokeWeight: strokeWeight,
+		path: clone_path,
+		draggable: true,
+		editable: false
+	});
+	
+	clone_polyline.type = google.maps.drawing.OverlayType.POLYLINE;
+	
+	return clone_polyline;
+}
+
+function clonePolygon(polygon)
+{
+	var path          = polygon.getPath();
+	var geodesic      = polygon.geodesic;
+	var strokeColor   = polygon.strokeColor;
+	var strokeOpacity = polygon.strokeOpacity;
+	var strokeWeight  = polygon.strokeWeight;
+	var fillColor     = polygon.fillColor;
+	var fillOpacity   = polygon.fillOpacity;
+	var clone_path    = clonePath(path);
+	//var editable      = rect.editable;
+	
+	var clone_polygon = new google.maps.Polygon({
+		geodesic: geodesic,
+		strokeColor: strokeColor,
+		strokeOpacity: strokeOpacity,
+		strokeWeight: strokeWeight,
+		fillColor: fillColor,
+		fillOpacity: fillOpacity,
+		path: clone_path,
+		draggable: true,
+		editable: false
+	});
+	
+	clone_polygon.type = google.maps.drawing.OverlayType.POLYGON;
+	
+	return clone_polygon;
+}
+
+function cloneRectangle(rect)
+{
+	var strokeColor   = rect.strokeColor;
+	var strokeOpacity = rect.strokeOpacity;
+	var strokeWeight  = rect.strokeWeight;
+	var fillColor     = rect.fillColor;
+	var fillOpacity   = rect.fillOpacity;
+	var bounds        = rect.getBounds();
+	//var editable      = rect.editable;
+	
+	var clone_rect = new google.maps.Rectangle({
+		strokeColor: strokeColor,
+		strokeOpacity: strokeOpacity,
+		strokeWeight: strokeWeight,
+		fillColor: fillColor,
+		fillOpacity: fillOpacity,
+		bounds: bounds,
+		draggable: true,
+		editable: false
+	});
+	
+	clone_rect.type = google.maps.drawing.OverlayType.RECTANGLE;
+	
+	return clone_rect;
+}
+
+function cloneCircle(circ)
+{
+	var strokeColor   = circ.strokeColor;
+	var strokeOpacity = circ.strokeOpacity;
+	var strokeWeight  = circ.strokeWeight;
+	var fillColor     = circ.fillColor;
+	var fillOpacity   = circ.fillOpacity;
+	var center        = circ.center;
+	var radius        = circ.radius;
+	//var editable      = rect.editable;
+	
+	var clone_circ = new google.maps.Circle({
+		strokeColor: strokeColor,
+		strokeOpacity: strokeOpacity,
+		strokeWeight: strokeWeight,
+		fillColor: fillColor,
+		fillOpacity: fillOpacity,
+		center: center,
+		radius: radius,
+		draggable: true,
+		editable: false
+	});
+	
+	clone_circ.type = google.maps.drawing.OverlayType.CIRCLE;
+	
+	return clone_circ;
+}
+
+
+function cloneShape(shape)
+{
+	if (shape.type === google.maps.drawing.OverlayType.POLYLINE) {
+		var clone_polyline = clonePolyline(shape);
+		return clone_polyline;
+	}
+	else if (shape.type === google.maps.drawing.OverlayType.POLYGON) {
+		var clone_polygon = clonePolygon(shape);
+		return clone_polygon;
+	}
+	else if (shape.type === google.maps.drawing.OverlayType.RECTANGLE) {
+		var clone_rect = cloneRectangle(shape);
+		return clone_rect;
+	
+	}
+	else if (shape.type === google.maps.drawing.OverlayType.CIRCLE) {
+		var clone_circ = cloneCircle(shape);
+		return clone_circ;
+	
+	}
+	else {
+		console.error("Unrecognized shape: " + shape);
+		return null;
+	}
+	console.log(cloneShape);
+}
+
+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()
+{
+	var overlays_copy = [];
+	for (var i = 0; i<overlays.length; i++) {
+		var clone_shape = cloneShape(overlays[i]);
+		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;
+	}
+	
+	prevOverlays.push(overlays_copy); 
+}
+
+function presentOverlayPush()
+{	
+	presentOverlays = [];
+	var overlays_copy = [];
+	for (var i = 0; i<overlays.length; i++) {
+		var clone_shape = cloneShape(overlays[i]);
+		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;
+	}
+	
+	presentOverlays.push(overlays_copy); 
+	
+}
Index: /gs3-extensions/map-editor/DrawingManager/checkpt24/index.css
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt24/index.css	(revision 32722)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt24/index.css	(revision 32722)
@@ -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/checkpt24/index.html
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt24/index.html	(revision 32722)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt24/index.html	(revision 32722)
@@ -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="historyManager.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>
+	
+    <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="printHistory()" accesskey="q">Print History</button>
+	<button onclick="undo()" 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/checkpt24/index.js
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt24/index.js	(revision 32722)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt24/index.js	(revision 32722)
@@ -0,0 +1,494 @@
+var debug = false;
+var redoPressed = false;
+var undoPressed = 0;
+var shiftKeyPressed = false;
+var dragFired = false;
+var selectionPass = true;
+var chosen;
+var enableSelectionFeature = false;
+var beingDragged = false;
+var presentOverlays = [];
+
+
+var deselectedLog = []
+var selectedShapesLog = [];
+var prevShape = [];
+var nextShape = [];
+var prevLog = [];
+var nextLog = [];
+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);
+	}
+	
+	document.getElementById("thicknessRange").addEventListener("mousedown", shapeSpecsChangeMD);
+	document.getElementById("colourOpacity").addEventListener("mousedown", shapeSpecsChangeMD);
+	document.getElementById("color-palette1").addEventListener("mousedown", shapeSpecsChangeMD);
+	
+	document.getElementById("thicknessRange").addEventListener("mouseup", shapeSpecsChangeMU);
+	document.getElementById("colourOpacity").addEventListener("mouseup", shapeSpecsChangeMU);
+	document.getElementById("color-palette1").addEventListener("mouseup", shapeSpecsChangeMU);	
+});
+
+function shapeSpecsChangeMD() {
+	if (selectedShapes.length > 0) {
+		historyOverlayPush();
+
+	}
+}
+
+function shapeSpecsChangeMU() {
+	if (selectedShapes.length > 0) {
+		presentOverlayPush();
+	}		
+}
+
+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) {
+		
+		historyOverlayPush();
+				
+		overlays.push(e.overlay); // store reference to added overlay
+		var newShape = e.overlay;
+		newShape.type = e.type;
+		
+		//historyOverlayPush();
+		
+		if (e.type !== google.maps.drawing.OverlayType.MARKER) {
+			addShapeListeners(newShape,e);
+			setSelection(newShape, e);
+		} else {
+			
+			addMarkerListeners(newShape,e);
+			setSelection(newShape, e);
+		}
+	});
+
+	//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")
+				deselectedLog = [];
+				chosen = null;
+				selectedShape = 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') {
+			printHistory();
+		}
+		//					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();
+}
+
+	//Deletes a vertex if clicked on it
+	function vertexAndPolyDel(e, newShape) {
+		var vertex = e.vertex;
+		//console.log(e)
+		if (e.vertex !== undefined) {
+			historyOverlayPush();
+			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) {
+				console.log("lol");
+				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);
+			});
+
+			google.maps.event.addListener(newShape, 'dragstart', function (e) {
+				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 (e) {
+				//console.log(e);
+				
+				if (beingDragged == false){
+					resizeEntry = true;
+					presentOverlayPush();
+					resizeEntry = false;
+				}
+			});
+						
+			google.maps.event.addListener(newShape, 'resize', function () {
+				//historyOverlayPush();
+					
+			});
+
+			//Add an event listener to select a shape if the mouse hovers over it
+			google.maps.event.addListener(newShape, 'mousedown', function (e) {
+				//	console.log(e);
+				if (drawingManager.drawingMode == null) {
+					setSelection(newShape, e);
+				}
+			});
+}
+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;
+		}
+	}
+	
+//Set selection for the selected overlay
+	function setSelection(shape, e) {
+		if (shape.type !== 'marker') {
+			if (shiftKeyPressed == false) {
+				if (e.vertex == undefined) {	
+				//if ((shape.type != google.maps.drawing.OverlayType.POLYLINE) 
+					//&& (shape.type != google.maps.drawing.OverlayType.POLYGON)) {
+					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)
+				chosen = selectedShape;
+			}
+		}
+
+		//console.log(prevLog);
+		selectedShapesLog = [];
+	}
+		
+//Set selected thickness
+function setSelectedThickness(sWeight) {
+	if (selectedShapes.length > 0) {
+		//historyOverlayPush();
+		for (var i = 0; i < selectedShapes.length; i++) {
+			selectedShapes[i].set('strokeWeight', sWeight);
+			//console.log(selectedShapes.length);
+		}
+	}
+}
+
+//Set selected opacity
+function setSelectedOpacity(fOpacity) {
+
+	if (selectedShapes.length > 0) {
+		for (var i = 0; i < selectedShapes.length; i++) {
+			selectedShapes[i].set('fillOpacity', fOpacity);
+		}
+	}
+}
+
+//set selected fill colour
+function setSelectedShapeColor(color) {
+	if (selectedShapes.length >	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 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 printHistory() {
+	
+	console.log(prevOverlays);
+	console.log(presentOverlays);
+	//console.log(selectedShapes);
+	//console.log(overlays);
+}
+
+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 = [];
+}
+
Index: /gs3-extensions/map-editor/DrawingManager/checkpt24/notes.txt
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt24/notes.txt	(revision 32722)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt24/notes.txt	(revision 32722)
@@ -0,0 +1,22 @@
+All shapes = !==undefined
+White Vertices = >=0  = !==undefined
+
+Dark Vertices = undefined
+
+ClearSelection (CS): 
+1- Freezes vertices 
+2- Deselects Shape
+
+
+
+
+Prevents passage TO CS, give pass to dark vertices
+if (e.vertex !== undefined){
+clearSelection();
+
+Grants passage to CS, move white freeze dark
+if (e.vertex == undefined){
+clearSelection();
+
+
+issues: an event is being registered twice
Index: /gs3-extensions/map-editor/DrawingManager/checkpt25/historyManager.js
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt25/historyManager.js	(revision 32722)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt25/historyManager.js	(revision 32722)
@@ -0,0 +1,273 @@
+var prevOverlays = [];
+var presentOverlays = [];
+var undoneOverlays = [];
+
+function undo() {
+	
+	for (var i = 0; i < overlays.length; i++) {
+		overlays[i].setMap(null);
+
+	}
+	if (prevOverlays.length != 0) {
+		selectedShapes = [];
+		overlays = [];
+		undoneOverlaysPush();
+		var prev_overlay = prevOverlays.pop();
+		
+		if(prev_overlay.length > 0) {
+			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");
+		}
+
+	}
+}
+
+function redo() {
+	
+	if (undoneOverlays.length != 0) {
+		selectedShapes = [];
+		for (var i = 0; i < overlays.length; i++) {
+			overlays[i].setMap(null);
+		}
+		overlays = [];
+		var lastEntry = undoneOverlays[undoneOverlays.length - 1];
+		for (var i = 0; i < lastEntry.length; i++) {
+			overlays[i] = lastEntry[i];
+			overlays[i].setMap(map);
+		}
+		var conditionPrevious = presentOverlays[presentOverlays.length - 1] !== undefined && presentOverlays[presentOverlays.length - 1].length !== 0 && presentOverlays.length !== 0;
+		
+		if (conditionPrevious){
+			prevOverlays.push(presentOverlays[0]);
+		}
+		
+		presentOverlays = [];
+		//console.log("last undone", undoneOverlays[undoneOverlays.length -1]);
+		presentOverlays.push(undoneOverlays[undoneOverlays.length - 1]);
+		undoneOverlays.pop();
+
+	}
+
+}
+
+function clonePath(path) {
+	var clone_path = [];
+
+	for (var i = 0; i < path.length; i++) {
+		var lati = path.getAt(i).lat();
+		var lngi = path.getAt(i).lng();
+		clone_lat_lng = {
+			lat: lati,
+			lng: lngi
+		};
+		clone_path.push(clone_lat_lng);
+	}
+
+	return clone_path;
+}
+
+function clonePolyline(polyline) {
+	var path = polyline.getPath();
+	var geodesic = polyline.geodesic;
+	var strokeColor = polyline.strokeColor;
+	var strokeOpacity = polyline.strokeOpacity;
+	var strokeWeight = polyline.strokeWeight;
+	var clone_path = clonePath(path);
+	//var editable      = rect.editable;
+
+	var clone_polyline = new google.maps.Polyline({
+			geodesic: geodesic,
+			strokeColor: strokeColor,
+			strokeOpacity: strokeOpacity,
+			strokeWeight: strokeWeight,
+			path: clone_path,
+			draggable: true,
+			editable: false
+		});
+
+	clone_polyline.type = google.maps.drawing.OverlayType.POLYLINE;
+
+	return clone_polyline;
+}
+
+function clonePolygon(polygon) {
+	var path = polygon.getPath();
+	var geodesic = polygon.geodesic;
+	var strokeColor = polygon.strokeColor;
+	var strokeOpacity = polygon.strokeOpacity;
+	var strokeWeight = polygon.strokeWeight;
+	var fillColor = polygon.fillColor;
+	var fillOpacity = polygon.fillOpacity;
+	var clone_path = clonePath(path);
+	//var editable      = rect.editable;
+
+	var clone_polygon = new google.maps.Polygon({
+			geodesic: geodesic,
+			strokeColor: strokeColor,
+			strokeOpacity: strokeOpacity,
+			strokeWeight: strokeWeight,
+			fillColor: fillColor,
+			fillOpacity: fillOpacity,
+			path: clone_path,
+			draggable: true,
+			editable: false
+		});
+
+	clone_polygon.type = google.maps.drawing.OverlayType.POLYGON;
+
+	return clone_polygon;
+}
+
+function cloneRectangle(rect) {
+	var strokeColor = rect.strokeColor;
+	var strokeOpacity = rect.strokeOpacity;
+	var strokeWeight = rect.strokeWeight;
+	var fillColor = rect.fillColor;
+	var fillOpacity = rect.fillOpacity;
+	var bounds = rect.getBounds();
+	//var editable      = rect.editable;
+
+	var clone_rect = new google.maps.Rectangle({
+			strokeColor: strokeColor,
+			strokeOpacity: strokeOpacity,
+			strokeWeight: strokeWeight,
+			fillColor: fillColor,
+			fillOpacity: fillOpacity,
+			bounds: bounds,
+			draggable: true,
+			editable: false
+		});
+
+	clone_rect.type = google.maps.drawing.OverlayType.RECTANGLE;
+
+	return clone_rect;
+}
+
+function cloneCircle(circ) {
+	var strokeColor = circ.strokeColor;
+	var strokeOpacity = circ.strokeOpacity;
+	var strokeWeight = circ.strokeWeight;
+	var fillColor = circ.fillColor;
+	var fillOpacity = circ.fillOpacity;
+	var center = circ.center;
+	var radius = circ.radius;
+	//var editable      = rect.editable;
+
+	var clone_circ = new google.maps.Circle({
+			strokeColor: strokeColor,
+			strokeOpacity: strokeOpacity,
+			strokeWeight: strokeWeight,
+			fillColor: fillColor,
+			fillOpacity: fillOpacity,
+			center: center,
+			radius: radius,
+			draggable: true,
+			editable: false
+		});
+
+	clone_circ.type = google.maps.drawing.OverlayType.CIRCLE;
+
+	return clone_circ;
+}
+
+function cloneShape(shape) {
+	if (shape.type === google.maps.drawing.OverlayType.POLYLINE) {
+		var clone_polyline = clonePolyline(shape);
+		return clone_polyline;
+	} else if (shape.type === google.maps.drawing.OverlayType.POLYGON) {
+		var clone_polygon = clonePolygon(shape);
+		return clone_polygon;
+	} else if (shape.type === google.maps.drawing.OverlayType.RECTANGLE) {
+		var clone_rect = cloneRectangle(shape);
+		return clone_rect;
+
+	} else if (shape.type === google.maps.drawing.OverlayType.CIRCLE) {
+		var clone_circ = cloneCircle(shape);
+		return clone_circ;
+
+	} else {
+		console.error("Unrecognized shape: " + shape);
+		return null;
+	}
+	console.log(cloneShape);
+}
+
+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() {
+	undoneOverlays = [];
+	var overlays_copy = [];
+	for (var i = 0; i < overlays.length; i++) {
+		var clone_shape = cloneShape(overlays[i]);
+		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;
+	}
+
+	prevOverlays.push(overlays_copy);
+
+}
+
+function presentOverlayPush() {
+	if (resizeEntry) {
+		prevOverlays.push(presentOverlays[0]);
+	}
+	presentOverlays = [];
+	var overlays_copy = [];
+	for (var i = 0; i < overlays.length; i++) {
+		var clone_shape = cloneShape(overlays[i]);
+		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;
+	}
+	presentOverlays.push(overlays_copy);
+}
+
+function undoneOverlaysPush() {
+	var conditionUndone = presentOverlays[presentOverlays.length - 1] !== undefined && presentOverlays[presentOverlays.length - 1].length !== 0 && presentOverlays.length !== 0;
+
+	if (conditionUndone) {
+		undoneOverlays.push(presentOverlays[0]);
+	}
+	presentOverlays = [];
+	var conditionPresent = prevOverlays[prevOverlays.length - 1] !== undefined && prevOverlays[prevOverlays.length - 1].length !== 0 && prevOverlays.length !== 0;
+
+	if (conditionPresent) {
+		presentOverlays.push(prevOverlays[prevOverlays.length - 1]);
+
+	}
+	//prevOverlays.pop();
+
+}
Index: /gs3-extensions/map-editor/DrawingManager/checkpt25/index.css
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt25/index.css	(revision 32722)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt25/index.css	(revision 32722)
@@ -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/checkpt25/index.html
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt25/index.html	(revision 32722)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt25/index.html	(revision 32722)
@@ -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="historyManager.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>
+	
+    <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="printHistory()" accesskey="q">Print History</button>
+	<button onclick="undo()" accesskey="n">Undo</button>
+	<button onclick="redo()" 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/checkpt25/index.js
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt25/index.js	(revision 32722)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt25/index.js	(revision 32722)
@@ -0,0 +1,503 @@
+var debug = false;
+var redoPressed = false;
+var undoPressed = 0;
+var shiftKeyPressed = false;
+var dragFired = false;
+var selectionPass = true;
+var chosen;
+var enableSelectionFeature = false;
+var beingDragged = false;
+var resizeEntry = false;
+
+var deselectedLog = []
+var selectedShapesLog = [];
+var prevShape = [];
+var nextShape = [];
+var prevLog = [];
+var nextLog = [];
+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);
+	}
+	
+	document.getElementById("thicknessRange").addEventListener("mousedown", shapeSpecsChangeMD);
+	document.getElementById("colourOpacity").addEventListener("mousedown", shapeSpecsChangeMD);
+	document.getElementById("color-palette1").addEventListener("mousedown", shapeSpecsChangeMD);
+	
+	document.getElementById("thicknessRange").addEventListener("mouseup", shapeSpecsChangeMU);
+	document.getElementById("colourOpacity").addEventListener("mouseup", shapeSpecsChangeMU);
+	//document.getElementById("color-palette1").addEventListener("mouseup", shapeSpecsChangeMU);	
+});
+
+function shapeSpecsChangeMD() {
+	if (selectedShapes.length > 0) {
+		historyOverlayPush();
+
+	}
+}
+
+function shapeSpecsChangeMU() {
+	if (selectedShapes.length > 0) {
+		presentOverlayPush();
+	}		
+}
+
+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);
+		shapeSpecsChangeMU();
+	});
+	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) {
+		
+		historyOverlayPush();
+				
+		overlays.push(e.overlay); // store reference to added overlay
+		var newShape = e.overlay;
+		newShape.type = e.type;
+		
+		presentOverlayPush();
+		
+		if (e.type !== google.maps.drawing.OverlayType.MARKER) {
+			addShapeListeners(newShape,e);
+			setSelection(newShape, e);
+		} else {
+			
+			addMarkerListeners(newShape,e);
+			setSelection(newShape, e);
+		}
+	});
+
+	//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")
+				deselectedLog = [];
+				chosen = null;
+				selectedShape = 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') {
+			printHistory();
+		}
+		//					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();
+}
+
+	//Deletes a vertex if clicked on it
+	function vertexAndPolyDel(e, newShape) {
+		var vertex = e.vertex;
+		//console.log(e)
+		if (e.vertex !== undefined) {
+			historyOverlayPush();
+			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) {
+				console.log("lol");
+				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);
+			});
+
+			google.maps.event.addListener(newShape, 'dragstart', function (e) {
+				beingDragged = true;
+				historyOverlayPush();
+
+			});
+			
+			google.maps.event.addListener(newShape, 'dragend', function () {
+				beingDragged = false;
+				presentOverlayPush();
+			});
+			
+			//Store information after the event ends
+			google.maps.event.addListener(newShape, 'bounds_changed', function (e) {
+				//console.log(e);
+				
+				if (beingDragged == false){
+					resizeEntry = true;
+					presentOverlayPush();
+					resizeEntry = false;
+				}
+			});
+						
+			google.maps.event.addListener(newShape, 'resize', function () {
+				//historyOverlayPush();
+					
+			});
+
+			//Add an event listener to select a shape if the mouse hovers over it
+			google.maps.event.addListener(newShape, 'mousedown', function (e) {
+				//	console.log(e);
+				if (drawingManager.drawingMode == null) {
+					setSelection(newShape, e);
+				}
+			});
+}
+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;
+		}
+	}
+	
+//Set selection for the selected overlay
+	function setSelection(shape, e) {
+		if (shape.type !== 'marker') {
+			if (shiftKeyPressed == false) {
+				if (e.vertex == undefined) {	
+				//if ((shape.type != google.maps.drawing.OverlayType.POLYLINE) 
+					//&& (shape.type != google.maps.drawing.OverlayType.POLYGON)) {
+					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)
+				chosen = selectedShape;
+			}
+		}
+
+		//console.log(prevLog);
+		selectedShapesLog = [];
+	}
+		
+//Set selected thickness
+function setSelectedThickness(sWeight) {
+	if (selectedShapes.length > 0) {
+		//historyOverlayPush();
+		for (var i = 0; i < selectedShapes.length; i++) {
+			selectedShapes[i].set('strokeWeight', sWeight);
+			//console.log(selectedShapes.length);
+		}
+	}
+}
+
+//Set selected opacity
+function setSelectedOpacity(fOpacity) {
+
+	if (selectedShapes.length > 0) {
+		for (var i = 0; i < selectedShapes.length; i++) {
+			selectedShapes[i].set('fillOpacity', fOpacity);
+		}
+	}
+}
+
+//set selected fill colour
+function setSelectedShapeColor(color) {
+	if (selectedShapes.length >	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 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 printHistory() {
+	
+	console.log("prev", prevOverlays);
+	console.log("present ", presentOverlays);
+	console.log("undone ", undoneOverlays);
+
+	
+	//for(var i = 0; i< prevOverlays.length; i++) {
+	//	console.log("prev", prevOverlays[prevOverlays.length -1][0].strokeColor);
+	//}
+	//console.log("present ", presentOverlays[0][0].strokeColor);	
+}
+
+function deleteSelectedShape() {
+	historyOverlayPush();
+	for (var i = 0; i < selectedShapes.length; i++) {
+		selectedShapes[i].setMap(null);
+	}
+	selectedShapes = [];
+	presentOverlayPush();
+}
+
+function deleteAllShape() {
+	historyOverlayPush();
+	for (var i = 0; i < overlays.length; i++) {
+		overlays[i].setMap(null);
+
+	}
+	overlays = [];
+	presentOverlayPush();
+}
+
Index: /gs3-extensions/map-editor/DrawingManager/checkpt25/notes.txt
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/checkpt25/notes.txt	(revision 32722)
+++ /gs3-extensions/map-editor/DrawingManager/checkpt25/notes.txt	(revision 32722)
@@ -0,0 +1,22 @@
+All shapes = !==undefined
+White Vertices = >=0  = !==undefined
+
+Dark Vertices = undefined
+
+ClearSelection (CS): 
+1- Freezes vertices 
+2- Deselects Shape
+
+
+
+
+Prevents passage TO CS, give pass to dark vertices
+if (e.vertex !== undefined){
+clearSelection();
+
+Grants passage to CS, move white freeze dark
+if (e.vertex == undefined){
+clearSelection();
+
+
+issues: an event is being registered twice
Index: /gs3-extensions/map-editor/DrawingManager/historyManager.js
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/historyManager.js	(revision 32721)
+++ /gs3-extensions/map-editor/DrawingManager/historyManager.js	(revision 32722)
@@ -1,43 +1,74 @@
 var prevOverlays = [];
+var presentOverlays = [];
+var undoneOverlays = [];
 
 function undo() {
-
+	
 	for (var i = 0; i < overlays.length; i++) {
 		overlays[i].setMap(null);
 
 	}
-	if (prevOverlays.length != 0){
+	if (prevOverlays.length != 0) {
+		selectedShapes = [];
 		overlays = [];
-		console.log(prevOverlays);
+		undoneOverlaysPush();
 		var prev_overlay = prevOverlays.pop();
 		
-		for (var i = 0; i < prev_overlay.length; i++) {
+		if(prev_overlay.length > 0) {
+			for (var i = 0; i < prev_overlay.length; i++) {
 			overlays[i] = prev_overlay[i];
 			overlays[i].setMap(map);
-		}
-		
-	}
-	
+			}
+		}
+		
+
+	}
+
 	//Deactivated at the moment
-	if(enableSelectionFeature){
+	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++){
+		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");
 		}
-		
-	}
+
+	}
+}
+
+function redo() {
 	
-	
-}
-
-function clonePath(path)
-{
+	if (undoneOverlays.length != 0) {
+		selectedShapes = [];
+		for (var i = 0; i < overlays.length; i++) {
+			overlays[i].setMap(null);
+		}
+		overlays = [];
+		var lastEntry = undoneOverlays[undoneOverlays.length - 1];
+		for (var i = 0; i < lastEntry.length; i++) {
+			overlays[i] = lastEntry[i];
+			overlays[i].setMap(map);
+		}
+		var conditionPrevious = presentOverlays[presentOverlays.length - 1] !== undefined && presentOverlays[presentOverlays.length - 1].length !== 0 && presentOverlays.length !== 0;
+		
+		if (conditionPrevious){
+			prevOverlays.push(presentOverlays[0]);
+		}
+		
+		presentOverlays = [];
+		//console.log("last undone", undoneOverlays[undoneOverlays.length -1]);
+		presentOverlays.push(undoneOverlays[undoneOverlays.length - 1]);
+		undoneOverlays.pop();
+
+	}
+
+}
+
+function clonePath(path) {
 	var clone_path = [];
-	
+
 	for (var i = 0; i < path.length; i++) {
 		var lati = path.getAt(i).lat();
@@ -49,170 +80,194 @@
 		clone_path.push(clone_lat_lng);
 	}
-	
+
 	return clone_path;
 }
 
-function clonePolyline(polyline)
-{
-	var path          = polyline.getPath();
-	var geodesic      = polyline.geodesic;
-	var strokeColor   = polyline.strokeColor;
+function clonePolyline(polyline) {
+	var path = polyline.getPath();
+	var geodesic = polyline.geodesic;
+	var strokeColor = polyline.strokeColor;
 	var strokeOpacity = polyline.strokeOpacity;
-	var strokeWeight  = polyline.strokeWeight;
-	var clone_path    = clonePath(path);
-	//var editable      = rect.editable;
-	
+	var strokeWeight = polyline.strokeWeight;
+	var clone_path = clonePath(path);
+	//var editable      = rect.editable;
+
 	var clone_polyline = new google.maps.Polyline({
-		geodesic: geodesic,
-		strokeColor: strokeColor,
-		strokeOpacity: strokeOpacity,
-		strokeWeight: strokeWeight,
-		path: clone_path,
-		draggable: true,
-		editable: false
-	});
-	
+			geodesic: geodesic,
+			strokeColor: strokeColor,
+			strokeOpacity: strokeOpacity,
+			strokeWeight: strokeWeight,
+			path: clone_path,
+			draggable: true,
+			editable: false
+		});
+
 	clone_polyline.type = google.maps.drawing.OverlayType.POLYLINE;
-	
+
 	return clone_polyline;
 }
 
-function clonePolygon(polygon)
-{
-	var path          = polygon.getPath();
-	var geodesic      = polygon.geodesic;
-	var strokeColor   = polygon.strokeColor;
+function clonePolygon(polygon) {
+	var path = polygon.getPath();
+	var geodesic = polygon.geodesic;
+	var strokeColor = polygon.strokeColor;
 	var strokeOpacity = polygon.strokeOpacity;
-	var strokeWeight  = polygon.strokeWeight;
-	var fillColor     = polygon.fillColor;
-	var fillOpacity   = polygon.fillOpacity;
-	var clone_path    = clonePath(path);
-	//var editable      = rect.editable;
-	
+	var strokeWeight = polygon.strokeWeight;
+	var fillColor = polygon.fillColor;
+	var fillOpacity = polygon.fillOpacity;
+	var clone_path = clonePath(path);
+	//var editable      = rect.editable;
+
 	var clone_polygon = new google.maps.Polygon({
-		geodesic: geodesic,
-		strokeColor: strokeColor,
-		strokeOpacity: strokeOpacity,
-		strokeWeight: strokeWeight,
-		fillColor: fillColor,
-		fillOpacity: fillOpacity,
-		path: clone_path,
-		draggable: true,
-		editable: false
-	});
-	
+			geodesic: geodesic,
+			strokeColor: strokeColor,
+			strokeOpacity: strokeOpacity,
+			strokeWeight: strokeWeight,
+			fillColor: fillColor,
+			fillOpacity: fillOpacity,
+			path: clone_path,
+			draggable: true,
+			editable: false
+		});
+
 	clone_polygon.type = google.maps.drawing.OverlayType.POLYGON;
-	
+
 	return clone_polygon;
 }
 
-function cloneRectangle(rect)
-{
-	var strokeColor   = rect.strokeColor;
+function cloneRectangle(rect) {
+	var strokeColor = rect.strokeColor;
 	var strokeOpacity = rect.strokeOpacity;
-	var strokeWeight  = rect.strokeWeight;
-	var fillColor     = rect.fillColor;
-	var fillOpacity   = rect.fillOpacity;
-	var bounds        = rect.getBounds();
-	//var editable      = rect.editable;
-	
+	var strokeWeight = rect.strokeWeight;
+	var fillColor = rect.fillColor;
+	var fillOpacity = rect.fillOpacity;
+	var bounds = rect.getBounds();
+	//var editable      = rect.editable;
+
 	var clone_rect = new google.maps.Rectangle({
-		strokeColor: strokeColor,
-		strokeOpacity: strokeOpacity,
-		strokeWeight: strokeWeight,
-		fillColor: fillColor,
-		fillOpacity: fillOpacity,
-		bounds: bounds,
-		draggable: true,
-		editable: false
-	});
-	
+			strokeColor: strokeColor,
+			strokeOpacity: strokeOpacity,
+			strokeWeight: strokeWeight,
+			fillColor: fillColor,
+			fillOpacity: fillOpacity,
+			bounds: bounds,
+			draggable: true,
+			editable: false
+		});
+
 	clone_rect.type = google.maps.drawing.OverlayType.RECTANGLE;
-	
+
 	return clone_rect;
 }
 
-function cloneCircle(circ)
-{
-	var strokeColor   = circ.strokeColor;
+function cloneCircle(circ) {
+	var strokeColor = circ.strokeColor;
 	var strokeOpacity = circ.strokeOpacity;
-	var strokeWeight  = circ.strokeWeight;
-	var fillColor     = circ.fillColor;
-	var fillOpacity   = circ.fillOpacity;
-	var center        = circ.center;
-	var radius        = circ.radius;
-	//var editable      = rect.editable;
-	
+	var strokeWeight = circ.strokeWeight;
+	var fillColor = circ.fillColor;
+	var fillOpacity = circ.fillOpacity;
+	var center = circ.center;
+	var radius = circ.radius;
+	//var editable      = rect.editable;
+
 	var clone_circ = new google.maps.Circle({
-		strokeColor: strokeColor,
-		strokeOpacity: strokeOpacity,
-		strokeWeight: strokeWeight,
-		fillColor: fillColor,
-		fillOpacity: fillOpacity,
-		center: center,
-		radius: radius,
-		draggable: true,
-		editable: false
-	});
-	
+			strokeColor: strokeColor,
+			strokeOpacity: strokeOpacity,
+			strokeWeight: strokeWeight,
+			fillColor: fillColor,
+			fillOpacity: fillOpacity,
+			center: center,
+			radius: radius,
+			draggable: true,
+			editable: false
+		});
+
 	clone_circ.type = google.maps.drawing.OverlayType.CIRCLE;
-	
+
 	return clone_circ;
 }
 
-
-function cloneShape(shape)
-{
+function cloneShape(shape) {
 	if (shape.type === google.maps.drawing.OverlayType.POLYLINE) {
 		var clone_polyline = clonePolyline(shape);
 		return clone_polyline;
-	}
-	else if (shape.type === google.maps.drawing.OverlayType.POLYGON) {
+	} else if (shape.type === google.maps.drawing.OverlayType.POLYGON) {
 		var clone_polygon = clonePolygon(shape);
 		return clone_polygon;
-	}
-	else if (shape.type === google.maps.drawing.OverlayType.RECTANGLE) {
+	} else if (shape.type === google.maps.drawing.OverlayType.RECTANGLE) {
 		var clone_rect = cloneRectangle(shape);
 		return clone_rect;
-	
-	}
-	else if (shape.type === google.maps.drawing.OverlayType.CIRCLE) {
+
+	} else if (shape.type === google.maps.drawing.OverlayType.CIRCLE) {
 		var clone_circ = cloneCircle(shape);
 		return clone_circ;
-	
-	}
-	else {
+
+	} else {
 		console.error("Unrecognized shape: " + shape);
 		return null;
 	}
-}
-
-function overlayItemIsShape(overlay_item)
-{
+	console.log(cloneShape);
+}
+
+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("comes here");
+
+	return is_shape;
+}
+
+function historyOverlayPush() {
+	undoneOverlays = [];
 	var overlays_copy = [];
-	for (var i = 0; i<overlays.length; i++) {
+	for (var i = 0; i < overlays.length; i++) {
 		var clone_shape = cloneShape(overlays[i]);
 		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!
+			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;
 	}
-	
-	prevOverlays.push(overlays_copy); 
-}
+
+	prevOverlays.push(overlays_copy);
+
+}
+
+function presentOverlayPush() {
+	if (resizeEntry) {
+		prevOverlays.push(presentOverlays[0]);
+	}
+	presentOverlays = [];
+	var overlays_copy = [];
+	for (var i = 0; i < overlays.length; i++) {
+		var clone_shape = cloneShape(overlays[i]);
+		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;
+	}
+	presentOverlays.push(overlays_copy);
+}
+
+function undoneOverlaysPush() {
+	var conditionUndone = presentOverlays[presentOverlays.length - 1] !== undefined && presentOverlays[presentOverlays.length - 1].length !== 0 && presentOverlays.length !== 0;
+
+	if (conditionUndone) {
+		undoneOverlays.push(presentOverlays[0]);
+	}
+	presentOverlays = [];
+	var conditionPresent = prevOverlays[prevOverlays.length - 1] !== undefined && prevOverlays[prevOverlays.length - 1].length !== 0 && prevOverlays.length !== 0;
+
+	if (conditionPresent) {
+		presentOverlays.push(prevOverlays[prevOverlays.length - 1]);
+
+	}
+	//prevOverlays.pop();
+
+}
Index: /gs3-extensions/map-editor/DrawingManager/index.html
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/index.html	(revision 32721)
+++ /gs3-extensions/map-editor/DrawingManager/index.html	(revision 32722)
@@ -20,5 +20,5 @@
 	<button onclick="printHistory()" accesskey="q">Print History</button>
 	<button onclick="undo()" accesskey="n">Undo</button>
-	<button onclick="redoMovement()" accesskey="n">Redo</button>
+	<button onclick="redo()" accesskey="n">Redo</button>
 	
 	</div>
Index: /gs3-extensions/map-editor/DrawingManager/index.js
===================================================================
--- /gs3-extensions/map-editor/DrawingManager/index.js	(revision 32721)
+++ /gs3-extensions/map-editor/DrawingManager/index.js	(revision 32722)
@@ -8,5 +8,5 @@
 var enableSelectionFeature = false;
 var beingDragged = false;
-
+var resizeEntry = false;
 
 var deselectedLog = []
@@ -65,14 +65,24 @@
 	}
 	
-	document.getElementById("thicknessRange").addEventListener("mousedown", shapeSpecsChange);
-	document.getElementById("colourOpacity").addEventListener("mousedown", shapeSpecsChange);
-	document.getElementById("color-palette1").addEventListener("mousedown", shapeSpecsChange);
+	document.getElementById("thicknessRange").addEventListener("mousedown", shapeSpecsChangeMD);
+	document.getElementById("colourOpacity").addEventListener("mousedown", shapeSpecsChangeMD);
+	document.getElementById("color-palette1").addEventListener("mousedown", shapeSpecsChangeMD);
+	
+	document.getElementById("thicknessRange").addEventListener("mouseup", shapeSpecsChangeMU);
+	document.getElementById("colourOpacity").addEventListener("mouseup", shapeSpecsChangeMU);
+	//document.getElementById("color-palette1").addEventListener("mouseup", shapeSpecsChangeMU);	
 });
 
-function shapeSpecsChange() {
+function shapeSpecsChangeMD() {
 	if (selectedShapes.length > 0) {
 		historyOverlayPush();
 
 	}
+}
+
+function shapeSpecsChangeMU() {
+	if (selectedShapes.length > 0) {
+		presentOverlayPush();
+	}		
 }
 
@@ -84,4 +94,5 @@
 		selectColor(color);
 		setSelectedShapeColor(color);
+		shapeSpecsChangeMU();
 	});
 	return button;
@@ -156,6 +167,4 @@
 	google.maps.event.addListener(drawingManager, 'overlaycomplete', function (e) {
 		
-		console.log(e)
-		
 		historyOverlayPush();
 				
@@ -164,5 +173,5 @@
 		newShape.type = e.type;
 		
-		//historyOverlayPush();
+		presentOverlayPush();
 		
 		if (e.type !== google.maps.drawing.OverlayType.MARKER) {
@@ -235,6 +244,7 @@
 	function vertexAndPolyDel(e, newShape) {
 		var vertex = e.vertex;
-
+		//console.log(e)
 		if (e.vertex !== undefined) {
+			historyOverlayPush();
 			if (newShape.type === google.maps.drawing.OverlayType.POLYGON) {
 				var path = newShape.getPaths().getAt(e.path);
@@ -258,4 +268,5 @@
 	//cLICK EVENT IF A MARKER IS CREATED
 			google.maps.event.addListener(newShape, 'click', function (e) {
+				console.log("lol");
 				setSelection(newShape, e);
 			});
@@ -270,26 +281,29 @@
 			google.maps.event.addListener(newShape, 'click', function (e) {
 				vertexAndPolyDel(e, newShape);
-				console.log(e.edge);
-			});
-
-			google.maps.event.addListener(newShape, 'dragstart', function () {
+			});
+
+			google.maps.event.addListener(newShape, 'dragstart', function (e) {
 				beingDragged = true;
 				historyOverlayPush();
+
 			});
 			
 			google.maps.event.addListener(newShape, 'dragend', function () {
 				beingDragged = false;
+				presentOverlayPush();
 			});
 			
 			//Store information after the event ends
-			google.maps.event.addListener(newShape, 'bounds_changed', function () {
-				console.log("bounds_changed");
+			google.maps.event.addListener(newShape, 'bounds_changed', function (e) {
+				//console.log(e);
+				
 				if (beingDragged == false){
-					historyOverlayPush();
+					resizeEntry = true;
+					presentOverlayPush();
+					resizeEntry = false;
 				}
 			});
 						
 			google.maps.event.addListener(newShape, 'resize', function () {
-				console.log("lmao");
 				//historyOverlayPush();
 					
@@ -298,4 +312,5 @@
 			//Add an event listener to select a shape if the mouse hovers over it
 			google.maps.event.addListener(newShape, 'mousedown', function (e) {
+				//	console.log(e);
 				if (drawingManager.drawingMode == null) {
 					setSelection(newShape, e);
@@ -457,16 +472,26 @@
 function printHistory() {
 	
-	console.log(prevOverlays);
-	console.log(selectedShapes);
+	console.log("prev", prevOverlays);
+	console.log("present ", presentOverlays);
+	console.log("undone ", undoneOverlays);
+
+	
+	//for(var i = 0; i< prevOverlays.length; i++) {
+	//	console.log("prev", prevOverlays[prevOverlays.length -1][0].strokeColor);
+	//}
+	//console.log("present ", presentOverlays[0][0].strokeColor);	
 }
 
 function deleteSelectedShape() {
+	historyOverlayPush();
 	for (var i = 0; i < selectedShapes.length; i++) {
 		selectedShapes[i].setMap(null);
 	}
 	selectedShapes = [];
+	presentOverlayPush();
 }
 
 function deleteAllShape() {
+	historyOverlayPush();
 	for (var i = 0; i < overlays.length; i++) {
 		overlays[i].setMap(null);
@@ -474,4 +499,5 @@
 	}
 	overlays = [];
-}
-
+	presentOverlayPush();
+}
+
