Posts
Rover — Interactive maps for Phoenix LiveView
Rover is a Phoenix LiveView component for interactive maps. It wraps OpenLayers — a serious GIS engine with projections, WMS/WMTS, vector layers, cadastral data, etc. — and removes the ceremony most Phoenix applications don’t need.
What it does
<.map
id="parcels"
center={{45.75, 4.85}}
zoom={12}
markers={@clients}
shapes={@parcels}
tiles={:ign_ortho}
/>
Assign a list of maps, get a map.
Change the list, and Rover diffs by ID and updates only what changed — no flicker, no interrupted pan, no popups unexpectedly closing and reopening.
Markers: any struct with :id, :lat, and :lon. Optional emoji, custom colors, draggable pins, and popups (HEEx slots, escaped by default).
Shapes: GeoJSON from ST_AsGeoJSON or your own data. Shapes are diffed by revision rather than hashing, so updating thousands of points stays efficient.
Clustering for hundreds of markers.
Heatmaps for density analysis.
Popups on shapes that point to the geometry rather than its centroid.
View control without losing declarative framing with Rover.fly_to/4 and Rover.fit_to/4.
Rover also has built-in support for IGN Géoportail, including French cadastral maps and aerial orthophotography.
Why not just write a hook?
You can — and the first version is short.
Then you fix reconciliation, coordinate order, viewport framing, attribution, element ID changes, flickering, and all the little edge cases that appear once the map becomes part of a real application.
That’s the layer Rover is trying to provide.
OpenLayers itself is the bet underneath it.
Three pins on a tile layer is an afternoon’s work. The next morning you need WMS layers, a cadastral overlay, vector data, clustering, or another projection — and suddenly the ceiling has moved somewhere else.
OpenLayers can handle that. Rover tries to make it feel natural from Phoenix LiveView.
Try it
Livebook demo
Documentation
Source
Rover is open source and still evolving. Feedback, ideas, and criticism are welcome.
Elixir/Hex packages published this year:
• green_ash — AS/400-style LiveView console generated from Ash resource introspection lnkd.in/enuy-9NR • search_ash — multilingual full-text search for Ash, pre-stemmed tsvectors, \~30 languages lnkd.in/dS9yRFaE • stemmers — Rust/Rustler NIF used by search_ash lnkd.in/dc4Ud573 • cfonb — parser for French CFONB bank statement files lnkd.in/dg6SmMfs • green_cal — sun/moon ephemerides for agricultural calendars, pure Elixir, zero dependencies lnkd.in/dhKEsmvj • facturx — Factur-X/ZUGFeRD (EN 16931) toolkit: generate, extract, parse, validate. v1 complete, not yet on Hex. lnkd.in/dvn9pTGR
Also: 2 merged PRs, elixir-lang/elixir and ash-project/ash and more.
Open to Elixir/Phoenix roles.
Tags
Languages
Link
Followers
-
MDMayel de Borniol
Elixir dev, building ...
-
Jonathan SchwederSenior Backend Engineer
Follows
-
Michael SchmidtInhaber @ TAGWORX.NET
-
Jonathan SchwederSenior Backend Engineer
-
Icia CarroElixir Erlang Developer
Fediverse
Are you on Mastodon or another Fediverse app? Follow SEBASTIEN PORTRAIT from there and new public posts arrive in your timeline. No vutuv account needed.
@sebastien_portrait@vutuv.de