Unverified Commit 2266eadc authored by Jacob Kaufman's avatar Jacob Kaufman Committed by GitHub
Browse files

Merge pull request #89 from kaitlyndlee/fixed_polar

Fixed weird behavior when swapping between polar projections
parents 14081e09 d7d638bd
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -89,10 +89,14 @@ export default L.Map.AstroMap = L.Map.extend({
   * @param {List} center - Center of map based off of projection.
   */
  changeProjection: function(name, center) {
    if (this._currentProj == "EPSG:4326") {
      // Reset the view before changing the projection since
      // an exception may be thrown when swapping to a polar
    // projection and the zoom level is 7+.
      // projection from cylindrcal and the zoom level is 7+.
      // proj has trouble unprojecting points in cylindrical
      // at such a high zoom level.
      this.setView(center, 1, true);
    }

    let newCRS = null;
    if (name == "cylindrical") {