namazu-ts 0.2.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -6
- package/dist/browser/index.js +29814 -29528
- package/dist/maputils.d.ts +0 -3
- package/dist/node/index.js +30977 -30691
- package/dist/sismomap.d.ts +2 -4
- package/dist/types.d.ts +4 -1
- package/docs/assets/highlight.css +27 -6
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/LngLatBounds.html +13 -13
- package/docs/classes/SismoMap.html +4 -5
- package/docs/functions/EventToEventGeoJSON.html +3 -1
- package/docs/index.html +6 -1
- package/docs/modules.html +1 -1
- package/docs/types/Answer.html +2 -2
- package/docs/types/City.html +2 -2
- package/docs/types/CleanedFDSNQueryOptions.html +1 -1
- package/docs/types/EventFeature.html +2 -2
- package/docs/types/EventGeoJSON.html +2 -2
- package/docs/types/EventPhases.html +1 -1
- package/docs/types/FDSNQueryOptions.html +2 -2
- package/docs/types/Form.html +2 -2
- package/docs/types/GeoJSON.html +1 -1
- package/docs/types/InfosPhase.html +2 -2
- package/docs/types/Magnitude.html +2 -2
- package/docs/types/Origin.html +2 -2
- package/docs/types/Question.html +2 -2
- package/docs/types/QuestionChoice.html +2 -2
- package/docs/types/QuestionCondition.html +1 -1
- package/docs/types/QuestionGroup.html +2 -2
- package/docs/types/SisEvent.html +2 -2
- package/docs/types/Station.html +2 -2
- package/docs/types/StationGeoJSON.html +2 -2
- package/docs/types/StationPhases.html +1 -1
- package/docs/types/Street.html +2 -2
- package/docs/types/Survey.html +2 -2
- package/docs/types/Testimony.html +2 -2
- package/docs/types/Zone.html +2 -2
- package/docs/types/Zones.html +2 -2
- package/docs/variables/MagnitudesColors.html +1 -0
- package/docs/variables/ZoneNames.html +1 -1
- package/package.json +4 -4
- package/src/maputils.ts +3 -83
- package/src/sismomap.ts +104 -6
- package/src/types.ts +25 -2
- package/docs/functions/createMap.html +0 -6
package/README.md
CHANGED
|
@@ -18,20 +18,25 @@ ___
|
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
20
|
|
|
21
|
-
// Need to import maplibre-gl css or it may not work
|
|
22
21
|
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
22
|
+
import maplibregl from 'maplibre-gl';
|
|
23
23
|
import {
|
|
24
|
-
createMap,
|
|
25
24
|
SismoMap,
|
|
26
25
|
type EventGeoJSON,
|
|
27
26
|
Client,
|
|
28
27
|
type FDSNQueryOptions,
|
|
29
28
|
} from 'namazu-ts';
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
const smap = new maplibregl.Map({
|
|
31
|
+
container: 'map-container',
|
|
32
|
+
style: /*Your tile server*/,
|
|
33
|
+
center: [0, 0],
|
|
34
|
+
maxPitch: 60,
|
|
35
|
+
zoom: 1, // Low value at the start so we get a "zoom in" animation when loading
|
|
36
|
+
attributionControl: false,
|
|
37
|
+
});
|
|
38
|
+
let map: SismoMap = new SismoMap('demo', smap, 'fr');
|
|
39
|
+
|
|
35
40
|
// All our requests will have api.franceseisme.fr as baseURL
|
|
36
41
|
let client: Client = new Client('https://api.franceseisme.fr');
|
|
37
42
|
|