Changeset 33322 for main/trunk
- Timestamp:
- 2019-07-11T17:23:18+12:00 (5 years ago)
- Location:
- main/trunk/greenstone3/web/interfaces/default/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/js/facet-scripts.js
r33286 r33322 50 50 51 51 countsString += "&"; 52 console.log("STRING IS " + countsString);52 //console.log("STRING IS " + countsString); 53 53 54 54 $.ajax(gs.xsltParams.library_name + "/collection/" + gs.cgiParams.c + "/search/" + gs.cgiParams.s + "?" + searchString + countsString + "excerptid=resultsArea") 55 55 .done(function(response) 56 56 { 57 57 $("#resultsArea").html(""); 58 58 $("#resultsArea").html(response.substring(response.indexOf(">") + 1, response.lastIndexOf("<"))); … … 63 63 favouritesCheckout(); // called to add back in favourites icons (if favouritebasket active) 64 64 } 65 if(typeof mapEnabled !== 'undefined') { 66 67 facetedMapSearch(gs.xsltParams.library_name + "/collection/" + gs.cgiParams.c + "/search/" + gs.cgiParams.s + "?" + searchString + countsString); 68 69 } 65 70 }); 66 71 } -
main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js
r33317 r33322 21 21 var _searchRunning = false; 22 22 var _nearbyDocsByDistance = []; 23 var _scrollThroughDefault = true; 23 var _scrollThroughDefault = true; // TODO: default is true 24 24 25 25 var LOW_OPACITY = 0.1; // make surrounding docs' opacity 10% … … 128 128 function performProximitySearch() 129 129 { 130 //console.log("@@@@ skipping proximity search for now"); 131 //return; 132 130 133 _gsDebug("*** START OF performProximitySearch()"); 131 134 … … 355 358 } 356 359 360 function facetedMapSearch(facet_request_url) { 361 // ask for just the jsonNodes 362 facet_request_url += "excerptid=jsonNodes"; 363 364 $.ajax(facet_request_url).done(function(responseText) { 365 var doc; 366 var nodeID; 367 368 console.log("Sent off facetedMapSearch request to " + facet_request_url + ", got response: "); 369 console.log(responseText); 370 371 if(responseText.search("id=\"jsonNodes") != -1) { 372 var startIndex = responseText.indexOf(">"); 373 var endIndex = responseText.indexOf("</"); 374 var jsonNodes = eval(responseText.substring(startIndex+1, endIndex)); 375 console.log(jsonNodes); 376 377 378 if(jsonNodes && jsonNodes.length > 0) { 379 console.log("Got some nodes. Removing all markers first..."); 380 381 382 mapEnabled = true; 383 showMap("initializeMapScripts"); 384 385 // Remove all the markers/shapes from map 386 // and empty _docList.ids and the _docList of items 387 for(var j = 0; j < _docList.ids.length; j++) { 388 nodeID = _docList.ids[j]; 389 doc = _docList.getDocByIndex(j); 390 removeMarkersFromMap(doc); 391 delete _docList[nodeID]; 392 } 393 _docList.ids = []; 394 395 // repopulate _docList and _docList.ids and plot on map 396 for(var i = 0; i < jsonNodes.length; i++) 397 { 398 _docList[jsonNodes[i].nodeID] = jsonNodes[i]; 399 _docList.ids.push(jsonNodes[i].nodeID); 400 var options = { 401 "mainDoc": true 402 }; 403 console.log("#### " + jsonNodes[i].nodeID + " is a main doc: "); 404 console.log(jsonNodes[i]); 405 createOverlayItems(jsonNodes[i], options); 406 } 407 408 // redo map bounds, which will also performProximitySearch 409 updateMap(); 410 } 411 else 412 { 413 //hiding the map 414 mapEnabled = false; 415 hideMap("initializeMapScripts"); 416 } 417 } 418 _docList.loopIndex = 0; 419 420 }); 421 422 } 423 424 357 425 function toggleMapSection(options) 358 426 {
Note:
See TracChangeset
for help on using the changeset viewer.