Commit a8d077b7 authored by Kaitlyn's avatar Kaitlyn
Browse files

Fixed coordinates issue so that shapes reproject correctly.

parent 74ac749b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -92,11 +92,11 @@ export default L.Map.AstroMap = L.Map.extend({
    let newCRS = null;
    if (name == "cylindrical") {
      newCRS = this._defaultProj;
      this._currentProj = "EPSG:4326";
    } else {
      let proj = this._astroProj.getStringAndCode(this._target, name);
      newCRS = new L.Proj.CRS(proj["code"], proj["string"], {
        resolutions: [8192, 4096, 2048, 1024, 512, 256, 128],
        origin: [0, 0]
        resolutions: [8192, 4096, 2048, 1024, 512, 256, 128]
      });
      this._currentProj = proj["code"];
    }
+12 −3
Original line number Diff line number Diff line
@@ -47,18 +47,27 @@ export default class AstroProj {
      return {
        code: "EPSG:32661",
        string:
          "+proj=stere +lat_0=90 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=${radii['a']} +b=${radii['c']} +units=m +no_defs"
          "+proj=stere +lat_0=90 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=" +
          radii["a"] +
          " +b=" +
          radii["c"] +
          " +units=m +no_defs"
      };
    } else if (name == "southPolar") {
      return {
        code: "EPSG:32761",
        string:
          "+proj=stere +lat_0=-90 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=${radii['a']} +b=${radii['c']} +units=m +no_defs"
          "+proj=stere +lat_0=-90 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=" +
          radii["a"] +
          " +b=" +
          radii["c"] +
          " +units=m +no_defs"
      };
    } else if (name == "cylindrical") {
      return {
        code: "EPSG:4326",
        string: "+proj=longlat +a=${radii['a']} +b=${radii['c']} +no_defs"
        string:
          "+proj=longlat +a=" + radii["a"] + " +b=" + radii["c"] + " +no_defs"
      };
    } else {
      console.log("No projection found for the target and name given.");