I built Norway's EV charging map with Next.js and MapLibre GL JS — and hit a race condition that took me three sessions to fix
Ayyad Anwar developed an interactive EV charging map for Norway using Next.js and MapLibre GL JS. The project features over 10,000 charging stations and employs a greedy algorithm for optimal route planning. Anwar encountered and resolved a race condition during development that delayed the display of route lines on the map.
- ▪The map application, named StrømVei, plots more than 10,000 EV charging stations across Norway.
- ▪Anwar chose MapLibre GL JS over Mapbox due to the latter's requirement for a credit card even for free accounts.
- ▪The application uses GeoJSON clustering to efficiently render a large number of markers without crashing the browser.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3942169) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Ayyad Anwar Posted on May 20 I built Norway's EV charging map with Next.js and MapLibre GL JS — and hit a race condition that took me three sessions to fix #nextjs #typescript #webdev #maps I recently shipped StrømVei — an interactive EV charging map and route planner for Norway, built with Next.js 16, TypeScript, MapLibre GL JS, and the free Nobil API.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).