Index: main/trunk/greenstone3/web/interfaces/default/js/documentedit_scripts.js
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/js/documentedit_scripts.js	(revision 32769)
+++ main/trunk/greenstone3/web/interfaces/default/js/documentedit_scripts.js	(revision 32770)
@@ -37,5 +37,5 @@
 var multiValuedMetadata = new Array(); // eg ["xx.Person", "xx.Location"];
 var mvm_delimiter = ";";
-
+var mapsIdsArray = []; //An array for the IDs of all the maps created
 /************************
 * METADATA EDIT SCRIPTS *
@@ -47,9 +47,9 @@
 	var id = cell.attr("id").substring(6);
 	var metaTable = gs.jqGet("meta" + id);
-	var row = cell.parent();
+	var row = cell.parent();	
 	var newCell = $("<td>", {"style": "font-size:0.7em; padding:0px 10px", "class": "editMetadataButton"});
 	var linkSpan = $("<span>", {"class": "ui-state-default ui-corner-all", "style": "padding: 2px; float:left;"});
 	
-        var linkLabel = $("<span>"+gs.text.de.edit_metadata+"</span>");
+    var linkLabel = $("<span>"+gs.text.de.edit_metadata+"</span>");		
  	var linkIcon = $("<span>", {"class": "ui-icon ui-icon-folder-collapsed"});
 	newCell.linkIcon = linkIcon;
@@ -68,4 +68,5 @@
 	newLink.click(function()
 	{
+		console.log(metaTable.metaNameField);
 		if(metaTable.css("display") == "none")
 		{
@@ -76,10 +77,10 @@
 		    metaTable.addRowButton.css("display", "inline");
 		    if (enable_add_all_metadata_button == true) {
-			metaTable.addAllButton.css("display", "inline");
+			    metaTable.addAllButton.css("display", "inline");
 		    }
 		}
 		else
 		{
-		    linkLabel.html(gs.text.de.edit_metadata);
+		    linkLabel.html(gs.text.de.edit_metadata);			
 			linkIcon.attr("class", "ui-icon ui-icon-folder-collapsed");
 			metaTable.css("display", "none");
@@ -87,5 +88,5 @@
 		    metaTable.addRowButton.css("display", "none");
 		    if (enable_add_all_metadata_button == true) {
-			metaTable.addAllButton.css("display", "none");
+			    metaTable.addAllButton.css("display", "none");
 		    }
 		}
@@ -105,4 +106,92 @@
 }
 
+
+function addEditMapGPSLink(cell)
+{
+	cell = $(cell);
+	var id = cell.attr("id").substring(6);
+	//console.log(id);
+	var mapGPScontainer = gs.jqGet("map-and-controls-" + id);
+	console.log(mapGPScontainer);
+	var row = cell.parent();
+	var newCell = $("<td>", {"style": "font-size:0.7em; padding:0px 10px", "class": "editMapGPSButton"});
+	var linkSpan = $("<span>", {"class": "ui-state-default ui-corner-all", "style": "padding: 2px; float:left;"});
+	
+    var linkLabel = $("<span>"+gs.text.de.edit_map_gps+"</span>");		
+ 	var linkIcon = $("<span>", {"class": "ui-icon ui-icon-folder-collapsed"});
+	newCell.linkIcon = linkIcon;
+	newCell.linkLabel = linkLabel;
+	
+	var uList = $("<ul>", {"style": "outline: 0 none; margin:0px; padding:0px;"});
+	var labelItem = $("<li>", {"style": "float:left; list-style:none outside none;"});
+	var iconItem = $("<li>", {"style": "float:left; list-style:none outside none;"});
+
+	uList.append(iconItem);
+	uList.append(labelItem);
+	labelItem.append(linkLabel);
+	iconItem.append(linkIcon);
+	
+	var newLink = $("<a>", {"href": "javascript:;"});
+	newLink.click(function()
+	{
+		console.log("Show/Hide Map Editor");
+		
+		// Only if this 'id' element hasn't been initialied, then do the following 2 lines
+		if(map !== null){
+			console.log(map.mapId);
+			console.log(mapsIdsArray.includes(id));
+		}
+		
+		
+		if(map == null){
+			console.log(id);
+			initMapEditorControls(id);
+			initMapEditor(id);
+			mapsIdsArray.push(map.mapId)
+		} else if(mapsIdsArray.includes(id) == false){
+			initMapEditorControls(id);
+			initMapEditor(id);
+			mapsIdsArray.push(map.mapId)
+		}
+
+		
+		
+		if(mapGPScontainer.css("display") == "none")
+		{
+			
+		    linkLabel.html(gs.text.de.hide_map_gps);
+			linkIcon.attr("class", "ui-icon ui-icon-folder-open");
+			mapGPScontainer.css("display", "block");
+
+			
+		}
+		else
+		{
+		    linkLabel.html(gs.text.de.edit_map_gps);
+			
+			linkIcon.attr("class", "ui-icon ui-icon-folder-collapsed");
+			mapGPScontainer.css("display", "none");
+	
+			
+		}
+	});
+
+	newLink.append(uList);	
+	linkSpan.append(newLink);
+	newCell.append(linkSpan);
+	row.append(newCell);
+	
+	mapGPScontainer.css("display","none");
+	
+	
+	addFunctionalityToTable(mapGPScontainer);
+	mapGPScontainer.metaNameField.css("display", "none");
+    mapGPScontainer.addRowButton.css("display", "none");
+    if (enable_add_all_metadata_button == true) {
+	  mapGPScontainer.addAllButton.css("display", "none");
+    }
+	
+}
+
 function setEditingFeaturesVisible(visible)
 {
@@ -122,4 +211,5 @@
 	$("#metadataListLabel, #metadataSetList").css("display", visibility);
     }
+	
 	$(".editMetadataButton").each(function()
 	{
@@ -127,5 +217,13 @@
 	    $(this.linkLabel).html(gs.text.de.edit_metadata); 
 		$(this.linkIcon).attr("class", "ui-icon ui-icon-folder-collapsed");
+	});	
+	/*
+	$(".editMapGPS").each(function()
+	{
+		$(this).css("display", visibility);
+	    $(this.linkLabel).html(gs.text.de.edit_map_gps); 		
+		$(this.linkIcon).attr("class", "ui-icon ui-icon-folder-collapsed");
 	});
+	*/
 	
 	$("table").each(function()
@@ -219,4 +317,5 @@
 	{
 		addEditMetadataLink(titleDivs[i]);
+		addEditMapGPSLink(titleDivs[i]);
 	}
 	
Index: main/trunk/greenstone3/web/interfaces/default/js/documentedit_scripts_util.js
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/js/documentedit_scripts_util.js	(revision 32769)
+++ main/trunk/greenstone3/web/interfaces/default/js/documentedit_scripts_util.js	(revision 32770)
@@ -929,5 +929,8 @@
 }
 
-
+function addFunctionalityToMapGPS(mapGPScontainer)
+{
+	
+}
 
 function addFunctionalityToTable(table)
