Changeset 33085 for main


Ignore:
Timestamp:
2019-05-16T20:07:50+12:00 (5 years ago)
Author:
wy59
Message:
  1. Labels sort of work (see point 2) and get saved and reloaded from archives too now. 2. Needs fixing: undo and redo in label field works only if you enter the text first before drawing the shape, whereas vice-versa the redo/undo behaviour is weird (label repeated 3 times).
File:
1 edited

Legend:

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

    r32850 r33085  
    145145    var mvc_path = ShapesUtil.arrayPathToMVCArrayPath(json_path);
    146146   
    147     var polyline = ShapesUtil._createPoly(google.maps.drawing.OverlayType.POLYLINE,json_polyline,mvc_path);
     147    var polyline = ShapesUtil._createPoly(google.maps.drawing.OverlayType.POLYLINE, json_polyline, mvc_path);   
    148148    return polyline;
    149149}
     
    369369
    370370
    371 ShapesUtil.cloneShape = function (shape) {
     371ShapesUtil.cloneShape = function (shape) {   
    372372    if (shape.type === google.maps.drawing.OverlayType.POLYLINE) {
    373         var clone_polyline = ShapesUtil.clonePolyline(shape);
     373        var clone_polyline = ShapesUtil.clonePolyline(shape);
     374        clone_polyline.description = shape.description;
    374375        return clone_polyline;
    375376    } else if (shape.type === google.maps.drawing.OverlayType.POLYGON) {
    376         var clone_polygon = ShapesUtil.clonePolygon(shape);
     377        var clone_polygon = ShapesUtil.clonePolygon(shape);
     378        clone_polygon.description = shape.description;
    377379        return clone_polygon;
    378380    } else if (shape.type === google.maps.drawing.OverlayType.RECTANGLE) {
    379         var clone_rect = ShapesUtil.cloneRectangle(shape);
    380         return clone_rect;
    381 
     381        var clone_rect = ShapesUtil.cloneRectangle(shape);
     382        clone_rect.description = shape.description;
     383        return clone_rect;     
    382384    } else if (shape.type === google.maps.drawing.OverlayType.CIRCLE) {
    383         var clone_circ = ShapesUtil.cloneCircle(shape);
     385        var clone_circ = ShapesUtil.cloneCircle(shape);
     386        clone_circ.description = shape.description;
    384387        return clone_circ;
    385388
    386389    } else {
    387         var clone_marker = ShapesUtil.cloneMarker(shape);
     390        var clone_marker = ShapesUtil.cloneMarker(shape);
     391        clone_marker.description = shape.description;
    388392        return clone_marker;
    389393    }
     
    421425    }
    422426   
     427    json_shape.description = shape.description;
    423428    return json_shape;
    424429}
     
    459464    }
    460465   
     466    shape.description = json_shape.description;
    461467    return shape;
    462468}
Note: See TracChangeset for help on using the changeset viewer.