How to use the download/stationlist.json function in download

To help you get started, we’ve selected a few download examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github usgs / earthquake-eventpages / src / htdocs / modules / summary / InteractiveMap.js View on Github external
if (this._event.properties.products.shakemap) {
      var contourLayer = null,
          shakemap = this._event.properties.products.shakemap[0],
          shakemapContents = shakemap.contents;

      if ('download/cont_mi.json' in shakemapContents) {
        this._contourLayer = contourLayer = new ContoursLayer({
          url: shakemapContents['download/cont_mi.json'].url
        });
        layerControl.addOverlay(contourLayer, 'ShakeMap MMI Contours');
        contourLayer.addTo(map);
      }

      if ('download/stationlist.json' in shakemapContents) {
        this._stationLayer = new ShakeMapStationLayer(
            shakemapContents['download/stationlist.json'].url);
        layerControl.addOverlay(this._stationLayer, 'ShakeMap Stations');
      }
    }
  }

  // Add Map Controls
  if (!Util.isMobile()) {
    map.addControl(new MousePosition());
    map.addControl(new L.Control.Scale({'position':'bottomleft'}));
  }
  map.addControl(layerControl);

  this._content.appendChild(_el);
  this._content.appendChild(this._closeButton);
};
github usgs / earthquake-eventpages / src / app / core / station.service.ts View on Github external
getStations (product: any): void {
    if ((product == null) ||
          (!product.contents['download/stationlist.json'])) {

      this.stationsJson$.next(null);
      return;
    }

    const stations = product.contents['download/stationlist.json'];

    this.httpClient.get(stations.url).pipe(
      catchError(this.handleError())
    ).subscribe((response) => {
      try {
        this.onStations(response);
      } catch (e) {
        /*  Processing errored */
        this.error = e;
        this.stationsJson$.next(null);
      }
    });
  }
github usgs / earthquake-eventpages / src / app / core / station.service.ts View on Github external
getStations (product: any): void {
    if ((product == null) ||
          (!product.contents['download/stationlist.json'])) {

      this.stationsJson$.next(null);
      return;
    }

    const stations = product.contents['download/stationlist.json'];

    this.httpClient.get(stations.url).pipe(
      catchError(this.handleError())
    ).subscribe((response) => {
      try {
        this.onStations(response);
      } catch (e) {
        /*  Processing errored */
        this.error = e;
        this.stationsJson$.next(null);
github usgs / earthquake-eventpages / src / app / shared / map-overlay / shakemap-stations-overlay.ts View on Github external
getUrl: function(product: any) {
    if (product === null) {
      return null;
    }

    return product.contents['download/stationlist.json']
      ? product.contents['download/stationlist.json'].url
      : null;
  },
github usgs / earthquake-eventpages / src / app / shared / map-overlay / shakemap-stations-overlay.ts View on Github external
getUrl: function(product: any) {
    if (product === null) {
      return null;
    }

    return product.contents['download/stationlist.json']
      ? product.contents['download/stationlist.json'].url
      : null;
  },