geonet
Version:
A Node.js API wrapper for GeoNet — Aotearoa's geological hazard monitoring system.
29 lines (28 loc) • 1.32 kB
TypeScript
import { Geometry, MMI } from "../../@types/common";
/**
* Utility class for generating GeoNet earthquake map URLs.
*
* @since 1.0.0
*/
export declare class QuakeMapUtil {
protected readonly baseMapURL = "https://static.geonet.org.nz/maps/4/quake/xxxhdpi/";
/**
* Generates a link to the GeoNet quake map URL for a given set of coordinates and MMI.
*
* @param {Geometry["coordinates"]} coordinates - The coordinates of the quake. Position 0 is the longitude, and position 1 is the latitude.
* @param {MMI} mmi - The New Zealand Modified Mercalli Intensity of the quake.
* @returns {string} - The URL string for the quake map.
* @throws {Error} - Throws an error if the coordinates are invalid or if the MMI is not provided.
* @since 1.0.0
*/
generateMapURL(coordinates: Geometry["coordinates"], mmi: MMI): string;
/**
* Generates a colour code for a given MMI, which corresponds to the marker colour on GeoNet maps.
*
* @param {MMI} mmi - The New Zealand Modified Mercalli Intensity of the quake.
* @returns {string} - The hex code colour for the earthquake based off of the MMI.
* @throws {Error} - Throws an error if the MMI is not provided, or is invalid.
* @since 1.1.0
*/
generateColourCode(mmi: MMI): string;
}