Unverified Commit 757efd46 authored by Jacob Kaufman's avatar Jacob Kaufman Committed by GitHub
Browse files

Merge pull request #107 from jkaufy/master

Updated Coordinate Class/ Draw Class . Uploading Jupyter Docs
parents 9b0d4465 f757db77
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -106,8 +106,6 @@ export default L.Control.AstroDrawControl = L.Control.Draw.extend({

    let wktValue = this.wktTextBox.value;

    this.wktTextBox.value = "";

    try {
      this.wkt.read(wktValue);
    } catch (err) {
+2 −6
Original line number Diff line number Diff line
@@ -81,15 +81,11 @@ export default class AstroMath {
   *
   * @param  {boolean} projection - The current projection of the map
   * 
   *
   * @return {double} The converted longitude range.
   */
  lonTo360(lon, projection) {
    let convertedLon = lon;

    if (projection === "EPSG:4326") {
      convertedLon -= 180;
    }

    if (convertedLon < 0) {
      convertedLon += 360;
    } 
@@ -112,7 +108,7 @@ export default class AstroMath {
    if (normalRange) {
      convertedLng *= -1;
    } else {
      convertedLng = Math.abs(convertedLng - 360);
      convertedLng = 360 - convertedLng;
    }

    return convertedLng;
+4 −4
Original line number Diff line number Diff line
@@ -70,10 +70,10 @@ describe('Testing AstroMath Functions', function() {
    })

    // testing lonTo360 function
    it('Testing lonTo360 Non-Cylindrical: -180 should be 0 ', function() {
    it('Testing lonTo360 Non-Cylindrical: -180 should be 180 ', function() {
      // add an assertion
      let majorRadius = testMath.lonTo360(-180, "");
      expect(majorRadius).to.equal(0);
      expect(majorRadius).to.equal(180);
    })

    // testing domainToPositiveWest function
@@ -86,8 +86,8 @@ describe('Testing AstroMath Functions', function() {
    // testing domainToPositiveWest function
    it('Testing domainToPositiveWest Not Normal Range: 0 should be 360 ', function() {
      // add an assertion
      let majorRadius = testMath.domainToPositiveWest(0, false);
      expect(majorRadius).to.equal(360);
      let majorRadius = testMath.domainToPositiveWest(-180, false);
      expect(majorRadius).to.equal(180);
    })

    // testing wrapLongitude function
+4 −3
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ class planetary_maps:
        :type targetName: String
        :param targetName: The name of the target you wish to map.
        """
        self.target_name = targetName
        self.target_name = targetName.lower()
        self.layers = []
        self.overlays = []
        self.planet_map = None
@@ -142,7 +142,8 @@ class planetary_maps:
                    lng = -180 + (abs(lng) % 180)

            if self.gui.get_longitude_range().value == "0 to 360":
                lng += 180
                if(lng < 0):
                    lng += 360

            if self.gui.get_lat_domain().value == "Planetographic":
                converted_latitude = Math.radians(lat)
@@ -155,7 +156,7 @@ class planetary_maps:
                if(self.gui.get_longitude_range().value == "-180 to 180"):
                    lng *= -1
                else:
                    lng = Math.fabs(lng - 360)
                    lng = 360 - lng

            self.gui.get_lat_lon_label().value = "Lat, Lon: " + \
                str(round(lat, 2)) + ", " + str(round(lng, 2))
Loading