Commit fbdfddf5 authored by Jacob Cain's avatar Jacob Cain
Browse files

removed layers.js, use initial fetched one instead

parent af15b849
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ export default function App() {

    (async () => {
        aggregateMapList = await getStacAndAstroWebMapsData();
        setMainComponent(<GeoStacApp mapList={aggregateMapList}/>);
        setMainComponent(<GeoStacApp mapList={aggregateMapList} astroWebMaps={mapsJson[astroWebMaps]}/>);
    })();

  }, [])
+1 −3
Original line number Diff line number Diff line
@@ -30,8 +30,6 @@ let css = {
export default function GeoStacApp(props) {
  const [targetPlanet, setTargetPlanet] = React.useState(props.mapList.systems[4].bodies[0]);

  const [footprintData, setFootprintData] = React.useState([]);

  const [queryString, setQueryString] = React.useState("?");
  const [collectionUrls, setCollectionUrls] = React.useState([]);

@@ -65,7 +63,7 @@ export default function GeoStacApp(props) {
            bodyChange={handleTargetBodyChange}
          />
          <div id="map-area">
            <MapContainer target={targetPlanet.name} />
            <MapContainer target={targetPlanet.name} astroWebMaps={props.astroWebMaps}/>
          </div>
          <QueryConsole
            queryString={queryString}
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ export default function MapContainer(props) {
   * handles all of the map intialization and creation.
   */
  useEffect( () => {
    let map = new AstroMap("map-container", props.target, {});
    let map = new AstroMap("map-container", props.target, props.astroWebMaps, {});
    let controlManager = new AstroControlManager(map);
    controlManager.addTo(map);
    setOldTarget(props.target)
@@ -48,7 +48,7 @@ export default function MapContainer(props) {
      document.getElementById("projectionSouthPole").classList.remove("disabled");

      // create new map with updated target
      let map = new AstroMap("map-container", props.target, {});
      let map = new AstroMap("map-container", props.target, props.astroWebMaps, {});
      let controlManager = new AstroControlManager(map);
      controlManager.addTo(map);
      setOldTarget(props.target)
+5 −4
Original line number Diff line number Diff line
@@ -4,8 +4,6 @@ import AstroProj from "./AstroProj";
import LayerCollection from "./LayerCollection";
import { setNumberMatched,
         setNumberReturned } from "./ApiJsonCollection";
import { MY_JSON_MAPS } from "./layers";


/**
 * @class AstroMap
@@ -26,6 +24,8 @@ import { MY_JSON_MAPS } from "./layers";
 *
 * @param {String} target - Name of target to display layers for.
 * 
 * @param {Object} myJsonMaps - Json fetched from AstroWebMaps
 *
 * @param {Object} options - Options for the map.
 */
export default L.Map.AstroMap = L.Map.extend({
@@ -37,9 +37,10 @@ export default L.Map.AstroMap = L.Map.extend({
    zoomControl: false
  },

  initialize: function(mapDiv, target, options) {
  initialize: function(mapDiv, target, jsonMaps, options) {
    this._mapDiv = mapDiv;
    this._target = target;
    this._jsonMaps = jsonMaps;
    this._astroProj = new AstroProj();
    this._radii = {
      a: "",
@@ -203,7 +204,7 @@ export default L.Map.AstroMap = L.Map.extend({
      wfs: []
    };

    let targets = MY_JSON_MAPS["targets"];
    let targets = this._jsonMaps["targets"];
    for (let i = 0; i < targets.length; i++) {
      let currentTarget = targets[i];

src/js/layers.js

deleted100644 → 0
+0 −5783

File deleted.

Preview size limit exceeded, changes collapsed.