Every map visual, whether it's a web app, a Python notebook, a Power BI report or a saved image, goes through the same chain: choose what to show, get the data, project it, tile it, serve it, style it, draw it and publish it. This guide walks the chain in that order. Each chapter tells you the decision you make at that step and the tools that do it.
Tools you asked about
Almost every map visual has two parts. The basemap gives context: land, water, roads, labels. Usually you borrow it from a provider. The data layer carries your message: your stores, your sales by region, your delivery routes. Most of your effort goes into the data layer, and its form depends on the question you're answering.
City positions are real. Values and flows are illustrative.
Map data is either vector (points, lines and polygons, such as stores, roads and suburb boundaries) or raster (a grid of pixels, such as satellite imagery or elevation). Positions are stored as longitude and latitude on the WGS 84 system, code EPSG:4326. That's what a GPS gives you.
| Format | What it is | Use it when |
|---|---|---|
| CSV with lat/lon columns | A plain table with two coordinate columns | You only have points. It's the easiest way into Power BI, Plotly or Folium. |
| GeoJSON | Text file of features and properties, the web standard. Coordinates are always [longitude, latitude]. | Points, lines or polygons up to a few MB. Every web library reads it directly. |
| Shapefile | An older GIS format split across several files (.shp, .dbf, .shx, .prj) | Government boundary downloads often come this way. Convert it to GeoJSON or GeoPackage. |
| GeoPackage | A modern single-file GIS database | You work in QGIS or GeoPandas and want one tidy file. |
| GeoParquet | A columnar format for large datasets | Millions of features, or analysis in Python or a data warehouse. Overture publishes in it. |
| GeoTIFF | A raster image with location attached | Imagery, elevation, land cover. |
| OpenStreetMap | Crowdsourced roads, buildings and places. Free, and you must credit "OpenStreetMap" with a link to its copyright page. |
| Overture Maps | Open map data from Amazon, Meta, Microsoft and TomTom |
| Natural Earth | Free low-detail world data: countries, coastlines, rivers |
| Official boundaries | Statistical areas from a national statistics office. In Australia that's the ABS (see the ASGS explainer). |
| Your own data | Spreadsheets of addresses, sales, assets |
Addresses into coordinates: run them through a geocoder such as Nominatim, Photon or a paid API, then keep the lat/lon so you don't geocode again. Public Nominatim allows one request per second, so batch jobs need your own instance or a paid service.
Values onto regions: join your table to boundary polygons with a shared code (a postcode or region ID), not a name. Names are ambiguous.
Shrink big boundaries: simplify polygons with mapshaper or GeoPandas before using them on the web. Detailed coastlines can be tens of MB.
Shapes crossing the 180° line: GeoJSON expects them split in two (common around Fiji, Russia and Alaska). Unsplit shapes draw as a band across the whole map.
Tools: QGIS (free desktop GIS), GeoPandas (Python), GDAL's ogr2ogr (converts anything to anything).
Libraries disagree on coordinate order. GeoJSON, MapLibre, deck.gl and Plotly use [longitude, latitude]. Leaflet and Folium use [latitude, longitude].
New York, read correctly.
The Earth is round and screens are flat, so every map uses a projection. Web maps use Web Mercator (EPSG:3857). It draws the world as a square, keeps shapes and angles true and stretches sizes toward the poles. It stops at about 85° north and south.
At the equator a 1,000 km square is drawn at its true size.
Greenland sits near 72°N, so it's drawn about 10 times too large in area. That's why it rivals Africa on screen, although Africa is about 14 times bigger. Across Greenland's own latitudes the stretch runs from about 4× in the south to over 60× in the far north.
Keep your data in latitude/longitude. MapLibre, Leaflet, Plotly and Power BI convert it to Web Mercator as they draw.
To draw over web tiles in Python, convert first: gdf.to_crs(epsg=3857). Otherwise your data and the basemap won't line up.
A world choropleth in Mercator exaggerates high-latitude countries. For printed thematic maps, an equal-area projection such as Equal Earth is fairer. MapLibre GL JS 5 (January 2025) can also draw the map as a globe, which avoids the stretch when zoomed out. Look up any code at epsg.io.
A basemap of the whole world is far too big to download, so it's cut into a pyramid of tiles. Zoom 0 is one tile showing the world, and each level splits every tile into four. Your map fetches only the tiles on screen. Turn the pyramid, hover a tile for its address, and click one to see its children.
Drag to rotate. Hover a tile for its address. Click a tile to see its four children.
x counts from the left and y from the top, as in Google, OpenStreetMap and OGC WMTS. The older TMS scheme counts y from the bottom.
256 px tiles, measured at the equator. Many services now use 512 px tiles, which shifts the figures by one level. Published scales also differ with the assumed pixel size: OGC's standard uses 0.28 mm pixels and gets 1 : 559,082,264 at zoom 0.
When tiles are built, each zoom level gets only what suits its scale. The top shows land and sea, and lower levels add borders, roads and buildings. Notice the borders appear from z2 above.
The pyramid is generated in advance and stored. Some servers, such as Martin, can also build tiles from a database when they're requested.
Raster tiles are pictures (PNG, JPEG, WebP) with the style baked in. Vector tiles (the Mapbox Vector Tile format, .mvt, often also served as .pbf) carry shapes and attributes, and get coloured later. Try both below.
Both tiles cover the same square, z2 x2 y1. Restyle them.
/2/2/1.png · the style is part of the image/2/2/1.mvt · coloured by the chosen styleFor the basemap: no. Use a provider's tiles: OpenStreetMap, MapTiler, CARTO, or a Protomaps build.
For your own data: usually not. A GeoJSON file of up to a few MB, or a few tens of thousands of features, can be loaded straight into the map.
Only for large data, such as every building in a country or millions of points, cut your own vector tiles.
| Tippecanoe | Turns GeoJSON, FlatGeobuf or CSV into vector tiles, decides what to keep at each zoom, and can write PMTiles directly. Now maintained by Felt. |
| PMTiles | A whole pyramid in one file, readable from plain cloud storage (from Protomaps) |
| MBTiles | A pyramid stored in one SQLite file, served by a tile server. Rows are stored in TMS order, so y is flipped. |
| Martin | Tile server for PostGIS (built on request), MBTiles, PMTiles, Cloud-Optimised GeoTIFF and GeoJSON |
| MapTiler | Builds tiles from your data (MapTiler Engine) and hosts them |
Your map holds almost no data of its own. It asks a tile service, a server that hands out tiles by address, for each square it needs. Move the map and watch the requests, then change the server's rules.
| Where tiles come from | How it works | Watch for |
|---|---|---|
| A free public server | For example tile.openstreetmap.org. No key needed. | No uptime guarantee, and access can be withdrawn at any time. You must show attribution, send a real User-Agent and Referer, and cache tiles for at least 7 days. Bulk or offline downloading is banned. Fine for a demo, not for a product. |
| A hosted provider | MapTiler, CARTO, Mapbox, Stadia and others. You get an API key. | Free tiers have monthly limits, after which you pay per map load or per tile. Restrict the key to your domain. |
| Your own server or storage | Host a PMTiles file on cloud storage, or run a tile server. | No outside limits. You handle updates, uptime and bandwidth. |
The tile service is a live dependency, not a one-time download. If it's slow, refuses you or goes down, your map breaks, even when your own code is fine. A 403 means you're not allowed (missing key, wrong domain). A 429 means you've sent too many requests.
With vector tiles, a Style JSON decides how everything looks. It's a list of layers drawn in order, bottom to top: water, land, roads, your data, then labels. Each layer picks features from a source, filters them, and sets colours, widths, fonts and the zoom range where it appears. With raster tiles this step already happened on the server.
// one layer from a Style JSON: your sales regions, coloured by value { "id": "sales-regions", "type": "fill", "source": "regions", "minzoom": 4, "paint": { "fill-color": ["interpolate", ["linear"], ["get", "sales_per_head"], 0, "#e6f2f0", 500, "#0f857a"], "fill-opacity": 0.8 } }
The colour comes from each feature's own value. This is called data-driven styling.
Put your data under the labels. Insert your layer below the first label layer so place names stay readable.
Pick the colour scale for the data. Use a sequential scale (light to dark) for amounts. Use diverging (two colours from a midpoint) for above/below a target, and categorical (distinct hues) for types. Avoid rainbow scales.
Map rates, not counts, on regions. Big regions have big totals. Divide by population or area first.
Mute the basemap. A light or grey basemap lets your data stand out.
Tools: Maputnik (free visual Style JSON editor), MapTiler's style editor, or a ready-made style from your tile provider.
The renderer draws tiles, style and your data on screen. Your choice decides which kind of tile you can use, and that changes where the styling step happens. Pick one and watch the steps re-order.
Your points, lines or regions in latitude/longitude.
| Library | Coordinate order | Draws with | Best for |
|---|---|---|---|
| MapLibre GL JS | [lon, lat] | WebGL | Custom-styled vector maps, large datasets, 3D, no vendor lock-in |
| Leaflet | [lat, lon] | SVG or Canvas | Simple maps with markers and popups, quick to learn, many plugins |
| OpenLayers | [lon, lat], projected | Canvas or WebGL | GIS-heavy apps with many projections and formats |
| deck.gl | [lon, lat] | WebGL | Hundreds of thousands of points, arcs, hexbins, 3D columns |
| Folium (Python) | [lat, lon] | Leaflet | Quick interactive maps from a notebook, saved as HTML |
| Plotly (Python) | lat=, lon= columns | MapLibre | Maps inside Plotly dashboards, scatter and choropleth |
| GeoPandas + contextily | CRS-aware | Matplotlib | Static images for reports and print |
| Power BI, Tableau | Latitude / Longitude fields | Built-in visuals | Maps in business dashboards, filtered with the rest of the report |
Lots of points? SVG-based Leaflet slows down past a few thousand markers. Use clustering, switch to its Canvas renderer, or move to a WebGL library such as MapLibre or deck.gl, which handle hundreds of thousands.
"3D buildings" means two different things, built from different data with different tools.
Building footprints raised to their height as plain blocks you can colour by any value. The heights come from OpenStreetMap's height and building:levels tags, or from Overture.
Tools: MapLibre or Mapbox (a fill-extrusion layer in the Style JSON), deck.gl, Plotly. It's cheap and fully styleable. It works anywhere building data exists, but it looks like a model, not a photo.
Terrain: the same style spec has hillshade and color-relief layers that shade hills and colour by height from an elevation source.
A textured mesh of real buildings, trees and terrain, captured from aerial imagery. Google's Photorealistic 3D Tiles cover thousands of cities (Google quotes 2,500+ in 49 countries) and are delivered in the open OGC 3D Tiles format, a 3D version of the tile pyramid.
Tools: CesiumJS, deck.gl's Tile3DLayer, or Google's own 3D Maps in the Maps JavaScript API. You need a Google Maps Platform key with the Map Tiles API enabled. Billing is per root tileset request, and each request opens a session of up to 3 hours. You must show the tiles' attributions on one line plus the Google Maps logo, and you can't cache them beyond Google's terms or use them offline. Coverage is mainly large cities.
// CesiumJS: Google's photorealistic city mesh on a page // (load Cesium's JS and CSS, and add <div id="viewer"></div>) Cesium.GoogleMaps.defaultApiKey = 'YOUR_GOOGLE_MAPS_KEY'; const viewer = new Cesium.Viewer('viewer', { globe: false }); // the tiles include their own terrain viewer.scene.primitives.add(await Cesium.createGooglePhotorealistic3DTileset()); viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(151.2093, -33.8688, 900) }); // lon, lat, height in m
Just want to look, without building anything? Google Earth on the web and the 3D view in Google Maps or Apple Maps use the same kind of data.
A map visual is only useful if people can read it and ask it questions. Add these to the data layer, and add search or routing as separate services.
Show the value behind a point or region on hover or click. Keep it to the two or three fields that answer the question.
A thematic map without a legend can't be read. State what the colour or size means, the units and the date of the data.
Open the map fitted to your features (fitBounds), not the whole world. Add clustering when points overlap.
A search box turns typed addresses into positions. Photon gives fast autocomplete. Nominatim is OpenStreetMap's own, but its public server forbids autocomplete. Pelias is another open option.
Directions, travel time and distance. OSRM, Valhalla and GraphHopper run on OpenStreetMap data, self-hosted or through a provider.
Let people narrow by category or date. In BI tools this comes free through slicers. On the web, filter the layer rather than reloading data.
Before the map goes in front of people, check these.
Each recipe maps the same file, stores.geojson, a set of points with a name property, centred on Sydney. Pick the one that matches where your map will live.
You handle: data and render. Tiles, style and serving come from OpenStreetMap. Fine for prototypes. Switch to a provider for real traffic. Written for Leaflet 1.9, the stable release. Leaflet 2 (in alpha) replaces calls like L.marker() with classes like new Marker().
<!-- in the page: Leaflet's CSS and JS from unpkg, and <div id="map" style="height:500px"></div> --> const map = L.map('map').setView([-33.87, 151.21], 11); // [lat, lon] L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19, attribution: '<a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>' }).addTo(map); fetch('stores.geojson').then(r => r.json()).then(data => { const layer = L.geoJSON(data) .bindPopup(l => l.feature.properties.name) .addTo(map); map.fitBounds(layer.getBounds()); });
You handle: data, your layer's style and render. The basemap's tiles, style and serving come from a provider (here MapTiler, which needs a free key).
const map = new maplibregl.Map({ container: 'map', style: 'https://api.maptiler.com/maps/streets-v2/style.json?key=YOUR_KEY', center: [151.21, -33.87], // [lon, lat] zoom: 11 }); map.on('load', () => { map.addSource('stores', { type: 'geojson', data: 'stores.geojson' }); // draw under the first label layer so place names stay on top const firstLabel = map.getStyle().layers.find(l => l.type === 'symbol').id; map.addLayer({ id: 'stores', type: 'circle', source: 'stores', paint: { 'circle-radius': 6, 'circle-color': '#f2846f' } }, firstLabel); map.on('click', 'stores', e => new maplibregl.Popup().setLngLat(e.lngLat) .setText(e.features[0].properties.name).addTo(map)); });
You handle: data and render. Folium uses Leaflet and raster tiles. Plotly uses MapLibre with CARTO's vector basemaps.
# Folium: interactive map saved as an HTML file import folium m = folium.Map(location=[-33.87, 151.21], zoom_start=11) # [lat, lon] folium.GeoJson("stores.geojson", tooltip=folium.GeoJsonTooltip(fields=["name"])).add_to(m) m.save("stores_map.html") # Plotly: a map inside a chart or dashboard, from a table with lat/lon columns import geopandas as gpd, plotly.express as px gdf = gpd.read_file("stores.geojson") gdf["lat"], gdf["lon"] = gdf.geometry.y, gdf.geometry.x fig = px.scatter_map(gdf, lat="lat", lon="lon", hover_name="name", zoom=10, map_style="carto-positron") fig.show()
You handle: data, projection and render. contextily downloads raster tiles for the area and stitches them behind your plot.
import geopandas as gpd import contextily as cx gdf = gpd.read_file("stores.geojson").to_crs(epsg=3857) # match the web tiles ax = gdf.plot(figsize=(8, 8), color="#d4553c", markersize=30) cx.add_basemap(ax, source=cx.providers.CartoDB.Positron) ax.set_axis_off() ax.figure.savefig("stores_map.png", dpi=200, bbox_inches="tight")
You handle: data and styling of your layer. The basemap, tiles and serving are Microsoft's. No code needed.
These bundle data, tiles, styling and hosting into one product. You trade money and flexibility for speed.
| CARTO | Spatial analysis and maps on top of your data warehouse (BigQuery, Snowflake and others). Also offers free basemaps. |
| MapTiler | Turns your files into tiles, hosts them, and provides basemap styles and an editor. |
| Mapbox | Full developer stack: tiles, styles, Studio editor, search and routing. MapLibre is the open-source fork of its earlier engine. |
| Google Maps Platform | Easiest to drop in, with strong places and Street View, but limited styling. Priced per request. |
| Esri ArcGIS | Enterprise GIS covering analysis, data management and publishing. Deep and expensive. |