Skip to content

Commit

Permalink
Merge pull request #25 from neo-garaix/dev
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
dmarteau authored Oct 8, 2024
2 parents 2d93715 + 861af9a commit 100ad54
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 36 deletions.
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

The documentation is available on [docs.rs](https://docs.rs/proj4rs/) and the demo on [docs.3liz.org](https://docs.3liz.org/proj4rs/).

# Contributing

### Modify

Any Rust file you wish to modify can be found in `src/` with some tests in `tests/proj4js_tests.rs`.
In order to test your new code, you need to build it thanks to WASM. More information on how to build it can be found in [README_WASM.md](./README_WASM.md).

### Test

If you want to test your code, you can ron locally some demos by reading [this README](./ol-proj4rs-demo-app/README.md) in `ol-proj4rs-demo-app/`.
You can create another demo page with a HTML file + JavaScript file combo.
38 changes: 2 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,40 +99,6 @@ let point = new Proj.Point(2.0, 1.0, 0.0);
Proj.transform(from, to, point);
```

## Compiling for WASM

Install [wasm-pack](https://rustwasm.github.io/wasm-pack/book/)

```bash
wasm-pack build --target web --no-default-features
```

Or if you have installed [cargo-make](https://sagiegurari.github.io/cargo-make/), use the following
command:

```bash
cargo make wasm
```

### Running the WASM example

There is a [`index.html`] file for testing the WASM module in a navigator.

For security reasons, you need to run it from a server.
You can start a Python server with the following command:

```bash
python3 -m http.server
```

The server will automatically serve the `index.html` file in the current directory.


## Build for npm

```
cargo make wasm_bundle
```

This will create a npm bundler package in pkg-bundler
## Contributing

You can contribute to this library by going on the [proj4rs](./CONTRIBUTING.md) repository
41 changes: 41 additions & 0 deletions README_WASM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

The documentation is available on [docs.rs](https://docs.rs/proj4rs/) and the demo on [docs.3liz.org](https://docs.3liz.org/proj4rs/).

# Build locally a package

## Compiling for WASM

Install [wasm-pack](https://rustwasm.github.io/wasm-pack/book/)

```bash
wasm-pack build --target web --no-default-features
```

Or if you have installed [cargo-make](https://sagiegurari.github.io/cargo-make/), use the following
command:

```bash
cargo make wasm
```

### Running the WASM example

There is a `index.html` file for testing the WASM module in a navigator.

For security reasons, you need to run it from a server.
You can start a Python server with the following command:

```bash
python3 -m http.server
```

The server will automatically serve the `index.html` file in the current directory.


## Build for npm

```bash
cargo make wasm_bundle
```

This will create a npm bundler package in pkg-bundler
Binary file modified ol-proj4rs-demo-app/favicon.ico
Binary file not shown.

0 comments on commit 100ad54

Please sign in to comment.