namazu-ts 0.2.1 → 0.2.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.
- package/README.md +56 -0
- package/dist/browser/index.js +3 -1
- package/dist/node/index.js +3 -1
- package/docs/classes/SismoMap.html +1 -1
- package/package.json +1 -1
- package/src/sismomap.ts +2 -1
package/README.md
CHANGED
|
@@ -10,4 +10,60 @@ To build library:
|
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
bun run build
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
___
|
|
16
|
+
|
|
17
|
+
## Small example
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
|
|
21
|
+
// Need to import maplibre-gl css or it may not work
|
|
22
|
+
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
23
|
+
import {
|
|
24
|
+
createMap,
|
|
25
|
+
SismoMap,
|
|
26
|
+
type EventGeoJSON,
|
|
27
|
+
Client,
|
|
28
|
+
type FDSNQueryOptions,
|
|
29
|
+
} from 'namazu-ts';
|
|
30
|
+
|
|
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');
|
|
35
|
+
// All our requests will have api.franceseisme.fr as baseURL
|
|
36
|
+
let client: Client = new Client('https://api.franceseisme.fr');
|
|
37
|
+
|
|
38
|
+
// Creating the arguments of our FDSN Query
|
|
39
|
+
let args: FDSNQueryOptions = {
|
|
40
|
+
format: 'json', // Have to use json if we want to format it into EventGeoJSON after the apiCall
|
|
41
|
+
limit: 100,
|
|
42
|
+
maxlatitude: 52,
|
|
43
|
+
maxlongitude: 10,
|
|
44
|
+
minlatitude: 40,
|
|
45
|
+
minlongitude: -6,
|
|
46
|
+
minmagnitude: 0,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Cleaning out of useless arguments and detecting errors
|
|
50
|
+
let cArgs = client.cleanQuery(args);
|
|
51
|
+
// Handling of the result
|
|
52
|
+
cArgs.match(
|
|
53
|
+
(cleanargs) => {
|
|
54
|
+
// We build the query from the cleaned arguments and then call the API with said Query
|
|
55
|
+
let query = client.buildQuery('/fdsnws/event/1/query', cleanargs);
|
|
56
|
+
let events = client.apiCall<EventGeoJSON>(query);
|
|
57
|
+
// Once the promise resolves, we can display the events on the map
|
|
58
|
+
events.then((data: EventGeoJSON) => {
|
|
59
|
+
map.displayEvents(data);
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
(err: Error) => {
|
|
63
|
+
console.log('Wrong Query : ' + err);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
13
69
|
```
|
package/dist/browser/index.js
CHANGED
|
@@ -51858,8 +51858,10 @@ class SismoMap {
|
|
|
51858
51858
|
if (eventGeo.features.length != 1) {
|
|
51859
51859
|
return Promise.reject(Error("If passing a EventGeoJSON, it should only have one feature"));
|
|
51860
51860
|
}
|
|
51861
|
+
if (clear)
|
|
51862
|
+
this.clear();
|
|
51861
51863
|
if (!stationOnly)
|
|
51862
|
-
this.displayEvents(eventGeo, false,
|
|
51864
|
+
this.displayEvents(eventGeo, false, false);
|
|
51863
51865
|
let phasesPromise = client.getEventPhases(eventGeo);
|
|
51864
51866
|
let zone = await client.getZoneNameByEvent(eventGeo);
|
|
51865
51867
|
let stationList = await client.getStationsByZoneName(zone);
|
package/dist/node/index.js
CHANGED
|
@@ -63261,8 +63261,10 @@ class SismoMap {
|
|
|
63261
63261
|
if (eventGeo.features.length != 1) {
|
|
63262
63262
|
return Promise.reject(Error("If passing a EventGeoJSON, it should only have one feature"));
|
|
63263
63263
|
}
|
|
63264
|
+
if (clear)
|
|
63265
|
+
this.clear();
|
|
63264
63266
|
if (!stationOnly)
|
|
63265
|
-
this.displayEvents(eventGeo, false,
|
|
63267
|
+
this.displayEvents(eventGeo, false, false);
|
|
63266
63268
|
let phasesPromise = client.getEventPhases(eventGeo);
|
|
63267
63269
|
let zone = await client.getZoneNameByEvent(eventGeo);
|
|
63268
63270
|
let stationList = await client.getStationsByZoneName(zone);
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in src/sismomap.ts:49</li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="displayevents"><span>display<wbr/>Events</span><a href="#displayevents" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="displayevents-1"><span class="tsd-kind-call-signature">displayEvents</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">eventOrList</span><span class="tsd-signature-symbol">:</span> <a href="../types/SisEvent.html" class="tsd-signature-type tsd-kind-type-alias">SisEvent</a> <span class="tsd-signature-symbol">|</span> <a href="../types/EventGeoJSON.html" class="tsd-signature-type tsd-kind-type-alias">EventGeoJSON</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">moveView</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">clear</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#displayevents-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventOrList</span>: <a href="../types/SisEvent.html" class="tsd-signature-type tsd-kind-type-alias">SisEvent</a> <span class="tsd-signature-symbol">|</span> <a href="../types/EventGeoJSON.html" class="tsd-signature-type tsd-kind-type-alias">EventGeoJSON</a></span><div class="tsd-comment tsd-typography"><p>Can either be a single Event (via /events API) or a FDSN GeoJSON</p>
|
|
16
16
|
</div></li><li><span><span class="tsd-kind-parameter">moveView</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></span><div class="tsd-comment tsd-typography"><p>True = The view moves on the events' bounding box while displaying (does not affect user's possible behaviour on the map)</p>
|
|
17
17
|
</div></li><li><span><span class="tsd-kind-parameter">clear</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></span><div class="tsd-comment tsd-typography"><p>True = The map is cleared before displaying the events</p>
|
|
18
|
-
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in src/sismomap.ts:187</li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="displaystations"><span>display<wbr/>Stations</span><a href="#displaystations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="displaystations-1"><span class="tsd-kind-call-signature">displayStations</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">client</span><span class="tsd-signature-symbol">:</span> <a href="Client.html" class="tsd-signature-type tsd-kind-class">Client</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">:</span> <a href="../types/SisEvent.html" class="tsd-signature-type tsd-kind-type-alias">SisEvent</a> <span class="tsd-signature-symbol">|</span> <a href="../types/EventGeoJSON.html" class="tsd-signature-type tsd-kind-type-alias">EventGeoJSON</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">moveView</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">clear</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">stationOnly</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">model3D</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#displaystations-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">client</span>: <a href="Client.html" class="tsd-signature-type tsd-kind-class">Client</a></span></li><li><span><span class="tsd-kind-parameter">event</span>: <a href="../types/SisEvent.html" class="tsd-signature-type tsd-kind-type-alias">SisEvent</a> <span class="tsd-signature-symbol">|</span> <a href="../types/EventGeoJSON.html" class="tsd-signature-type tsd-kind-type-alias">EventGeoJSON</a></span></li><li><span><span class="tsd-kind-parameter">moveView</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></span></li><li><span><span class="tsd-kind-parameter">clear</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></span></li><li><span><span class="tsd-kind-parameter">stationOnly</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></span></li><li><span><span class="tsd-kind-parameter">model3D</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in src/sismomap.ts:63</li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="geteventnumber"><span>get<wbr/>Event<wbr/>Number</span><a href="#geteventnumber" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="geteventnumber-1"><span class="tsd-kind-call-signature">getEventNumber</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Result</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">></span><a href="#geteventnumber-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Result</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in src/sismomap.ts:308</li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getsourcegeojson"><span>get<wbr/>Source<wbr/>Geo<wbr/>JSON</span><a href="#getsourcegeojson" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getsourcegeojson-1"><span class="tsd-kind-call-signature">getSourceGeoJSON</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Result</span><span class="tsd-signature-symbol"><</span><a href="../types/EventGeoJSON.html" class="tsd-signature-type tsd-kind-type-alias">EventGeoJSON</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">></span><a href="#getsourcegeojson-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Result</span><span class="tsd-signature-symbol"><</span><a href="../types/EventGeoJSON.html" class="tsd-signature-type tsd-kind-type-alias">EventGeoJSON</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in src/sismomap.ts:319</li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#_layers"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_<wbr/>layers</span></a><a href="#_mapscene"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_<wbr/>mapscene</span></a><a href="#_sources"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_<wbr/>sources</span></a><a href="#descpopup"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>desc<wbr/>Popup</span></a><a href="#map"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>map</span></a><a href="#name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>name</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#clear"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>clear</span></a><a href="#displayevents"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>display<wbr/>Events</span></a><a href="#displaystations"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>display<wbr/>Stations</span></a><a href="#geteventnumber"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Event<wbr/>Number</span></a><a href="#getsourcegeojson"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Source<wbr/>Geo<wbr/>JSON</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">namazu-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
18
|
+
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in src/sismomap.ts:188</li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="displaystations"><span>display<wbr/>Stations</span><a href="#displaystations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="displaystations-1"><span class="tsd-kind-call-signature">displayStations</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">client</span><span class="tsd-signature-symbol">:</span> <a href="Client.html" class="tsd-signature-type tsd-kind-class">Client</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">:</span> <a href="../types/SisEvent.html" class="tsd-signature-type tsd-kind-type-alias">SisEvent</a> <span class="tsd-signature-symbol">|</span> <a href="../types/EventGeoJSON.html" class="tsd-signature-type tsd-kind-type-alias">EventGeoJSON</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">moveView</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">clear</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">stationOnly</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">model3D</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#displaystations-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">client</span>: <a href="Client.html" class="tsd-signature-type tsd-kind-class">Client</a></span></li><li><span><span class="tsd-kind-parameter">event</span>: <a href="../types/SisEvent.html" class="tsd-signature-type tsd-kind-type-alias">SisEvent</a> <span class="tsd-signature-symbol">|</span> <a href="../types/EventGeoJSON.html" class="tsd-signature-type tsd-kind-type-alias">EventGeoJSON</a></span></li><li><span><span class="tsd-kind-parameter">moveView</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></span></li><li><span><span class="tsd-kind-parameter">clear</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></span></li><li><span><span class="tsd-kind-parameter">stationOnly</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></span></li><li><span><span class="tsd-kind-parameter">model3D</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in src/sismomap.ts:63</li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="geteventnumber"><span>get<wbr/>Event<wbr/>Number</span><a href="#geteventnumber" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="geteventnumber-1"><span class="tsd-kind-call-signature">getEventNumber</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Result</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">></span><a href="#geteventnumber-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Result</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in src/sismomap.ts:309</li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getsourcegeojson"><span>get<wbr/>Source<wbr/>Geo<wbr/>JSON</span><a href="#getsourcegeojson" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getsourcegeojson-1"><span class="tsd-kind-call-signature">getSourceGeoJSON</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Result</span><span class="tsd-signature-symbol"><</span><a href="../types/EventGeoJSON.html" class="tsd-signature-type tsd-kind-type-alias">EventGeoJSON</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">></span><a href="#getsourcegeojson-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Result</span><span class="tsd-signature-symbol"><</span><a href="../types/EventGeoJSON.html" class="tsd-signature-type tsd-kind-type-alias">EventGeoJSON</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">Error</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in src/sismomap.ts:320</li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#_layers"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_<wbr/>layers</span></a><a href="#_mapscene"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_<wbr/>mapscene</span></a><a href="#_sources"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>_<wbr/>sources</span></a><a href="#descpopup"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>desc<wbr/>Popup</span></a><a href="#map"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>map</span></a><a href="#name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>name</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#clear"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>clear</span></a><a href="#displayevents"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>display<wbr/>Events</span></a><a href="#displaystations"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>display<wbr/>Stations</span></a><a href="#geteventnumber"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Event<wbr/>Number</span></a><a href="#getsourcegeojson"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Source<wbr/>Geo<wbr/>JSON</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">namazu-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
package/package.json
CHANGED
package/src/sismomap.ts
CHANGED
|
@@ -84,7 +84,8 @@ export class SismoMap {
|
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
if (
|
|
87
|
+
if (clear) this.clear();
|
|
88
|
+
if (!stationOnly) this.displayEvents(eventGeo, false, false);
|
|
88
89
|
|
|
89
90
|
// I put the await later because it doesn't have dependencies when creating the station,string map
|
|
90
91
|
let phasesPromise = client.getEventPhases(eventGeo);
|