larsen / rando-planner

Clerk viewers and utils to plan bikepacking trips
https://rando-planner.stefanorodighiero.net/
4 stars 0 forks source link

Allow simplified markers in the map #39

Closed larsen closed 5 months ago

larsen commented 5 months ago

The popups placed on the maps require to specify a lot of information, and that information is directly in the code composing the map.

                                            (doseq [pp (:markers value)]
                                              (.bindPopup
                                               (.addTo (.marker js/L (clj->js [(:lat pp) (:lon pp)])) @m)
                                               (str "<small>"
                                                    "<strong>" (:label pp) "</strong>"
                                                    "<br />"
                                                    (.floor js/Math (:kilometers pp))
                                                    " km / ("
                                                    (.floor js/Math (:cumulative-distance pp))
                                                    " km) ▲ "
                                                    (.floor js/Math (:elevation pp))
                                                    "</small>")))))

It should be instead provided by the user, for example as a popup-message attribute. This way markerts could be also used when not providing a plan.