DEV Community

Discussion on: Reactive Map with Rails, Stimulus Reflex and Mapbox

Collapse
 
tmyengstrom profile image
Tommy

Really great tutorial, very easy to follow. I'm new to both RoR and Stimulus and learned a bunch from this!

Any ideas on how I could extend this to also show some more data about each POI when clicking or hovering on a marker? I can see in the Mapbox documentation that they have something called "Display popup", but I'm not sure how to connect that event to the stimulus controller. Any tips or advice where I could learn more about this?

Collapse
 
ilrock__ profile image
Andrea Rocca 👨‍🍳

Hey @tommy! Sorry for being so late. Somehow I don't get notified when I get comments on dev. Either way, you can follow this guide: docs.mapbox.com/help/tutorials/cus....

When you setup your markers in the stimulus controller, there you can add the JS code required to also attach the popup to those markers.