- Timestamp:
- 2019-07-02T21:04:34+12:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js
r33218 r33289 4 4 5 5 //var newLat, newLng = 0; 6 var _docList = new Array(); 7 _docList.ids = new Array(); 6 var _docList = {}; 7 _docList.ids = []; 8 8 9 _docList.getDocByIndex = function(index) 9 10 { 10 11 return _docList[_docList.ids[index]]; 11 12 }; 13 14 var _nearbyDocListByProximity = []; 12 15 13 16 var _map; 14 17 var _intervalHandle; 15 18 var _baseURL = document.URL.substring(0, document.URL.indexOf("?") + 1); 16 var _retrievedClassifiers = new Array();19 var _retrievedClassifiers = []; 17 20 var _preventLoopingSingleMarker = false; 18 21 var _searchRunning = false; 19 var _nearbyDocs = new Array();20 var _scrollThroughDefault = true; // TODO: default starts at true22 var _nearbyDocsByDistance = []; 23 var _scrollThroughDefault = true; 21 24 22 25 var LOW_OPACITY = 0.1; // make surrounding docs' opacity 10% 26 var _DEBUGGING_ = false; 23 27 24 28 function initializeMapScripts() … … 36 40 { 37 41 mapEnabled = true; 42 showMap("initializeMapScripts"); 43 38 44 var resultsArea = $('#resultsArea'); 39 45 if (resultsArea.length > 0){ … … 49 55 console.log("#### " + jsonNodes[i].nodeID + " is a main doc: "); 50 56 console.log(jsonNodes[i]); 51 create Markers(jsonNodes[i], options);57 createOverlayItems(jsonNodes[i], options); 52 58 } 53 59 … … 58 64 //hiding the map 59 65 mapEnabled = false; 60 $("#map_canvas").css({display:"none"});66 hideMap("initializeMapScripts"); 61 67 //return; 62 } 68 } 63 69 } 64 70 _docList.loopIndex = 0; … … 116 122 //console.log("@@@ created Google _map"); 117 123 118 google.maps.event.addListener(_map, 'bounds_changed', performSearchForMarkers); 119 } 120 } 121 122 function performSearchForMarkers() 123 { 124 google.maps.event.addListener(_map, 'bounds_changed', performProximitySearch); 125 } 126 } 127 128 function performProximitySearch() 129 { 130 _gsDebug("*** START OF performProximitySearch()"); 131 132 124 133 if(typeof mapEnabled === 'undefined') return; 125 134 if(!mapEnabled){ return; } 126 135 127 //console.log("@@@ performSearchForMarkers()"); 128 129 var bounds = _map.getBounds(); 130 var ne = bounds.getNorthEast(); 131 var sw = bounds.getSouthWest(); 132 133 //console.log("bounds: ne = " + ne + ", sw = " + sw); 136 _gsDebug("*** Got past mapEnabled test"); 137 138 139 for(var i = 0 ; i < _nearbyDocListByProximity.length; i++) { 140 removeMarkersFromMap(_nearbyDocListByProximity[i]); 141 } 142 _nearbyDocListByProximity = []; 143 144 145 _debugPrintBounds(_map.getBounds(), "@@@ performProximitySearch():"); 134 146 135 147 136 148 if(_searchRunning) 137 149 { 138 //console.log("*** performSearchForMarkers(): already running search => not initiating an additional search");150 _gsInfo("*** performProximitySearch(): already running search => not initiating an additional search"); 139 151 return; 140 152 } 141 142 153 143 154 _searchRunning = true; … … 152 163 var latDistance = neLat - swLat; 153 164 var lngDistance = neLng - swLng; 165 166 _gsDebug("****************START*****************"); 167 _gsDebug("latDistance = " + latDistance); 168 _gsDebug("lngDistance = " + lngDistance); 154 169 155 170 //Check which increment to use for latitude (i.e. 0.001, 0.01, 0.1 or 1 degree increments) … … 185 200 if(lngDelta == 0.1){lngDelta = 1; lngPrecision = 0; } 186 201 202 203 204 _gsDebug("Proximity search: lat precision BEFORE = " + latPrecision); 205 _gsDebug("Proximity search: lng precision BEFORE = " + lngPrecision); 187 206 188 207 // Want consistent precision for both lat and lng. … … 194 213 } 195 214 196 /* 215 _gsDebug("Proximity search: lat precision AFTER = " + latPrecision); 216 _gsDebug("Proximity search: lng precision AFTER = " + lngPrecision); 217 _gsDebug("Proximity search with: latDelta = " + latDelta); 218 _gsDebug("Proximity search with: lngDelta = " + lngDelta); 219 197 220 var query = ""; 198 for(var i = 0; i <= Math.floor(latDistance / latDelta) + 1; i++) 199 { 200 for(var j = 0; j <= Math.floor(lngDistance / lngDelta) + 1; j++) 221 var iMax = Math.floor(latDistance / latDelta) + 1; 222 var jMax = Math.floor(lngDistance / lngDelta) + 1; 223 224 _gsDebug("Proximity search with: iMax = " + iMax); 225 _gsDebug("Proximity search with: jMax = " + jMax); 226 227 _gsDebug("****************END*****************"); 228 229 for(var i = 0; i <= iMax; i++) //for(var i = 0; i <= Math.floor(latDistance / latDelta) + 1; i++) 230 { 231 for(var j = 0; j <= jMax; j++) //for(var j = 0; j <= Math.floor(lngDistance / lngDelta) + 1; j++) 201 232 { 202 233 //Some necessary variables … … 215 246 //Construct query 216 247 query += "("; 217 query += "LA:" + coordToAbsDirected(newLatTrunc, "lat");218 if(latDelta != 1)219 {220 query += "+AND+";221 query += "LA:" + newLatString.substring(newLatString.indexOf(".") + 1, newLatString.indexOf(".") + latPrecision + 1);222 }223 query += "+AND+";224 query += "LN:" + coordToAbsDirected(newLngTrunc, "lng");225 if(lngDelta != 1)226 {227 query += "+AND+";228 query += "LN:" + newLngString.substring(newLngString.indexOf(".") + 1, newLngString.indexOf(".") + lngPrecision + 1);229 }230 query += ")";231 232 if(i != (Math.floor(latDistance / latDelta) + 1) || j != (Math.floor(lngDistance / lngDelta) + 1)){ query += "+OR+"; }233 }234 }235 */236 var query = "";237 var iMax = Math.floor(latDistance / latDelta) + 1;238 var jMax = Math.floor(lngDistance / lngDelta) + 1;239 for(var i = 0; i <= iMax; i++) //for(var i = 0; i <= Math.floor(latDistance / latDelta) + 1; i++)240 {241 for(var j = 0; j <= jMax; j++) //for(var j = 0; j <= Math.floor(lngDistance / lngDelta) + 1; j++)242 {243 //Some necessary variables244 var newLat = neLat - (latDelta * i);245 var newLatString = "" + newLat;246 var newLatTrunc;247 if(newLat < 0){newLatTrunc = Math.ceil(newLat);}248 else{newLatTrunc = Math.floor(newLat);}249 250 var newLng = neLng - (lngDelta * j);251 var newLngString = "" + newLng;252 var newLngTrunc;253 if(newLng < 0){newLngTrunc = Math.ceil(newLng);}254 else{newLngTrunc = Math.floor(newLng);}255 256 //Construct query257 query += "(";258 248 query += "CS:\"" + coordToAbsDirected(newLatTrunc, "lat"); 259 //query += "CS:\"" + coordToAbsDirected(newLatTrunc, "lat") + "\" \"" + coordToAbsDirected(newLngTrunc, "lng") + "\""; //query += "LA:" + coordToAbsDirected(newLatTrunc, "lat");249 260 250 if(latDelta != 1) 261 251 { 262 252 query += newLatString.substring(newLatString.indexOf(".") + 1, newLatString.indexOf(".") + latPrecision + 1); 263 253 } 264 query += " "; 265 //query += "+AND+"; 266 267 //query += "LN:" + coordToAbsDirected(newLngTrunc, "lng"); 254 query += " "; 268 255 query += coordToAbsDirected(newLngTrunc, "lng"); 269 256 if(lngDelta != 1) … … 274 261 query += ")"; 275 262 276 //if(i != (Math.floor(latDistance / latDelta) + 1) || j != (Math.floor(lngDistance / lngDelta) + 1)){ query += "+OR+"; } 277 if(i != iMax || j != jMax){ query += "+OR+"; } 263 if(i != iMax || j != jMax){ query += "+OR+"; } //if(i != (Math.floor(latDistance / latDelta) + 1) || j != (Math.floor(lngDistance / lngDelta) + 1)){ query += "+OR+"; } 278 264 } 279 265 } … … 281 267 // This works, why not from the double loop above? 282 268 //query = "(CS:\"" + coordToAbsDirected(newLatTrunc, "lat") + " " + coordToAbsDirected(newLngTrunc, "lng") + "\")"; 283 //alert("@@@@in map-scripts::perform SearchForMarkers() - query: " + query);269 //alert("@@@@in map-scripts::performProximitySearch() - query: " + query); 284 270 285 271 //var url = gs.xsltParams.library_name + "?a=q&s=RawQuery&rt=rd&c=" + gs.cgiParams.c + "&s1.rawquery=" + query + "&excerptid=jsonNodes"; 286 272 var url = gs.xsltParams.library_name; 287 273 var data = "a=q&s=RawQuery&rt=rd&c=" + gs.cgiParams.c + "&s1.rawquery=" + query + "&excerptid=jsonNodes"; 288 // console.log("*** performSearchForMarkers(): rawQuery query data = " + query);274 //_gsDebug("*** performProximitySearch(): rawQuery query data = " + query); 289 275 290 276 $.ajax({type:"POST", url:url, data:data}) … … 293 279 //console.log("*** responseText (first 250) = " + responseText.substring(0,256)); 294 280 295 // The first time, docList.ids contains ONLY the main/visible doc's ID and its subsections' IDs.296 // Any one of these will do to determine297 if(_docList.ids.length > 0) {298 var mainDocID = _docList.ids[0];299 var endIndex = mainDocID.indexOf('.');300 if(endIndex == -1) { endIndex = mainDocID.length; }301 mainDocID = mainDocID.substring(0, endIndex);302 }303 304 281 if(responseText.search("id=\"jsonNodes") != -1) 305 282 { … … 310 287 311 288 var jsonNodes = eval(responseText.substring(startIndex+1, endIndex)); 312 //console.log("Number of matches returned from ajax rawQuery search = " + jsonNodes.length);289 _gsDebug("@@@@ performProximitySearch - Number of matches returned from ajax rawQuery search = " + jsonNodes.length); 313 290 if(jsonNodes && jsonNodes.length > 0) 314 291 { … … 320 297 for(var j = 0; j < _docList.ids.length; j++) { 321 298 if(doc.nodeID == _docList.ids[j]) { 322 found = true; 323 console.log("Found nearby ID " + doc.nodeID + " was already drawn:"); 324 console.log(jsonNodes[i]); 299 found = true; 300 _gsDebug("performProximitySearch(): Found nearby ID " + doc.nodeID + " was already drawn:", jsonNodes[i]); 325 301 break; 326 302 } … … 329 305 if(!found) 330 306 { 331 _docList[doc.nodeID] = doc; 332 _docList.ids.push(doc.nodeID); 333 334 // Some "nearby docs" are actually subsections of the main document, which are retrieved 335 // as a nearby doc by performSearchForMarkers() BEFORE the subsection is ever expanded. 336 // We need to distinguish between subsections of the main doc -- which should be displayed 337 // in their specified opacity -- and other docs and their subsections which should be displayed 338 // faded out. 339 if(typeof(mainDocID) !== 'undefined' && doc.nodeID.includes(mainDocID)) { 340 createMarkers(doc, {"mainDoc": true}); 341 } else { 342 createMarkers(doc, {"mainDoc": false}); 343 } 307 _nearbyDocListByProximity.push(doc); 308 createOverlayItems(doc, {"mainDoc": false}); 344 309 } 345 310 … … 355 320 }).fail(function(responseText, textStatus, errorThrown) // fail() has replaced error(), http://api.jquery.com/jquery.ajax/ 356 321 { 357 console.log("In map-scripts.perform SearchForMarkers(): Got an error in ajax call");322 console.log("In map-scripts.performProximitySearch(): Got an error in ajax call"); 358 323 _searchRunning = false; 359 324 }); … … 390 355 } 391 356 357 function toggleMapSection(options) 358 { 359 360 var sectionID = options["nodeID"]; 361 362 var titleClassifierEl = document.getElementById("title"+sectionID); 363 var jsonNodesStr = titleClassifierEl.getAttribute("data-gps-map-json"); 364 var jsonNodes = JSON.parse(jsonNodesStr); 365 366 if(options["expand"]){ 367 _gsDebug("expanding classifier - sectionID: " + sectionID); 368 369 if(jsonNodes && jsonNodes.length > 0) 370 { 371 for(var i = 0; i < jsonNodes.length; i++) 372 { 373 var doc = jsonNodes[i]; 374 if(_docList[doc.nodeID]) continue; // already in list, don't add again 375 376 _docList[doc.nodeID] = doc; 377 _docList.ids.push(doc.nodeID); 378 379 var options = { 380 "mainDoc": true // TODO: should this be true or false??? 381 }; 382 createOverlayItems(doc, options); 383 } 384 } 385 386 } else { // closing the bookshelf 387 _gsDebug("closing classifier - sectionID: " + sectionID); 388 if(jsonNodes && jsonNodes.length > 0) 389 { 390 for(var i = 0; i < jsonNodes.length; i++) 391 { 392 // remove the doc from _docList and its id from _docList.ids 393 // and remove its markers/shapes from the map 394 var nodeID = jsonNodes[i].nodeID; 395 var doc = _docList[nodeID]; 396 if(doc) { 397 removeMarkersFromMap(doc); 398 399 delete _docList[nodeID]; 400 401 var filtered_ids_to_keep = []; 402 for(var j = 0; j < _docList.ids.length; j++) { 403 if(_docList.ids[j] !== nodeID) { 404 filtered_ids_to_keep.push(_docList.ids[j]); 405 } 406 } 407 408 _docList.ids = filtered_ids_to_keep; 409 410 } else { 411 console.log("**** In toggleMapSection: shouldn't happen - failed to find doc on closing node: " + nodeID); 412 } 413 } 414 415 } 416 } 417 418 _debugPrintDocList(); 419 420 mapEnabled = (_docList.ids.length > 0); 421 422 if(mapEnabled) { 423 showMap("toggleMapSection"); 424 } else { 425 hideMap("toggleMapSection"); 426 } 427 428 429 } 430 431 /* Given a doc, removes all its shapes doc.shapes from the map _map */ 432 function removeMarkersFromMap(doc) { 433 for(var i = 0; i < doc.shapes.length; i++) { 434 var shape = doc.shapes[i]; 435 shape.setMap(null); 436 } 437 } 438 439 // In order for fitBounds to work out a non-zero bounds, have to use visibility, not display when hiding/showing the map. 440 // AND should not set height to 0px when using visibility hidden. But not setting height to 0 means an invisible map takes up space. 441 // In order for the resulting invisible map, that still takes up space, to not break the flow of the visible items 442 // on the page, need to swap map between position relative when map visible versus position absolute when the map is hidden. 443 // https://developers.google.com/maps/documentation/javascript/reference/map#Map.fitBounds 444 function showMap(callingFunction) { 445 446 //$("#map_canvas").css({display:"block"}); 447 //$("#map_canvas").css({visibility:"visible", height:"100%"}); // not working in conjunction with hidden 0px 448 //$("#map_canvas").css({visibility:"visible", height: "400px"}); // but this works in conjunction with hidden 0px 449 $("#map_canvas").css({visibility:"visible", position: "relative"}); 450 451 if(!_DEBUGGING_) return; 452 453 //var message = "map_canvas display BLOCK"; 454 var message = "map_canvas visibility VISIBLE, position relative"; 455 if(typeof callingFunction !== 'undefined') { 456 message = "showMap() called from" + callingFunction + ":" + message; 457 } 458 console.log("### " + message); 459 } 460 461 function hideMap(callingFunction) { 462 //$("#map_canvas").css({display:"none"}); 463 //$("#map_canvas").css({visibility:"hidden", height:"0px"}); 464 $("#map_canvas").css({visibility:"hidden", position:"absolute"}); 465 466 if(!_DEBUGGING_) return; 467 468 //var message = "map_canvas display NONE"; 469 var message = "map_canvas visibility HIDDEN, position absolute"; 470 if(typeof callingFunction !== 'undefined') { 471 message = "hideMap() called from" + callingFunction + ":" + message; 472 } 473 console.log("### " + message); 474 } 475 392 476 function updateMap() 393 477 { 394 //console.log("@@@ updateMap()"); 478 //console.log("@@@ updateMap()"); 395 479 var markersOnMap = 0; 396 480 var bounds = new google.maps.LatLngBounds(); 481 397 482 for(var i = 0; i < _docList.ids.length; i++) 398 483 { … … 423 508 } 424 509 425 if(doc.shapes) { 426 console.log("@@@@ HERE IN doc.shapes"); 510 if(doc.shapes) { 427 511 var docSection_overlay_bounds = ShapesUtil.overlayBounds(doc.shapes); 428 512 // We now have the current document or document subsection's bounds. … … 438 522 } 439 523 440 //console.log("@@@ UpdateMap() : bounds = " + bounds); 524 _debugPrintBounds(bounds, "@@@ UpdateMap():"); 525 526 441 527 if(markersOnMap > 1) 442 528 { 443 _map.fitBounds(bounds); 529 _debugPrintBounds(_map.getBounds(), "@@@ UpdateMap() : BEFORE fitbounds, map"); 530 531 _map.fitBounds(bounds); 532 533 _debugPrintBounds(_map.getBounds(), "@@@ UpdateMap() : AFTER fitbounds, map"); 444 534 } else if (markersOnMap == 1) { 445 535 //console.log("@@@ updating bounds with " + markersOnMap + " markers on the map"); … … 451 541 } 452 542 } 543 453 544 454 545 // TODO: FUNCTION DUPLICATED IN panoramaViewer.js … … 604 695 } 605 696 606 function create Markers(doc, options) {697 function createOverlayItems(doc, options) { 607 698 if(doc.mapoverlay) { 608 699 //console.log("Have shapes: " + doc.mapoverlay.toString()); … … 617 708 618 709 if(!shape.description) { 619 console.log("@@@@" + shape.type.toString() + " had no description/label");710 _gsInfo("#### " + shape.type.toString() + " had no description/label"); 620 711 return; 621 712 } … … 632 723 if(shape.type === google.maps.drawing.OverlayType.MARKER) { 633 724 var marker = shape; 634 console.log("Coord for marker is " + coord.toString());725 _gsDebug("Coord for marker is " + coord.toString()); 635 726 636 727 marker.addListener('mouseover', function() { … … 644 735 else { 645 736 var coord = ShapesUtil.getLabelCoordinate(shape); 646 console.log("Coord for " + shape.type.toString() + " is " + coord.toString());737 _gsDebug("Coord for " + shape.type.toString() + " is " + coord.toString()); 647 738 infoWindow.setPosition(coord); 648 739 shape.addListener('mouseover', function() { … … 805 896 var endIndex = responseText.indexOf("</"); 806 897 807 var jsonNodes = eval(responseText.substring(startIndex+1, endIndex)); 898 var jsonNodesStr = responseText.substring(startIndex+1, endIndex); 899 var jsonNodes = eval(jsonNodesStr); //responseText.substring(startIndex+1, endIndex)); 808 900 if(jsonNodes && jsonNodes.length > 0) 809 901 { 902 810 903 mapEnabled = true; 811 904 showMap("httpMapBrowseRequest"); 905 906 //var jsonNodesStr = ""; 812 907 for(var i = 0; i < jsonNodes.length; i++) 813 908 { … … 816 911 _docList.ids.push(doc.nodeID); 817 912 913 //$("#div"+doc.nodeID).attr("data-gps-map-json", JSON.stringify(jsonNodes[i])); 914 //jsonNodesStr += JSON.stringify(jsonNodes[i]); // can't do this after createOverlayItems, as we get cyclical ref error 818 915 var options = { 819 916 "mainDoc": true // TODO: should this be true or false??? 820 917 }; 821 createMarkers(doc, options); 822 } 823 824 $("#map_canvas").css({display:"block"}); 918 createOverlayItems(doc, options); 919 } 920 921 ///var tmp = $("#title"+sectionID); 922 ///console.log(tmp); // WRONG 923 ///var tmp2 = document.getElementById("title"+sectionID); 924 ///console.log(tmp2); // RIGHT, WHY? 925 926 // create data-* attribute to store this sectionID's JSON on the section's div 927 //$("#title"+sectionID).attr("data-gps-map-json", "hello world"); // TODO: Doesn't work. Why? 928 var titleClassifierEl = document.getElementById("title"+sectionID); 929 titleClassifierEl.setAttribute("data-gps-map-json", jsonNodesStr); 825 930 } 826 931 … … 936 1041 var docLink = response.substring(docLinkStart + 4, docLinkEnd); 937 1042 938 _nearbyDocs .push({title:docLink, distance:dist, lat:lats[i], lng:lngs[i++]});1043 _nearbyDocsByDistance.push({title:docLink, distance:dist, lat:lats[i], lng:lngs[i++]}); 939 1044 940 1045 index = docLinkEnd; … … 965 1070 { 966 1071 var sortedTable = '<table id="nearbyDocs" onmouseleave="clearTimeout(map_centering_timeout); recenterMap('+base_lat+','+base_lng+');"><tr><th><a href="javascript:;">Distance</a></th><th><a href="javascript:sortAlphabetically('+base_lat+', '+base_lng+');">Document</a></th></tr>'; 967 _nearbyDocs .sort(function(a, b){return (a.distance - b.distance);});968 for(var i = 0; i < _nearbyDocs .length; i++)1072 _nearbyDocsByDistance.sort(function(a, b){return (a.distance - b.distance);}); 1073 for(var i = 0; i < _nearbyDocsByDistance.length; i++) 969 1074 { 970 1075 971 sortedTable += "<tr><td>" + prettifyDistance(_nearbyDocs [i].distance) + '</td><td onmouseover="clearTimeout(map_centering_timeout); map_centering_timeout = setTimeout(recenterMapF(' + _nearbyDocs[i].lat + ',' + _nearbyDocs[i].lng + '), 900)" >' + _nearbyDocs[i].title + "</td></tr>";1076 sortedTable += "<tr><td>" + prettifyDistance(_nearbyDocsByDistance[i].distance) + '</td><td onmouseover="clearTimeout(map_centering_timeout); map_centering_timeout = setTimeout(recenterMapF(' + _nearbyDocsByDistance[i].lat + ',' + _nearbyDocsByDistance[i].lng + '), 900)" >' + _nearbyDocsByDistance[i].title + "</td></tr>"; 972 1077 } 973 1078 sortedTable += "</table>"; … … 996 1101 { 997 1102 var sortedTable = '<table id="nearbyDocs" onmouseleave="clearTimeout(map_centering_timeout); recenterMap('+base_lat+','+base_lng+');"><tr><th><a href="javascript:sortByDistance('+base_lat+', '+base_lng+');">Distance</a></th><th><a href="javascript:;">Document</a></th></tr>'; 998 _nearbyDocs .sort(function(a, b)1103 _nearbyDocsByDistance.sort(function(a, b) 999 1104 { 1000 1105 var firstTitleStartIndex = a.title.indexOf(">"); … … 1006 1111 return ((firstTitle.toLowerCase() == secondTitle.toLowerCase()) ? 0 : ((firstTitle.toLowerCase() > secondTitle.toLowerCase()) ? 1 : -1)); 1007 1112 }); 1008 for(var i = 0; i < _nearbyDocs .length; i++)1009 { 1010 sortedTable += "<tr><td>" + _nearbyDocs [i].distance + '</td><td onmouseover="clearTimeout(map_centering_timeout); map_centering_timeout = setTimeout(recenterMapF(' + _nearbyDocs[i].lat + ',' + _nearbyDocs[i].lng + '), 900)">' + _nearbyDocs[i].title + "</td></tr>";1113 for(var i = 0; i < _nearbyDocsByDistance.length; i++) 1114 { 1115 sortedTable += "<tr><td>" + _nearbyDocsByDistance[i].distance + '</td><td onmouseover="clearTimeout(map_centering_timeout); map_centering_timeout = setTimeout(recenterMapF(' + _nearbyDocsByDistance[i].lat + ',' + _nearbyDocsByDistance[i].lng + '), 900)">' + _nearbyDocsByDistance[i].title + "</td></tr>"; 1011 1116 } 1012 1117 sortedTable += "</table>"; … … 1072 1177 return queryStringTerm; 1073 1178 } 1179 1180 function _gsInfo(message, optObject) { 1181 console.log(message); 1182 if(typeof optObject !== 'undefined') { 1183 console.log(optObject); 1184 } 1185 } 1186 1187 function _gsDebug(message, optObject) { 1188 if(_DEBUGGING_) { 1189 _gsInfo(message, optObject); 1190 } 1191 } 1192 1193 1194 function _debugPrintDocList() { 1195 if(!_DEBUGGING_) return; 1196 1197 console.log("@@@@ printing docList:"); 1198 for(var i = 0; i < _docList.ids.length; i++) 1199 { 1200 var doc = _docList.getDocByIndex(i); 1201 console.log(" At index = " + i + " ids[i]: " + _docList.ids[i]); 1202 console.log(" At index = " + i + " ids[i]: " + _docList.ids[i] + ", doc: " + doc.nodeID); 1203 } 1204 } 1205 1206 function _debugPrintBounds(bounds, message) { 1207 if(!_DEBUGGING_) return; 1208 var ne = bounds.getNorthEast(); 1209 var sw = bounds.getSouthWest(); 1210 console.log(message + " bounds: ne = " + ne + ", sw = " + sw); 1211 }
Note:
See TracChangeset
for help on using the changeset viewer.