Commit 5fe95122 authored by Kaitlyn  Lee's avatar Kaitlyn Lee
Browse files

Changed format of documentation.

parent 144b0175
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -29,9 +29,9 @@ export default L.Map.AstroMap = L.Map.extend({
   * @details Initializes the map by loading the LayerCollection for
   * each supported projection and setting default options.
   *
   * @param {String} mapDiv ID of the div for the map.
   * @param {String} target Name of target to display layers for.
   * @param {Object} options Options for the map.
   * @param {String} mapDiv - ID of the div for the map.
   * @param {String} target - Name of target to display layers for.
   * @param {Object} options - Options for the map.
   */
  initialize: function(mapDiv, target, options) {
    this.mapDiv = mapDiv;
@@ -55,7 +55,7 @@ export default L.Map.AstroMap = L.Map.extend({
  /**
   * @details Adds the LayerCollection with the requrested projection name.
   *
   * @param {String} name Name of the projection.
   * @param {String} name - Name of the projection.
   */
  loadLayerCollection: function(name) {
    this.layers[name].addTo(this);
@@ -64,7 +64,7 @@ export default L.Map.AstroMap = L.Map.extend({
  /**
   * @details Changes the projection of the map and resets the center and view.
   * 
   * @param {String} name Name of Projection.
   * @param {String} name - Name of Projection.
   * @param {List} center - Center of map based off of projection.
]   */
  changeProjection: function(name, center) {
+3 −3
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ export default class AstroProj {
  /**
   * @details Finds the a and c radii of a given target.
   *
   * @param {String} target Name of the target.
   * @param {String} target - Name of the target.
   * @return {Object} Radii Object in form: {'a': , 'c'}.
   */
  getRadii(target) {
@@ -33,8 +33,8 @@ export default class AstroProj {
  /**
   * @details Returns the proj-string for a requested target and projection name.
   *
   * @param {String} target Name of the target.
   * @param {String} name Name of the projection.
   * @param {String} target - Name of the target.
   * @param {String} name - Name of the projection.
   * @return {Object} Object storing the proj-string and code
   * in the form: {'code': , 'string'}.
   */
+19 −10
Original line number Diff line number Diff line
@@ -27,9 +27,12 @@ export default L.LayerCollection = L.Class.extend({
    this.createOverlays(layers["overlays"]);
  },

  // @method parseJSON(): Object of Layers
  // Parses the USGS JSON, creates layer objects for a particular
  // target and projection, and stores them in a JS object.
  /**
   * Parses the USGS JSON, creates layer objects for a particular
   * target and projection, and stores them in a JS object.
   * @return {Object} - Dictionary containing the layer information in
   *                    the format: {base: , overlays}
   */
  parseJSON: function() {
    let layers = {
      base: [],
@@ -70,8 +73,10 @@ export default L.LayerCollection = L.Class.extend({
    return layers;
  },

  // @method createBaseLayers(layers: Object of layers)
  // Creates WMS layers and adds them to the list of base layers.
  /**
   * Creates WMS layers and adds them to the list of base layers.
   * @param  {List} layers - List of base layer information. 
   */
  createBaseLayers: function(layers) {
    for (let i = 0; i < layers.length; i++) {
      let layer = layers[i];
@@ -88,8 +93,10 @@ export default L.LayerCollection = L.Class.extend({
    }
  },

  // @method createOverlays(layers: Object of layers)
  // Creates WMS layers and adds them to the list of overlays.
  /**
   * Creates WMS layers and adds them to the list of overlays.
   * @param  {List} layers - List of overlay information. 
   */
  createOverlays: function(layers) {
    for (let i = 0; i < layers.length; i++) {
      let layer = layers[i];
@@ -106,9 +113,11 @@ export default L.LayerCollection = L.Class.extend({
    }
  },

  // @method addTo(map: AstroMap)
  // Removes the current layers, adds the base layers and overlays to the map,
  // and sets teh default layer.
  /**
   * Removes the current layers, adds the base layers and overlays to the map,
   * and sets teh default layer.
   * @param {AstroMap} map - Map to add layers to.
   */
  addTo: function(map) {
    // Remove old layers
    map.eachLayer(function(layer) {
+18 −8
Original line number Diff line number Diff line
@@ -8,8 +8,12 @@ import "leaflet";
 * Uses predefined GUI elements.
 */
export default L.Control.Projection = L.Control.extend({
  // @method onAdd(map: AstroMap)
  // Grabs the button GUI elements and adds onclick events to them.
 
  /**
   * Grabs the button GUI elements and adds onclick events to them.
   * @param  {AstroMap} map - The map to add the control to.
   * @return {Div} Container containing the projection buttons.
   */
  onAdd: function(map) {
    let container = L.DomUtil.create("div");

@@ -23,22 +27,28 @@ export default L.Control.Projection = L.Control.extend({
    return container;
  },

  // @method loadNorthPolar(e: DomEvent)
  // Sets the map's projection to north-polar stereographic.
  /**
   * Sets the map's projection to north-polar stereographic.
   * @param  {Event} e - Onclick event.
   */
  loadNorthPolar: function(e) {
    let center = [90, 0];
    this._map.changeProjection("northPolar", center);
  },

  // @method loadSouthPolar(e: DomEvent)
  // Sets the map's projection to south-polar stereographic.
  /**
   * Sets the map's projection to south-polar stereographic.
   * @param  {Event} e - Onclick event.
   */
  loadSouthPolar: function(e) {
    let center = [-90, 0];
    this._map.changeProjection("southPolar", center);
  },

  // @method loadGeodesic(e: DomEvent)
  // Sets the map's projection to geodesic.
  /**
   * Sets the map's projection to cylindrical.
   * @param  {Event} e - Onclick event.
   */
  loadCylindrical: function(e) {
    let center = [0, 0];
    this._map.changeProjection("cylindrical", center);