Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
};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);
}
});
}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);getUrl: function(product: any) {
if (product === null) {
return null;
}
return product.contents['download/stationlist.json']
? product.contents['download/stationlist.json'].url
: null;
},getUrl: function(product: any) {
if (product === null) {
return null;
}
return product.contents['download/stationlist.json']
? product.contents['download/stationlist.json'].url
: null;
},