Index: /main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js	(revision 33347)
+++ /main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js	(revision 33348)
@@ -264,5 +264,5 @@
 			query += ")";
 
-			if(i != iMax || j != jMax){ query += "+OR+"; } //if(i != (Math.floor(latDistance / latDelta) + 1) || j != (Math.floor(lngDistance / lngDelta) + 1)){ query += "+OR+"; }
+			if(i != iMax || j != jMax){ query += " OR "; } //if(i != (Math.floor(latDistance / latDelta) + 1) || j != (Math.floor(lngDistance / lngDelta) + 1)){ query += " OR "; }
 		}
 	}
@@ -699,4 +699,8 @@
 		for(var x = 0; x < doc.shapes.length; x++) {
 			var shape = doc.shapes[i];
+			if(typeof shape === 'undefined') { // happens just after map page has loaded when scrolling through markers. Why does this happen
+				console.log("shape at " + x + " not defined");
+				continue;
+			}
 			if(shape.type === google.maps.drawing.OverlayType.MARKER) {
 				shape.markerInfo.open(_map, shape);
@@ -769,22 +773,22 @@
 function createOverlayItems(doc, options) {
 	var loopCounter = 0;
-	if(doc.mapoverlay || doc.childrenMapoverlays) {
+	if(doc.mapoverlay || doc.descendantsMapoverlays) {
 		if(doc.mapoverlay) {
-			// append any child section's mapoverlays onto doc.mapoverlay
-			if(doc.childrenMapoverlays) {				
-				for(loopCounter = 0; loopCounter < doc.childrenMapoverlays.length; loopCounter++) {
-					//console.log("Pushing next child mapoverlay onto doc.mapoverlay: ", doc.childrenMapoverlays[loopCounter]);
-					Array.prototype.push.apply(doc.mapoverlay, doc.childrenMapoverlays[loopCounter]);					
+			// append any descendant section's mapoverlays onto doc.mapoverlay
+			if(doc.descendantsMapoverlays) {
+				for(loopCounter = 0; loopCounter < doc.descendantsMapoverlays.length; loopCounter++) {
+					//console.log("Pushing next descendant mapoverlay onto doc.mapoverlay: ", doc.descendantsMapoverlays[loopCounter]);
+					Array.prototype.push.apply(doc.mapoverlay, doc.descendantsMapoverlays[loopCounter]);					
 				}
-				delete doc.childrenMapoverlays; // served its purpose
-			}
-		} else if (doc.childrenMapoverlays) { // no doc.mapoverlay
-			// construct doc.mapoverlay to contain each child section's mapoverlay
+				delete doc.descendantsMapoverlays; // served its purpose
+			}
+		} else if (doc.descendantsMapoverlays) { // no doc.mapoverlay
+			// construct doc.mapoverlay to contain each descendant section's mapoverlay
 			doc.mapoverlay = [];
-			for(loopCounter = 0; loopCounter < doc.childrenMapoverlays.length; loopCounter++) {
-				//console.log("Pushing next child mapoverlay onto originally empty doc.mapoverlay: ", doc.childrenMapoverlays[loopCounter]);
-				Array.prototype.push.apply(doc.mapoverlay, doc.childrenMapoverlays[loopCounter]);
+			for(loopCounter = 0; loopCounter < doc.descendantsMapoverlays.length; loopCounter++) {
+				//console.log("Pushing next descendant mapoverlay onto originally empty doc.mapoverlay: ", doc.descendantsMapoverlays[loopCounter]);
+				Array.prototype.push.apply(doc.mapoverlay, doc.descendantsMapoverlays[loopCounter]);
 			}			
-			delete doc.childrenMapoverlays;  // no more use for this
+			delete doc.descendantsMapoverlays;  // no more use for this
 		}
 		//console.log("@@@@ Have shapes: ", doc.mapoverlay);		
@@ -1065,5 +1069,5 @@
 			query += "(" + getDistanceQueryStringTerm(lat, lng, latDelta, lngDelta, 2, "CS") + ")";
 			
-			if(i != ((degrees * 2) - 1) || j != ((degrees * 2) - 1)){ query += "+OR+"; }
+			if(i != ((degrees * 2) - 1) || j != ((degrees * 2) - 1)){ query += " OR "; }
 		}
 	}
@@ -1294,4 +1298,8 @@
 function _debugPrintBounds(bounds, message) {
 	if(!_DEBUGGING_) return;
+	if(typeof bounds === 'undefined') {
+		console.log("Bounds undefined");
+		return;
+	}
 	var ne = bounds.getNorthEast();
     var sw = bounds.getSouthWest();				  
Index: /main/trunk/greenstone3/web/interfaces/default/transform/map-tools.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/transform/map-tools.xsl	(revision 33347)
+++ /main/trunk/greenstone3/web/interfaces/default/transform/map-tools.xsl	(revision 33348)
@@ -21,5 +21,5 @@
       <xsl:text>[</xsl:text>
       <xsl:for-each select="//documentNode">
-	<xsl:if test="(metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']) or metadataList/metadata[@name = 'Coordinate'] or metadataList/metadata[@name = 'GPS.mapOverlay'] or metadataList/metadata[@name = 'children_GPS.mapOverlay']">
+	<xsl:if test="(metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']) or metadataList/metadata[@name = 'Coordinate'] or metadataList/metadata[@name = 'GPS.mapOverlay'] or metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
 	  <xsl:text>{</xsl:text>
 	  <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text>
@@ -57,9 +57,9 @@
 	  </xsl:if>
 	  
-	  <xsl:if test="metadataList/metadata[@name = 'children_GPS.mapOverlay']">
-		<xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'children_GPS.mapOverlay'])"/></xsl:variable>
+	  <xsl:if test="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
+		<xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'descendants_GPS.mapOverlay'])"/></xsl:variable>
 		<xsl:text disable-output-escaping="yes">,</xsl:text>
-		<xsl:text disable-output-escaping="yes">"childrenMapoverlays":[</xsl:text>
-		<xsl:for-each select="metadataList/metadata[@name = 'children_GPS.mapOverlay']">
+		<xsl:text disable-output-escaping="yes">"descendantsMapoverlays":[</xsl:text>
+		<xsl:for-each select="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
 			<xsl:value-of disable-output-escaping="yes" select="current()"/>
 			<xsl:if test="not(position() = $count)">
@@ -84,5 +84,5 @@
 	<gsf:metadata name="Coordinate" hidden="true"/>
 	<gsf:metadata name="GPS.mapOverlay" hidden="true"/>
-	<gsf:metadata name="GPS.mapOverlay" select="children" hidden="true"/>
+	<gsf:metadata name="GPS.mapOverlay" select="descendants" hidden="true"/>
 <!--  these were included in version in query. don't think we need them...
     <gsf:metadata name="Image" hidden="true"/>
Index: /main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl	(revision 33347)
+++ /main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl	(revision 33348)
@@ -844,5 +844,5 @@
 				<xsl:when test="count(//documentNode) > 0">
 					<xsl:for-each select="//documentNode">
-						<xsl:if test="(metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']) or metadataList/metadata[@name = 'Coordinate'] or metadataList/metadata[@name = 'GPS.mapOverlay'] or metadataList/metadata[@name = 'children_GPS.mapOverlay']">
+						<xsl:if test="(metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']) or metadataList/metadata[@name = 'Coordinate'] or metadataList/metadata[@name = 'GPS.mapOverlay'] or metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
 							<xsl:text>{</xsl:text>
 							<xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
@@ -874,9 +874,9 @@
 							</xsl:if>
 							
-							<xsl:if test="metadataList/metadata[@name = 'children_GPS.mapOverlay']">
-								<xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'children_GPS.mapOverlay'])"/></xsl:variable>
+							<xsl:if test="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
+								<xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'descendants_GPS.mapOverlay'])"/></xsl:variable>
 								<xsl:text disable-output-escaping="yes">,</xsl:text>
-								<xsl:text disable-output-escaping="yes">"childrenMapoverlays":[</xsl:text>
-								<xsl:for-each select="metadataList/metadata[@name = 'children_GPS.mapOverlay']">
+								<xsl:text disable-output-escaping="yes">"descendantsMapoverlays":[</xsl:text>
+								<xsl:for-each select="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
 									<xsl:value-of disable-output-escaping="yes" select="current()"/>
 									<xsl:if test="not(position() = $count)">
@@ -899,5 +899,5 @@
 				<xsl:otherwise>
 					<xsl:for-each select="/page/pageResponse/document">
-						<xsl:if test="(metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']) or metadataList/metadata[@name = 'Coordinate']  or metadataList/metadata[@name = 'GPS.mapOverlay'] or metadataList/metadata[@name = 'children_GPS.mapOverlay']">
+						<xsl:if test="(metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']) or metadataList/metadata[@name = 'Coordinate']  or metadataList/metadata[@name = 'GPS.mapOverlay'] or metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
 							<xsl:text>{</xsl:text>
 							<xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@selectedNode"/><xsl:text disable-output-escaping="yes">",</xsl:text>
@@ -929,9 +929,9 @@
 							</xsl:if>
 							
-							<xsl:if test="metadataList/metadata[@name = 'children_GPS.mapOverlay']">
-								<xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'children_GPS.mapOverlay'])"/></xsl:variable>
+							<xsl:if test="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
+								<xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'descendants_GPS.mapOverlay'])"/></xsl:variable>
 								<xsl:text disable-output-escaping="yes">,</xsl:text>
-								<xsl:text disable-output-escaping="yes">"childrenMapoverlays":[</xsl:text>
-								<xsl:for-each select="metadataList/metadata[@name = 'children_GPS.mapOverlay']">
+								<xsl:text disable-output-escaping="yes">"descendantsMapoverlays":[</xsl:text>
+								<xsl:for-each select="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
 									<xsl:value-of disable-output-escaping="yes" select="current()"/>									
 									<xsl:if test="not(position() = $count)">
@@ -955,5 +955,5 @@
 		<gsf:metadata name="Coordinate" hidden="true"/>
 		<gsf:metadata name="GPS.mapOverlay" hidden="true"/>
-		<gsf:metadata name="GPS.mapOverlay" select="children" hidden="true"/>
+		<gsf:metadata name="GPS.mapOverlay" select="descendants" hidden="true"/>
 	</xsl:template>
 	
