Skip to content

Commit

Permalink
wasm-bingen: camelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscorn committed Jan 20, 2024
1 parent b9f4aa6 commit 537cf70
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolver = "2"
members = ["./japan-geoid-*"]

[workspace.package]
version = "0.3.1"
version = "0.3.2"
edition = "2021"
authors = [
"Taku Fukada <naninunenor@gmail.com>",
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ npm add japan-geoid
### Usage

```javascript
import init, { load_embedded_gsigeo2011 } from "japan-geoid";
import init, { loadEmbeddedGSIGEO2011 } from "japan-geoid";

await init(); // load WASM

const geoid = load_embedded_gsigeo2011();
const geoid = loadEmbeddedGSIGEO2011();

console.log(
geoid.get_height(138.2839817085188, 37.12378643088312)
geoid.getHeight(138.2839817085188, 37.12378643088312)
); // => 39.47387115961899

console.log(
geoid.get_heights(
geoid.getHeights(
[138.2839817085188, 141.36199967724426],
[37.12378643088312, 43.06539278249951]
)
Expand Down
2 changes: 1 addition & 1 deletion japan-geoid-py/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "japan-geoid-py"
version.workspace = true
version = "0.3.1"
edition.workspace = true
categories.workspace = true
description.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ pub struct GsiGeoid {

#[wasm_bindgen]
impl GsiGeoid {
#[wasm_bindgen]
#[wasm_bindgen(js_name = "getHeight")]
pub fn get_height(&self, lng: f64, lat: f64) -> f64 {
self.geoid.get_height(lng, lat)
}

#[wasm_bindgen]
#[wasm_bindgen(js_name = "getHeights")]
pub fn get_heights(&self, lngs: &[f64], lats: &[f64]) -> Vec<f64> {
lngs.iter()
.zip(lats.iter())
Expand All @@ -25,7 +25,7 @@ impl GsiGeoid {
}
}

#[wasm_bindgen]
#[wasm_bindgen(js_name = "loadEmbeddedGSIGEO2011")]
pub fn load_embedded_gsigeo2011() -> GsiGeoid {
GsiGeoid {
geoid: gsi::load_embedded_gsigeo2011(),
Expand Down

0 comments on commit 537cf70

Please sign in to comment.