Commit 5991022f authored by Scott Ames's avatar Scott Ames
Browse files

replaced imports

parent b10a5921
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
    "build": "webpack --config webpack.prod.js",
    "lint": "eslint --ext .js src",
    "test": "mocha --require @babel/register",
    "fix": "npm run lint -- --fix",
    "fix": "npm run lint --fix",
    "prettier-watch": "onchange '**/*.js' -- prettier --write {{changed}}",
    "generate-docs": "node_modules/.bin/jsdoc src/js/  --configure .jsdoc.json --verbose"
  },
+4 −3
Original line number Diff line number Diff line
import L from "leaflet";
import "leaflet-draw";
import Wkt from "wicket";

@@ -26,7 +27,7 @@ export default L.Control.AstroDrawControl = L.Control.Draw.extend({
  options: {
    position: "topleft",
    draw: { circle: false, marker: false, circlemarker: false },
    edit: false
    edit: false,
  },

  /**
@@ -119,11 +120,11 @@ export default L.Control.AstroDrawControl = L.Control.Draw.extend({

    let geojsonFeature = {
      type: "Feature",
      geometry: geoJson
      geometry: geoJson,
    };

    this.myLayer.addData(geojsonFeature);
  }
  },

  // reprojectFeature: function(e) {

+7 −6
Original line number Diff line number Diff line
import AstroProj from "./AstroProj";
import LayerCollection from "./LayerCollection";
import L from "leaflet";
import { MY_JSON_MAPS } from "./layers";

/**
@@ -29,7 +30,7 @@ export default L.Map.AstroMap = L.Map.extend({
    zoom: 1,
    maxZoom: 8,
    attributionControl: false,
    fullscreenControl: true
    fullscreenControl: true,
  },

  initialize: function(mapDiv, target, options) {
@@ -38,7 +39,7 @@ export default L.Map.AstroMap = L.Map.extend({
    this._astroProj = new AstroProj();
    this._radii = {
      a: "",
      c: ""
      c: "",
    };

    // Set by layer collection or baselayerchange event
@@ -54,7 +55,7 @@ export default L.Map.AstroMap = L.Map.extend({

    // Could not work with _
    this.layers = {
      cylindrical: new LayerCollection("cylindrical", cylLayerInfo)
      cylindrical: new LayerCollection("cylindrical", cylLayerInfo),
    };

    let northLayerInfo = this.parseJSON("north-polar stereographic");
@@ -115,7 +116,7 @@ export default L.Map.AstroMap = L.Map.extend({
    let layers = {
      base: [],
      overlays: [],
      wfs: []
      wfs: [],
    };

    let targets = MY_JSON_MAPS["targets"];
@@ -178,7 +179,7 @@ export default L.Map.AstroMap = L.Map.extend({
    } else {
      let proj = this._astroProj.getStringAndCode(name, this._radii);
      newCRS = new L.Proj.CRS(proj["code"], proj["string"], {
        resolutions: [8192, 4096, 2048, 1024, 512, 256, 128]
        resolutions: [8192, 4096, 2048, 1024, 512, 256, 128],
      });
      this._currentProj = proj["code"];
      this.setMaxZoom(6);
@@ -263,5 +264,5 @@ export default L.Map.AstroMap = L.Map.extend({
   */
  radii: function() {
    return this._radii;
  }
  },
});
+7 −5
Original line number Diff line number Diff line
import L from "leaflet";

/**
 * @class LayerCollection
 * @aka L.Class.LayerCollection
@@ -43,7 +45,7 @@ export default L.LayerCollection = L.Class.extend({
      let baseLayer = L.tileLayer.wms(
        String(layer["url"]) + "?map=" + String(layer["map"]),
        {
          layers: String(layer["layer"])
          layers: String(layer["layer"]),
        }
      );
      let name = String(layer["displayname"]);
@@ -64,7 +66,7 @@ export default L.LayerCollection = L.Class.extend({
        {
          layers: String(layer["layer"]),
          transparent: true,
          format: "image/png"
          format: "image/png",
        }
      );
      let name = String(layer["displayname"]);
@@ -176,7 +178,7 @@ export default L.LayerCollection = L.Class.extend({
      version: "1.1.0",
      request: "GetFeature",
      outputFormat: "application/json",
      srsName: "EPSG:4326"
      srsName: "EPSG:4326",
    };

    let parameters = L.Util.extend(defaultParameters);
@@ -192,7 +194,7 @@ export default L.LayerCollection = L.Class.extend({
        data["features"] = sortedFeatures;
        thisContext._wfsLayer.clearLayers();
        thisContext._wfsLayer.addData(data);
      }
      },
    });
  },

@@ -214,5 +216,5 @@ export default L.LayerCollection = L.Class.extend({
        return 0;
      }
    });
  }
  },
});
+5 −3
Original line number Diff line number Diff line
import L from "leaflet";
import AstroMath from "./AstroMath";

/**
 * @class MousePositionControl
 * @aka L.Control.MousePositionControl
@@ -18,7 +20,7 @@ export default L.Control.MousePositionControl = L.Control.extend({
    separator: ", ",
    numDigits: 5,
    prefix: "",
    lngFirst: true
    lngFirst: true,
  },

  /**
@@ -152,7 +154,7 @@ export default L.Control.MousePositionControl = L.Control.extend({
  onMouseOut(e) {
    this.lonDisplayElement.innerHTML = "---.---";
    this.latDisplayElement.innerHTML = "---.---";
  }
  },
});

/**
@@ -161,7 +163,7 @@ export default L.Control.MousePositionControl = L.Control.extend({
 * @description Turns position control false.
 */
L.Map.mergeOptions({
  positionControl: false
  positionControl: false,
});

/**
Loading