# all files / ol/geom/flat/ inflateflatgeom.js

100% Statements 29/29
50% Branches 3/6
100% Functions 3/3
100% Lines 29/29

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    721×

    1×

    580×
    580×
    580×
    580×
    4821×

    580×
    580×

    1×

    215×
    215×
    215×
    215×
    343×
    343×

    343×

    215×
    215×

    1×

    46×
    46×
    46×
    46×
    77×
    77×

    77×

    46×
    46×

     goog.provide('ol.geom.flat.inflate');

    /**
     * @param {Array.<number>} flatCoordinates Flat coordinates.
     * @param {number} offset Offset.
     * @param {number} end End.
     * @param {number} stride Stride.
     * @param {Array.<ol.Coordinate>=} opt_coordinates Coordinates.
     * @return {Array.<ol.Coordinate>} Coordinates.
     */
    ol.geom.flat.inflate.coordinates =
        function(flatCoordinates, offset, end, stride, opt_coordinates) {
      var coordinates = opt_coordinates !== undefined ? opt_coordinates : [];
      var i = 0;
      var j;
      for (j = offset; j < end; j += stride) {
        coordinates[i++] = flatCoordinates.slice(j, j + stride);
      }
      coordinates.length = i;
      return coordinates;
    };

    /**
     * @param {Array.<number>} flatCoordinates Flat coordinates.
     * @param {number} offset Offset.
     * @param {Array.<number>} ends Ends.
     * @param {number} stride Stride.
     * @param {Array.<Array.<ol.Coordinate>>=} opt_coordinatess Coordinatess.
     * @return {Array.<Array.<ol.Coordinate>>} Coordinatess.
     */
    ol.geom.flat.inflate.coordinatess =
        function(flatCoordinates, offset, ends, stride, opt_coordinatess) {
      var coordinatess = opt_coordinatess !== undefined ? opt_coordinatess : [];
      var i = 0;
      var j, jj;
      for (j = 0, jj = ends.length; j < jj; ++j) {
        var end = ends[j];
        coordinatess[i++] = ol.geom.flat.inflate.coordinates(
            flatCoordinates, offset, end, stride, coordinatess[i]);
        offset = end;
      }
      coordinatess.length = i;
      return coordinatess;
    };

    /**
     * @param {Array.<number>} flatCoordinates Flat coordinates.
     * @param {number} offset Offset.
     * @param {Array.<Array.<number>>} endss Endss.
     * @param {number} stride Stride.
     * @param {Array.<Array.<Array.<ol.Coordinate>>>=} opt_coordinatesss
     *     Coordinatesss.
     * @return {Array.<Array.<Array.<ol.Coordinate>>>} Coordinatesss.
     */
    ol.geom.flat.inflate.coordinatesss =
        function(flatCoordinates, offset, endss, stride, opt_coordinatesss) {
      var coordinatesss = opt_coordinatesss !== undefined ? opt_coordinatesss : [];
      var i = 0;
      var j, jj;
      for (j = 0, jj = endss.length; j < jj; ++j) {
        var ends = endss[j];
        coordinatesss[i++] = ol.geom.flat.inflate.coordinatess(
            flatCoordinates, offset, ends, stride, coordinatesss[i]);
        offset = ends[ends.length - 1];
      }
      coordinatesss.length = i;
      return coordinatesss;
    };