Put Your Data on the Map: Leaflet, OpenStreetMap and Four Live Demos

by Nov 28, 2026Analytics, Behind The Code, DIY Coding, Featured

a female ai assistant helping to close sales leads
Data mapping, hands on

Your data has an address.

Customer lists, delivery orders, service calls, signups, even a herd of elk wearing GPS collars. If a row has an address or a coordinate, it belongs on a map. And once it is on a map, people stop skimming it and start exploring it.

This post starts with a map you can build in four lines of code, then goes all the way to four live demos you can drive yourself. Everything runs on free, open tools: Leaflet and OpenStreetMap.

Click anywhere on the map

Each dot is one row from a (made-up) customer spreadsheet. Click the map to drop a pin and count everyone within a mile.

The toolkit (all free)

Four ingredients. Zero license fees.

Interactive maps used to mean expensive GIS software. Today the whole stack is open and runs in any browser.

01 / THE ENGINELeafletThe open-source JavaScript library behind maps on thousands of sites. About 42 KB of code, BSD-licensed, and simple enough to learn in an afternoon.
02 / THE MAPOpenStreetMapA free, community-built map of the entire planet. Its tiles draw the streets under your data. Credit OpenStreetMap on the map, and use a tile provider once traffic gets heavy.
03 / YOUR DATASpreadsheet + geocoderAny CSV with addresses. The U.S. Census Geocoder turns up to 10,000 addresses at a time into latitude and longitude, free.
04 / CONTEXTPublic data layersCensus demographics, storm reports, state DNR telemetry, school districts. Layer them under your points and the story writes itself.
Start easy

Three small steps. Big payoff.

Each example builds on the last. Try them out: change the code inputs, click the buttons, break things.

Level 1

A real map in four lines

Create a map, point it at OpenStreetMap tiles, drop a marker. That is the entire "hello world" of web mapping.

var map = L.map('map').setView([41.8781, -87.6298], 12);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map);
L.marker([41.8781, -87.6298]).addTo(map).bindPopup('Hello, Chicago');

Same code, different coordinates. Click a city and the map flies there.

Level 2

Paste a spreadsheet, get dots

Here is a tiny CSV of coffee shops. Edit a row, add your own, or paste in rows of your own data with name,lat,lng,type columns, then press Map it.

rows.forEach(function(r){
L.circleMarker([r.lat, r.lng]).addTo(map).bindPopup(r.name);
});

Your rows become dots, and the map zooms to fit them.

Level 3

Make the dots mean something

Same idea, but now bigger circles mean more sales, color means store type, and you can filter live. This is where a map starts answering questions instead of just showing locations.

var radius = Math.sqrt(store.sales) / 12;  // area tracks the value
L.circleMarker([store.lat, store.lng], {
radius: radius, fillColor: colors[store.type]
}).addTo(map);

Now let's get wild

Four maps that do real work.

Same building blocks, pushed further. Pick an industry, then drag, slide, play and break things. Every business and every data point here is made up, but the techniques are the ones we use on real projects.




Ember & Rye Pizza

Three stores, 2,400 delivery orders from the last 90 days. Drag a store pin to move it and watch coverage change.


LunchDinnerLate night
Heat gridCompetitors
0orders shown
0%inside a delivery zone
$0in orders outside every zone (revenue on the table)

Summit Roofing Co.

A hailstorm crosses Chicago's northwest suburbs. Press play, then find the homes worth knocking on first.






Past customers
0homes in the hail zone
0priority targets
$0estimated replacement work (priority targets x $14k avg x 35% close)

Loopwise (a SaaS startup)

Two years of signups, headquartered in Chicago. Press play to watch the company go global, month by month.


StarterGrowthEnterprise
Signup arcsSize by accounts
$0monthly recurring revenue
0accounts in 0 countries
-top cities by MRR

Wild Tracks

Wildlife biologists put GPS and acoustic tags on animals to learn where they go. Pick a species and press play. These are simulated tracks modeled on real patterns.

Sandhill cranesLake sturgeonElk herd



--
--
The recipe

From spreadsheet to strategy in five moves.

We recently did this for a local political campaign: more than 1,100 handwritten petition signatures, digitized, geocoded and layered with Census demographics in a private, password-protected map the team uses to plan signs and canvassing. The steps are the same for almost any business.

GatherExport what you already have: CRM contacts, invoices, orders, service tickets, form leads.
GeocodeTurn addresses into coordinates. Batch tools handle thousands of rows in minutes.
LayerAdd context: Census income and density, storm reports, territories, competitors.
InteractFilters, sliders, time playback, click-for-details. Let people ask their own questions.
Ship it safelyPassword-protect anything with personal data, keep it out of search engines, and use a proper tile provider at scale.
Before you map everything

Four things we learned the hard way.

Addresses are personal dataA map of customers is a list of where people live. Keep real customer maps behind a login, and never publish names with home addresses.
Free tiles are a shared resourceOpenStreetMap's own tile servers run on donations and are meant for light use, with clear attribution. For a busy app, switch to a commercial OSM-based tile provider or host your own.
Geocoding is never 100%Typos, new construction and rural routes miss. Expect a small percentage to need a manual fix, and flag low-confidence matches instead of hiding them.
Thousands of points need canvasDraw big datasets on a canvas instead of as individual page elements (Leaflet's preferCanvas option), and aggregate into grids or clusters when dots start to pile up.
Your data, on a map

What would your map show you?

Send us a spreadsheet and a question. We will turn it into an interactive map your team actually opens, and keep it private where it should be.

Talk to Xblu about mapping your data

Demo businesses, customers, orders, homes, storms and accounts are fictional and randomly generated. Wildlife tracks are simulated, inspired by sandhill crane migration through Jasper-Pulaski Fish & Wildlife Area in Indiana, the Wisconsin DNR's lake sturgeon spawning run up the Wolf River, and the Wisconsin DNR's northern elk herd around Clam Lake and Lake Namakagon in the Chequamegon-Nicolet National Forest. The Wolf River course comes from OpenStreetMap. Maps © OpenStreetMap contributors, built with Leaflet.