leastbad / maps

A StimulusReflex demonstration of a reactive map UI

Home Page:https://stimulus-reflex-maps.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maps

Demonstrate reactive map navigation, making use of Stimulus Reflex, Cable Ready, Stimulus and Leaflet/Mapbox. The đź’ˇ idea here is that we use the Cable Readyset_dataset_property operation to trigger valueChanged callbacks in the Stimulus controller. We do have to take special care to make sure the callbacks do not fire too often.

A good potential next step would be to debounce the Reflex calls, as scroll wheel zooming tends to get a little busy.

You will require a Mapbox key to be set up in your environment or your Rails credentials:

Get a key

Demo

There is an instance running on Heroku: https://stimulus-reflex-maps.herokuapp.com/

Installation

  • ensure Postgres and Redis are both running and available on the usual ports
  • bundle
  • yarn
  • bin/setup
  • install MAPBOX_TOKEN environment variable or mapbox_token credential
  • run bin/webpack-dev-server in a terminal window
  • run rails s in another terminal window

About

A StimulusReflex demonstration of a reactive map UI

https://stimulus-reflex-maps.herokuapp.com/


Languages

Language:Ruby 51.8%Language:SCSS 22.7%Language:HTML 13.7%Language:JavaScript 11.8%