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.
Files changed (46) hide show
  1. package/README.md +11 -6
  2. package/dist/browser/index.js +29814 -29528
  3. package/dist/maputils.d.ts +0 -3
  4. package/dist/node/index.js +30977 -30691
  5. package/dist/sismomap.d.ts +2 -4
  6. package/dist/types.d.ts +4 -1
  7. package/docs/assets/highlight.css +27 -6
  8. package/docs/assets/navigation.js +1 -1
  9. package/docs/assets/search.js +1 -1
  10. package/docs/classes/LngLatBounds.html +13 -13
  11. package/docs/classes/SismoMap.html +4 -5
  12. package/docs/functions/EventToEventGeoJSON.html +3 -1
  13. package/docs/index.html +6 -1
  14. package/docs/modules.html +1 -1
  15. package/docs/types/Answer.html +2 -2
  16. package/docs/types/City.html +2 -2
  17. package/docs/types/CleanedFDSNQueryOptions.html +1 -1
  18. package/docs/types/EventFeature.html +2 -2
  19. package/docs/types/EventGeoJSON.html +2 -2
  20. package/docs/types/EventPhases.html +1 -1
  21. package/docs/types/FDSNQueryOptions.html +2 -2
  22. package/docs/types/Form.html +2 -2
  23. package/docs/types/GeoJSON.html +1 -1
  24. package/docs/types/InfosPhase.html +2 -2
  25. package/docs/types/Magnitude.html +2 -2
  26. package/docs/types/Origin.html +2 -2
  27. package/docs/types/Question.html +2 -2
  28. package/docs/types/QuestionChoice.html +2 -2
  29. package/docs/types/QuestionCondition.html +1 -1
  30. package/docs/types/QuestionGroup.html +2 -2
  31. package/docs/types/SisEvent.html +2 -2
  32. package/docs/types/Station.html +2 -2
  33. package/docs/types/StationGeoJSON.html +2 -2
  34. package/docs/types/StationPhases.html +1 -1
  35. package/docs/types/Street.html +2 -2
  36. package/docs/types/Survey.html +2 -2
  37. package/docs/types/Testimony.html +2 -2
  38. package/docs/types/Zone.html +2 -2
  39. package/docs/types/Zones.html +2 -2
  40. package/docs/variables/MagnitudesColors.html +1 -0
  41. package/docs/variables/ZoneNames.html +1 -1
  42. package/package.json +4 -4
  43. package/src/maputils.ts +3 -83
  44. package/src/sismomap.ts +104 -6
  45. package/src/types.ts +25 -2
  46. 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
- // Setting up the environment for the libraru
32
- // Creates a map named demo inside the 'map-container' id div with french language
33
- // The map-container should be created by the user inside the HTML
34
- let map: SismoMap = await createMap('demo', 'map-container', 'fr');
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