aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorJakub Hampl <kopomir@gmail.com>2018-10-15 16:24:16 +0100
committerJakub Hampl <kopomir@gmail.com>2018-10-15 16:24:16 +0100
commit6cd451b4fe0fd28994ad6c5a0f282dc47d2f7142 (patch)
treec6b52c6607ad2407f6b67bf3b1f03ece781c08e0 /README.md
parentb6d81004b6f9fb85ecfd410c7d5b2d04e8d27c0a (diff)
Stuff for Mapbox 50
Diffstat (limited to 'README.md')
-rw-r--r--README.md19
1 files changed, 16 insertions, 3 deletions
diff --git a/README.md b/README.md
index 4c823fb..1bed594 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,21 @@ install the accompanying npm library:
npm install --save elm-mapbox
+Then include the library into your page. If you don't have any JS build system setup,
+probably the easiest is to add:
+
+```html
+<script src="node_modules/elm-mapbox/dist/elm-mapbox.umd.js"></script>
+```
+
+If you are running a module bundler, you should be able to
+
+```javascript
+import elmMapbox from "elm-mapbox";
+```
+
+instead.
+
Then, when you are instantiating your Elm application, change it from:
```javascript
@@ -31,8 +46,6 @@ var app = Elm.MyApp.init();
to
```javascript
-import elmMapbox from "elm-mapbox";
-
elmMapbox.registerCustomElement();
var app = Elm.MyApp.init();
elmMapbox.registerPorts(app);
@@ -52,7 +65,7 @@ var app = Elm.MyApp.init();
elmMapbox.registerPorts(app);
```
-Next, optionally, setup a ports module. The best way to do this is to to copy [this file](examples/MapCommands.elm) into your project.
+Next, optionally, setup a ports module. The best way to do this is to to copy [this file](https://github.com/gampleman/elm-mapbox/blob/master/examples/MapCommands.elm) into your project.
This will allow you to easily use the commands to control parts of your map interactions imperatively.