Ignore:
Timestamp:
2019-06-21T20:37:49+12:00 (5 years ago)
Author:
wy59
Message:
  1. Corrections to map-scripts.js code (e.g. a var had been omitted from a declaration). Reinstated Dr Bainbridge's setting of the bounds during updateMap, as his way preserved the cumulative bounds we were building up and the recently committed 'improvement' had actually tossed this important bit of code away. 3. Major change to doc.pm to store all combinations of Lat and Lng components of CoordShort, since each Lat and Lng can have a different number of decimal places. We need to store all possible combinations since searching requires that, as searching can and does in fact have unequal number of dec places for coordinates (that end up using CoordShort) on occasion. Without this fix, shapes of nearby docs/subsections don't get returned in such cases.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js

    r33184 r33185  
    150150    //Check which increment to use for longitude (i.e. 0.001, 0.01, 0.1 or 1 degree increments)
    151151    var lngDelta;
     152    var lngPrecision;
    152153    for(var i = 3; i >= 0; i--)
    153154    {
     
    205206    var query = "";
    206207    var iMax = Math.floor(latDistance / latDelta) + 1;
    207     var jMax = Math.floor(lngDistance / lngDelta) + 1;;
     208    var jMax = Math.floor(lngDistance / lngDelta) + 1;
    208209    for(var i = 0; i <= iMax; i++) //for(var i = 0; i <= Math.floor(latDistance / latDelta) + 1; i++)
    209210    {
     
    355356        {
    356357            if(doc.shapes) {
    357                 //console.log("@@@ making doc.shapes["+x+"] visible");
    358358                for(var x = 0; x < doc.shapes.length; x++) {                   
    359359                    doc.shapes[x].setVisible(true);
     
    369369        if(doc.shapes) {
    370370            console.log("@@@@ HERE IN doc.shapes");
    371             bounds = ShapesUtil.overlayBounds(doc.shapes);
     371            var docSection_overlay_bounds = ShapesUtil.overlayBounds(doc.shapes);
     372            // We now have the current document or document subsection's bounds.
     373            // Use this to extend the overall bounds (the cumulative bounds for all nearby documents,
     374            // or at least the cumulative bounds for this document with all its subsections).
     375            bounds.extend(docSection_overlay_bounds.getNorthEast());
     376            bounds.extend(docSection_overlay_bounds.getSouthWest());
    372377        }
    373378        else {
Note: See TracChangeset for help on using the changeset viewer.