All-natural web development, poignant wit, and hippie ramblings since 2004.

¿Qué?

Fresh thoughts:

Getting MapLibre working for both native and web in Expo

I've been dabbling of late in building a mobile app with React Native + Expo. One of the things that attracted me most to Expo, is that – on top of the "write once, run on iOS and Android" claim of React Native – Expo claims to also let an app run seamlessly on the web. Anyway, as it turns out (surprise surprise – not!), neither of those claims are particularly aligned with reality. I found this out – with the claim of "run on native and web" – as soon as I wanted to add a simple map to my app.

Behold, a MapLibre map, working both for native and for web, in Expo.
Behold, a MapLibre map, working both for native and for web, in Expo.

Below is my humble lil' guide to getting MapLibre working for both native and web in Expo. Note: if you want to skip the step-by-step shpiel, and you just want a working example with all the code, feel free to head straight to the Expo MapLibre native + web demo on GitHub.