From 6cd451b4fe0fd28994ad6c5a0f282dc47d2f7142 Mon Sep 17 00:00:00 2001 From: Jakub Hampl Date: Mon, 15 Oct 2018 16:24:16 +0100 Subject: Stuff for Mapbox 50 --- README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'README.md') 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 + +``` + +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. -- cgit v1.2.3