Skip to content

Commit

Permalink
Use NPM by default in osm2lanes-js example. #224
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Oct 6, 2023
1 parent b9577bd commit b9bc594
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions osm2lanes-js/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<head>
<title>osm2lanes-js demo</title>
<script type="module">
import init, { getLaneSpecs } from "./pkg/osm2lanes_js.js";
// Use the published NPM version by default:
import init, { getLaneSpecs } from "https://unpkg.com/osm2lanes-js/osm2lanes_js.js";
// Or uncomment below and follow the instructions on the page to build locally
//import init, { getLaneSpecs } from "./pkg/osm2lanes_js.js";

// You have to do this once to set up the WASM API
await init();
Expand Down Expand Up @@ -65,9 +68,10 @@
</head>
<body>
<h1>osm2lanes-js demo</h1>
<p>To run this example:</p>
<p>To run this example using a local build:</p>
<ol>
<li>wasm-pack build --release --target web</li>
<li>Modify this file and swap the import to not use unpkg</li>
<li>python3 -m http.server --directory .</li>
<li>Open http://0.0.0.0:8000/example.html</li>
</ol>
Expand Down

0 comments on commit b9bc594

Please sign in to comment.