Ignore:
Timestamp:
2019-06-24T16:41:04+12:00 (5 years ago)
Author:
wy59
Message:
  1. Undoing the change to doc.pm committed in revision 33185: not storing all combinations of precision for Lat and Long in CoordShorts. Instead, Dr Bainbridge fixed up map-scripts.js to ensure that the requested precision (num decimal places) for Lat and Lng in a CoordShort are now the same. The chosen precision for both is set to whichever of the two is more zoomed out, which work out to be whichever of the two has fewer decimal places. 2. Dr Bainbridge and Martin set min-height when mapEnabled to ensure the footer didn't interfere in the map. 3. classifier-scripts' httpRequest() renamed to httpBrowseRequest() and map's getSubClassifier() renamed to httpMapBrowseRequest().
Location:
main/trunk/greenstone3/web/interfaces/default/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/classifier_scripts.js

    r33187 r33217  
    5353    else
    5454    {
    55         httpRequest(sectionID);
     55        httpBrowseRequest(sectionID);
    5656    }
    5757}
     
    114114}
    115115
    116 function httpRequest(sectionID)
     116function httpBrowseRequest(sectionID)
    117117{
    118118    if(!inProgress[sectionID])
     
    156156            updateOpenClassifiers();           
    157157            if(typeof mapEnabled !== 'undefined'){
    158                 getSubClassifier(sectionID);
     158                httpMapBrowseRequest(sectionID);
    159159            }
    160160        })
  • main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js

    r33187 r33217  
    3535        {
    3636            mapEnabled = true;
     37            var resultsArea = $('#resultsArea');
     38            if (resultsArea.length > 0){
     39                resultsArea.css('min-height','500px');
     40            }
    3741            for(var i = 0; i < jsonNodes.length; i++)
    3842            {
     
    167171    {
    168172        lngDelta = (1 / Math.pow(10, i));
     173        // Want the grid superimposed on the map to be 5 or fewer steps,
     174        // where delta is the grid size to make it so
     175        // and precision is the number of decimal places.
    169176        if((lngDistance / lngDelta) <= 5 || lngDelta == 1)
    170177        {
     
    172179            break;
    173180        }
    174     }
    175 
     181    }   
     182   
    176183    if(latDelta == 0.1){latDelta = 1; latPrecision = 0; }
    177184    if(lngDelta == 0.1){lngDelta = 1; lngPrecision = 0; }
     185   
     186   
     187    // Want consistent precision for both lat and lng.
     188    // So we choose the most conservative (whichever is more zoomed out) for both
     189    if(latPrecision < lngPrecision) {
     190        lngPrecision = latPrecision;
     191    } else if (lngPrecision < latPrecision) {
     192        latPrecision = lngPrecision;
     193    }
    178194   
    179195    /*
     
    778794}
    779795
    780 function getSubClassifier(sectionID)
    781 {
     796function httpMapBrowseRequest(sectionID)
     797{
     798    // Make ajax call to retrieve jsonNodes for section ID, and draw shapes on the map.
    782799    var url = gs.xsltParams.library_name + "?a=b&rt=s&s=ClassifierBrowse&c=" + gs.cgiParams.c + "&cl=" + sectionID + "&excerptid=jsonNodes";
    783800    $.ajax(url)
Note: See TracChangeset for help on using the changeset viewer.