GIS Tools

Language

Made withfor the GIS community

Basemap Switcher

Switch between different basemap styles including offline options

Map Viewing

Available Basemaps

Current View

Center:39.5000, -98.3500
Zoom:4.00

About Basemaps

  • Switch between different map styles
  • Map position is preserved when switching
  • Some basemaps require internet
OpenStreetMap
Β© OpenStreetMap contributors | MapLibre

What Is a Basemap Switcher?

A basemap switcher is a control on an interactive web map that lets you change the background layer β€” the reference imagery or cartography you see underneath your own data. On a Leaflet, Mapbox GL, or OpenLayers map, you typically see a small stack-of-squares icon in the corner; clicking it reveals a list of available basemap styles like OpenStreetMap standard, satellite imagery, terrain, dark mode, and light mode. The basemap switcher on gis.tools brings that same control to whatever data you drop into the viewer, with the added bonus that everything works offline once the tiles are cached.

The basemap layer is the foundation on which every thematic overlay rests. A thoughtful choice of basemap can dramatically change how your map reads. A dark basemap makes bright orange point clusters pop; a muted grayscale basemap lets a choropleth's color ramp do the talking; a satellite basemap grounds your analysis in real-world imagery for anyone who is not used to abstract cartography. A bad basemap choice β€” using full-color OpenStreetMap as the background for a colorful choropleth β€” produces a visual shouting match that nobody can read.

Synonyms you will encounter in the wild: tile layer, reference layer, background map, map tiles provider, slippy map base, underlay, and in ArcGIS jargon, basemap gallery. They all point at the same concept β€” the bottom-most layer that provides geographical context.

How Basemap Tiles Work

XYZ tile pyramids

Every slippy map basemap is really a grid of pre-rendered 256Γ—256 (or 512Γ—512) pixel image tiles organized in a zoom pyramid. Zoom level 0 is a single tile covering the whole world; zoom level 1 is four tiles; zoom level 20 is over a trillion tiles covering the world at roughly 15 cm per pixel. When you pan across the map, your browser fetches the tiles covering the current viewport at the current zoom level using a URL pattern like https://tile.provider.com/{z}/{x}/{y}.png.

OpenStreetMap's default tile server, Stamen, CartoDB, Mapbox, MapTiler, Esri World Imagery, and most satellite providers all speak this same XYZ scheme. That is why a single basemap switcher control can toggle between dozens of wildly different providers β€” they all share the same transport protocol.

Vector tiles vs raster tiles

Modern basemaps increasingly ship vector tiles (Mapbox Vector Tiles, or MVT) instead of pre-rendered raster PNGs. A vector tile contains the raw geometry and attributes for features in a tile region; the client (your browser) applies a style specification at render time. Vector tiles are sharper on high-DPI screens, smaller over the wire, and can be restyled without re-rendering the whole pyramid. Raster tiles are simpler and work universally but look blurry on retina displays.

The basemap switcher supports both raster and vector basemaps. You can mix and match β€” pair a raster satellite layer from Esri with vector OSM labels on top, for example.

Key Options and Parameters

Basemap catalog

The default basemap catalog includes OpenStreetMap standard, a muted light gray Positron-style basemap, a dark matter basemap, satellite imagery (Esri or NASA GIBS), terrain (Stamen or Stadia Terrain), and a topographic style. Additional providers can be pasted in as custom XYZ URL templates.

Attribution

Every basemap provider has attribution requirements (OSM requires a copyright line for OpenStreetMap contributors). The switcher automatically displays the correct attribution for whichever basemap is active.

Offline basemaps

For users working without internet (field deployments, air-gapped networks, classified environments) the switcher supports loading locally-hosted basemap files like MBTiles or PMTiles. See the PMTiles/MBTiles Inspector to validate your offline tile pack before loading.

Opacity

You can blend the basemap with itself or with your overlays by adjusting opacity. A 50% opacity dark basemap under a light overlay creates a soft vignette effect.

Practical Applications

Field mapping and reconnaissance

When you are mapping field assets on a rural road network, the satellite basemap is priceless. You can see where hedgerows, driveways, and unofficial tracks actually are, which no purely vector basemap captures. Field teams on conservation, forestry, or disaster response deployments switch between OSM and satellite constantly β€” OSM for named-feature context, satellite for the ground truth.

Choropleth cartography

When you are making a choropleth of unemployment rates by census tract, you want the basemap to disappear. A dark or light matter basemap from CartoDB strips out all color except for subtle labels, so your graduated color ramp is the only thing the eye focuses on.

Urban planning and architecture

Urban planners need both the OSM-style line-drawn street grid (for wayfinding and context) and aerial photography (for showing existing buildings, vegetation, parking lots). A basemap switcher lets the planner toggle at will during a presentation to a community meeting.

Emergency response

In the first hours of a flood, wildfire, or earthquake, responders need every available reference: satellite imagery to see burn scars or inundation, OSM to see road networks still in use, and topographic maps to understand terrain. Rapid switching between these during the initial assessment phase is essential.

Historical research and map comparison

Some basemap providers host historical imagery or scanned topographic maps. A basemap switcher that includes the USGS Historical Topo collection or NYPL's historical map tiles turns the viewer into a time machine β€” toggle between 2025 satellite and 1890 topographic to see how a neighborhood evolved.

Teaching and demonstrations

Instructors find that toggling basemaps is the easiest way to teach students about cartographic abstraction. Flipping from satellite to OSM to dark matter drives home that the map is not the territory and that every basemap makes editorial choices about what to show.

Step-by-Step Workflow

  1. Open the Online Map Viewer (Multi-Layer) and drop your data files.
  2. Click the basemap switcher control (usually a layers icon in the top-right corner).
  3. Browse the catalog of available basemap styles. Hover for a live preview.
  4. Select a basemap. The tile layer swaps instantly; your overlay data stays where it is.
  5. Optionally adjust basemap opacity with the slider.
  6. If you need a custom XYZ tile URL, paste it into the Add custom basemap field.
  7. For offline use, upload an MBTiles or PMTiles archive.

Worked Example: Picking a Basemap for a Bike Lane Audit

Imagine you have a GeoJSON layer of proposed and existing bike lanes in a mid-sized city and want to communicate to a city council what is built versus what is planned. You start with the default OSM basemap, but the green parks and pink commercial zones clash with your yellow-planned and orange-existing line symbology. Switch to CartoDB Positron (light gray) and suddenly your two colors are the only saturated thing on the map β€” council members instantly see the gap between the planned and built networks.

For a follow-up email with photos, switch to satellite imagery at street level to show council members the actual width of the existing streets. The same underlying data now tells a completely different story because the basemap changed.

Common Pitfalls and Gotchas

  • Rate-limiting. Free basemap providers (OSM tile servers, Stamen) enforce rate limits. Heavy use, especially in a shared classroom, can get you temporarily blocked. Use a commercial provider or host your own tiles for production work.
  • HTTPS mixed content. If your app runs on HTTPS but you try to pull tiles from an HTTP-only server, browsers will block them silently.
  • Retina display blur. Raster basemaps at standard 256-pixel tile size look blurry on high-DPI screens. Use a retina tile URL variant where available, or switch to vector basemaps.
  • Attribution removal. Some basemaps require on-map attribution. Removing it violates the terms of service for OSM, Mapbox, and others.
  • Inconsistent projections. Almost every public basemap uses Web Mercator. If you have a layer in a different CRS, reproject it first with the EPSG Reprojector & Coordinate Converter.
  • Labels underneath overlays. Many basemaps ship labels baked into the raster. If your overlay covers the area with filled polygons, the labels disappear. Use a no-labels variant and add a labels-only overlay on top.

Tips for Best Results

  • For choropleth maps, always pick a muted basemap (Positron, dark matter, or simple gray) so the thematic colors dominate.
  • For point-density visualizations, dark basemaps with bright points look striking and are easy to interpret.
  • Match the basemap tone to your audience. Business audiences prefer clean light basemaps; technical audiences appreciate terrain or satellite.
  • If you plan to print the map, make sure the basemap supports @2x tiles or is vector-based. Print CSS resolves at 300 DPI and low-DPI raster tiles will look pixelated.
  • Cache basemap tiles locally for field work. Hit the areas of interest ahead of time while on Wi-Fi to prime the browser's HTTP cache.
  • Use dark basemaps with the Heatmap Renderer for maximum visual impact.

Comparison with Desktop GIS Basemap Libraries

QGIS has the QuickMapServices plugin and a built-in XYZ Tiles browser that lets you add hundreds of providers. ArcGIS Pro ships with a basemap gallery dominated by Esri's own World Imagery, World Topographic, and World Streets layers. In both cases, the basemap is tied to a project file and the workflow is add a new basemap each time. The browser-based basemap switcher is lighter-weight: it is always there, never requires configuration, and swaps instantly.

The gis.tools implementation also avoids vendor lock-in. You can use Esri, Mapbox, Stadia, MapTiler, OSM, or any custom XYZ endpoint interchangeably. If you want to distribute a project with a specific offline basemap, package the MBTiles/PMTiles alongside your vector layers using the Layer Packaging Tool.

Performance Considerations

Basemap tiles are cached aggressively by your browser, so the second time you load a region, tiles come from disk (sub-millisecond) rather than the network. Initial loads depend on provider latency β€” OSM's default tile server is typically 100–300 ms per tile. A screen full of tiles at zoom 12 is about 15–20 tiles, so expect 1–2 seconds for first paint on a cold cache.

Vector basemaps have a different performance profile. The initial tile download is smaller, but the client has to triangulate and style every feature, which consumes CPU. On low-powered devices (old tablets, Chromebooks), raster tiles sometimes feel smoother.

Data Privacy and Browser-Based Processing

The basemap switcher respects your privacy the same way the rest of gis.tools does. Your overlay data never leaves your browser. However, basemap tile requests do go to the third-party tile provider (OSM, Mapbox, Esri), which will see your IP address and the tiles you request. If that is a concern, use offline MBTiles/PMTiles archives instead.

For truly sensitive work β€” intelligence, defense, human rights documentation β€” you can deploy the viewer against a local, self-hosted tile server with no external calls whatsoever.

Related GIS Concepts

Tile scheme. The mathematical grid that maps latitude/longitude to tile X/Y coordinates. Google/OSM/Web Mercator is by far the most common.

Retina / @2x tiles. 512Γ—512 pixel tiles that render at 256 CSS pixels on high-DPI devices, producing sharper labels and icons.

Vector tile style specification. A JSON document (Mapbox style spec) that tells a vector tile renderer how to draw each layer's features β€” colors, line widths, label placements.

TMS vs XYZ. Tile Map Service and XYZ are two similar but not identical tile URL schemes. TMS flips the Y axis. Most modern tools use XYZ.

Frequently Asked Questions

Is OpenStreetMap free to use as a basemap?

The tiles served by OSM's default tile server are free for low-volume personal use, but production applications should either use a commercial OSM-based provider (MapTiler, Stadia, Carto) or host their own tiles. Attribution is always required.

Can I use Google Maps as a basemap?

Google's Terms of Service generally forbid using Google Maps tiles in non-Google APIs. Use OpenStreetMap, Mapbox, Esri, or Stadia instead.

How do I add a custom basemap?

Paste your XYZ tile URL template (with {z}, {x}, {y} placeholders) into the custom basemap field. Provide attribution text as required by the provider.

Can I use the basemap switcher offline?

Yes. Load an MBTiles or PMTiles archive via the offline basemap option. Inspect the archive first with the PMTiles/MBTiles Inspector to make sure its zoom range covers your area.

Why does my overlay look misaligned with the satellite basemap?

Satellite imagery is typically aligned to WGS84 but sometimes has small registration errors, especially at the edges of tile regions. Also check that your overlay is actually in EPSG:4326, not a projected CRS.

Related Tools on gis.tools

100% client-side processing - your data stays private and never leaves your device