Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document arrays consistently... #1434

Closed
mramato opened this issue Feb 4, 2014 · 2 comments · Fixed by #1729
Closed

Document arrays consistently... #1434

mramato opened this issue Feb 4, 2014 · 2 comments · Fixed by #1729
Labels
category - doc good first issue An opportunity for first time contributors

Comments

@mramato
Copy link
Contributor

mramato commented Feb 4, 2014

Currently, we have two different approaches to documenting arrays in Cesium.

  1. Mark the type as an Array, i.e. @param {Array} vertices The vertices
  2. Mark the type with array notation, i.e. @param {Number[]} vertices The vertices

@kring proposed that we move exclusively to the second approach because it will correctly generate a link to the Cesium documentation if it's a Cesium type. I agree with him. Unless anyone has any objections, we should make this change throughout the codebase. It should be easy as searching for {Array} and then determine the type and update the doc.

@andr3nun3s
Copy link
Contributor

Hey, what are these types you're talking about?

Example on AxisAlignedBoundingBox:

/**
     * Computes an instance of an AxisAlignedBoundingBox. The box is determined by
     * finding the points spaced the farthest apart on the x, y, and z axes.
     * @memberof AxisAlignedBoundingBox
     *
     * @param {Array} positions List of points that the bounding box will enclose.  Each point must have a <code>x</code>, <code>y</code>, and <code>z</code> properties.
     * (...)
     */
    AxisAlignedBoundingBox.fromPoints = function(positions, result) {
        if (!defined(result)) {
            result = new AxisAlignedBoundingBox();
        }

        if (!defined(positions) || positions.length === 0) {
            result.minimum = Cartesian3.clone(Cartesian3.ZERO, result.minimum);
            result.maximum = Cartesian3.clone(Cartesian3.ZERO, result.maximum);
            result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);
            return result;
        }
        (code goes on...)
    };

I think it is an array of Cartesian3 so should I replace {Array} with {Cartesian3[]} in this case?

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 28, 2014

@Andre-Nunes you are exactly right.

@pjcozzi pjcozzi added the 1.0 label May 8, 2014
abwood added a commit to abwood/cesium that referenced this issue May 21, 2014
@abwood abwood mentioned this issue May 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category - doc good first issue An opportunity for first time contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants