namazu-ts 1.1.1 → 1.1.3

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 (54) hide show
  1. package/dist/browser/index.js +21 -3
  2. package/dist/node/index.js +21 -3
  3. package/dist/types.d.ts +1 -0
  4. package/docs/classes/SismoMap.html +5 -5
  5. package/docs/enums/SortType.html +2 -2
  6. package/docs/types/Answer.html +2 -2
  7. package/docs/types/CleanedEventQueryOptions.html +1 -1
  8. package/docs/types/ContourFeature.html +2 -2
  9. package/docs/types/ContourGeoJSON.html +2 -2
  10. package/docs/types/EventCity.html +2 -2
  11. package/docs/types/EventFeature.html +2 -2
  12. package/docs/types/EventGeoJSON.html +2 -2
  13. package/docs/types/EventGeoJSONProperties.html +2 -2
  14. package/docs/types/EventGeojsonDescriptionProperty.html +2 -2
  15. package/docs/types/EventPhases.html +1 -1
  16. package/docs/types/EventQueryOptions.html +2 -2
  17. package/docs/types/EventTestimony.html +2 -2
  18. package/docs/types/EventTestimonyGeoJSON.html +2 -2
  19. package/docs/types/FDSNQueryOptions.html +2 -2
  20. package/docs/types/FilterQuery.html +2 -2
  21. package/docs/types/Form.html +2 -2
  22. package/docs/types/FormCity.html +2 -2
  23. package/docs/types/GeoJSON.html +1 -1
  24. package/docs/types/Intensity.html +2 -2
  25. package/docs/types/IntensityGeoJSON.html +2 -2
  26. package/docs/types/Magnitude.html +2 -2
  27. package/docs/types/NamazuEvent.html +2 -2
  28. package/docs/types/Origin.html +2 -2
  29. package/docs/types/Phase.html +2 -2
  30. package/docs/types/Quality.html +2 -2
  31. package/docs/types/Question.html +2 -2
  32. package/docs/types/QuestionChoice.html +2 -2
  33. package/docs/types/QuestionCondition.html +1 -1
  34. package/docs/types/QuestionGroup.html +2 -2
  35. package/docs/types/Station.html +2 -2
  36. package/docs/types/StationFeature.html +1 -1
  37. package/docs/types/StationGeoJSON.html +2 -2
  38. package/docs/types/Street.html +2 -2
  39. package/docs/types/Survey.html +2 -2
  40. package/docs/types/Testimony.html +2 -2
  41. package/docs/types/Uncertainty.html +2 -2
  42. package/docs/types/Zone.html +2 -2
  43. package/docs/types/ZoneDesc.html +2 -2
  44. package/docs/types/Zones.html +2 -2
  45. package/docs/variables/EventRadius.html +1 -1
  46. package/docs/variables/EventTypes.html +1 -1
  47. package/docs/variables/IntensitiesColors.html +1 -1
  48. package/docs/variables/Intervals.html +1 -1
  49. package/docs/variables/MagnitudesColors.html +1 -1
  50. package/docs/variables/SortFilters.html +1 -1
  51. package/docs/variables/ZoneNames.html +1 -1
  52. package/package.json +1 -1
  53. package/src/sismomap.ts +27 -5
  54. package/src/types.ts +1 -0
@@ -31258,7 +31258,11 @@ class SismoMap {
31258
31258
  "circle-stroke-opacity": 0.9
31259
31259
  }
31260
31260
  });
31261
- const titles = ["events" /* EVENTS */, "stations" /* STATIONS */];
31261
+ const titles = [
31262
+ "events" /* EVENTS */,
31263
+ "stations" /* STATIONS */,
31264
+ "int_contours" /* CONTOURS */
31265
+ ];
31262
31266
  titles.forEach((title) => {
31263
31267
  map.on("mouseenter", title, (e) => {
31264
31268
  if (this._showDescription) {
@@ -31266,8 +31270,13 @@ class SismoMap {
31266
31270
  if (e.features === undefined)
31267
31271
  return;
31268
31272
  const text = JSON.parse(e.features[0].properties.description);
31269
- const feature = e.features[0];
31270
- const [lng, lat] = feature.geometry.coordinates;
31273
+ let lng, lat;
31274
+ if (["symbol", "circle"].includes(e.features[0].layer.type)) {
31275
+ const feature = e.features[0];
31276
+ [lng, lat] = feature.geometry.coordinates;
31277
+ } else {
31278
+ [lng, lat] = [e.lngLat.lng, e.lngLat.lat];
31279
+ }
31271
31280
  this._descPopups[0].setLngLat([lng, lat]).setHTML(text[lang]).addTo(map);
31272
31281
  this._descPopups[0].getElement().style.color = "black";
31273
31282
  this._descPopups[0].getElement().style.pointerEvents = "none !important";
@@ -31470,6 +31479,15 @@ class SismoMap {
31470
31479
  moveView = false,
31471
31480
  clear = false
31472
31481
  }) {
31482
+ for (let i = 0;i < contours.features.length; i++) {
31483
+ const props = contours.features[i].properties;
31484
+ if (props.description === undefined) {
31485
+ props.description = {
31486
+ fr: props.value + " " + props.units,
31487
+ en: props.value + " " + props.units
31488
+ };
31489
+ }
31490
+ }
31473
31491
  this.displayGeoJSON({
31474
31492
  geojson: contours,
31475
31493
  sourceName: "int_contours" /* CONTOURS */,
@@ -43796,7 +43796,11 @@ class SismoMap {
43796
43796
  "circle-stroke-opacity": 0.9
43797
43797
  }
43798
43798
  });
43799
- const titles = ["events" /* EVENTS */, "stations" /* STATIONS */];
43799
+ const titles = [
43800
+ "events" /* EVENTS */,
43801
+ "stations" /* STATIONS */,
43802
+ "int_contours" /* CONTOURS */
43803
+ ];
43800
43804
  titles.forEach((title) => {
43801
43805
  map.on("mouseenter", title, (e) => {
43802
43806
  if (this._showDescription) {
@@ -43804,8 +43808,13 @@ class SismoMap {
43804
43808
  if (e.features === undefined)
43805
43809
  return;
43806
43810
  const text = JSON.parse(e.features[0].properties.description);
43807
- const feature = e.features[0];
43808
- const [lng, lat] = feature.geometry.coordinates;
43811
+ let lng, lat;
43812
+ if (["symbol", "circle"].includes(e.features[0].layer.type)) {
43813
+ const feature = e.features[0];
43814
+ [lng, lat] = feature.geometry.coordinates;
43815
+ } else {
43816
+ [lng, lat] = [e.lngLat.lng, e.lngLat.lat];
43817
+ }
43809
43818
  this._descPopups[0].setLngLat([lng, lat]).setHTML(text[lang]).addTo(map);
43810
43819
  this._descPopups[0].getElement().style.color = "black";
43811
43820
  this._descPopups[0].getElement().style.pointerEvents = "none !important";
@@ -44008,6 +44017,15 @@ class SismoMap {
44008
44017
  moveView = false,
44009
44018
  clear = false
44010
44019
  }) {
44020
+ for (let i = 0;i < contours.features.length; i++) {
44021
+ const props = contours.features[i].properties;
44022
+ if (props.description === undefined) {
44023
+ props.description = {
44024
+ fr: props.value + " " + props.units,
44025
+ en: props.value + " " + props.units
44026
+ };
44027
+ }
44028
+ }
44011
44029
  this.displayGeoJSON({
44012
44030
  geojson: contours,
44013
44031
  sourceName: "int_contours" /* CONTOURS */,
package/dist/types.d.ts CHANGED
@@ -25,6 +25,7 @@ export type ContourFeature = {
25
25
  units: string;
26
26
  color: string;
27
27
  weight: number;
28
+ description: EventGeojsonDescriptionProperty;
28
29
  };
29
30
  geometry: {
30
31
  type: string;