namazu-ts 1.1.1 → 1.1.2

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 +22 -3
  2. package/dist/node/index.js +22 -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 +28 -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,14 @@ 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
+ console.log(e);
31274
+ let lng, lat;
31275
+ if (["symbol", "circle"].includes(e.features[0].layer.type)) {
31276
+ const feature = e.features[0];
31277
+ [lng, lat] = feature.geometry.coordinates;
31278
+ } else {
31279
+ [lng, lat] = [e.lngLat.lng, e.lngLat.lat];
31280
+ }
31271
31281
  this._descPopups[0].setLngLat([lng, lat]).setHTML(text[lang]).addTo(map);
31272
31282
  this._descPopups[0].getElement().style.color = "black";
31273
31283
  this._descPopups[0].getElement().style.pointerEvents = "none !important";
@@ -31470,6 +31480,15 @@ class SismoMap {
31470
31480
  moveView = false,
31471
31481
  clear = false
31472
31482
  }) {
31483
+ for (let i = 0;i < contours.features.length; i++) {
31484
+ const props = contours.features[i].properties;
31485
+ if (props.description === undefined) {
31486
+ props.description = {
31487
+ fr: props.value + " " + props.units,
31488
+ en: props.value + " " + props.units
31489
+ };
31490
+ }
31491
+ }
31473
31492
  this.displayGeoJSON({
31474
31493
  geojson: contours,
31475
31494
  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,14 @@ 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
+ console.log(e);
43812
+ let lng, lat;
43813
+ if (["symbol", "circle"].includes(e.features[0].layer.type)) {
43814
+ const feature = e.features[0];
43815
+ [lng, lat] = feature.geometry.coordinates;
43816
+ } else {
43817
+ [lng, lat] = [e.lngLat.lng, e.lngLat.lat];
43818
+ }
43809
43819
  this._descPopups[0].setLngLat([lng, lat]).setHTML(text[lang]).addTo(map);
43810
43820
  this._descPopups[0].getElement().style.color = "black";
43811
43821
  this._descPopups[0].getElement().style.pointerEvents = "none !important";
@@ -44008,6 +44018,15 @@ class SismoMap {
44008
44018
  moveView = false,
44009
44019
  clear = false
44010
44020
  }) {
44021
+ for (let i = 0;i < contours.features.length; i++) {
44022
+ const props = contours.features[i].properties;
44023
+ if (props.description === undefined) {
44024
+ props.description = {
44025
+ fr: props.value + " " + props.units,
44026
+ en: props.value + " " + props.units
44027
+ };
44028
+ }
44029
+ }
44011
44030
  this.displayGeoJSON({
44012
44031
  geojson: contours,
44013
44032
  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;