forked from bcsf-renass/namazu-ts
No description
- TypeScript 100%
| src | ||
| .gitignore | ||
| .npmignore | ||
| .prettierignore | ||
| .prettierrc | ||
| bun.lock | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsconfig.tsbuildinfo | ||
| tsconfig.types.json | ||
| typedoc.json | ||
Namazu-ts
To install dependencies:
bun install
To build library:
bun run build
Small example
import 'maplibre-gl/dist/maplibre-gl.css';
import maplibregl from 'maplibre-gl';
import {
SismoMap,
type EventGeoJSON,
Client,
type EventQueryOptions,
} from 'namazu-ts';
const smap = new maplibregl.Map({
container: 'map-container',
style: /*Your tile server*/,
center: [0, 0],
maxPitch: 60,
zoom: 1, // Low value at the start so we get a "zoom in" animation when loading
attributionControl: false,
});
let map: SismoMap = new SismoMap('demo', smap, 'fr');
// All our requests will have api.franceseisme.fr as baseURL
let client: Client = new Client('https://api.franceseisme.fr');
let args: EventQueryOptions = {
limit: 100,
maximal_latitude: 52,
maximal_longitude: 10,
minimal_latitude: 40,
minimal_longitude: -6,
minimal_magnitude : 1,
maximal_magnitude : 4,
};
client.getEvents(args).then((events: EventGeoJSON) => {
map.displayEvents(events, true, true);
});