Changeset 32834 for main/trunk


Ignore:
Timestamp:
2019-03-01T19:41:57+13:00 (5 years ago)
Author:
ak19
Message:

Discovered bug when testing sectioned documents like solr-demo/lucene-demo coll. Old map-editor LOAD() function always loaded saved metadata of subsections into the map editor of the topsection. That's not what we want. We want each (sub)section's stored GPS map data to be loaded into that (sub)section's map editor.

File:
1 edited

Legend:

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

    r32833 r32834  
    409409            if(JSONString !== "")
    410410            {
    411                 that.LOAD(JSONString);
     411                that.LOAD(JSONString, nodeID);
    412412                that.savedOverlays = JSONString;
    413413            }
     
    688688
    689689// to be called after reading back in stored JSON from archives meta
    690 MapEditor.prototype.LOAD = function (json_str) {
     690MapEditor.prototype.LOAD = function (json_str, nodeID) {
    691691    this.mapEditorHistory.historyOverlayPush();
    692692   
    693     var map_editor = Object.values(gsmap_store)[0];
     693   
     694    // This seems to convert the map_store object into an array and forces array index access, instead of convenient property access using nodeID   
     695    //Object.values(gsmap_store)[0]; // Always gets top level section's map-editor, not what we want.
     696   
     697    // Get the map editor for the nodeID, as we're asked to load that editor
     698    var map_editor = gsmap_store["map-"+nodeID];
    694699   
    695700    var new_overlays = ShapesUtil.JSONToOverlays(json_str);
Note: See TracChangeset for help on using the changeset viewer.