Indexof

IndexofFixing Small WMS Layer Legends in QGIS: Scaling and Layout Guide › Last update: Mar 17, 2026@beysayaAbout › #FixingSmallWMSLayerLegendsinQGIS

Microscopic Symbols: Solving the WMS Layer Legend Scaling Issue in QGIS

Web Map Services (WMS) are the backbone of modern data sharing in Geographic Information Systems, but they come with a notorious limitation: the legend is often returned as a static image from a remote server. When working on high-resolution displays or complex Print Layouts in QGIS, these legend graphics frequently appear microscopic or illegible. Because the legend is generated by the provider's server (like GeoServer or MapServer) rather than QGIS itself, simply "dragging the corner" of the legend box often results in a pixelated mess rather than a clear key. This tutorial explores how to manipulate GetLegendGraphic requests and QGIS override settings to restore legibility to your map keys.

Table of Content

Purpose

The objective of this guide is to move beyond the default "as-is" rendering of WMS data. By the end of this tutorial, you will be able to:

  • Force Scaling: Append parameters to the WMS URL to request larger legend images from the server.
  • Override Layouts: Use the QGIS Print Layout "Legend" properties to scale icons independently of text.
  • Utilize Alternative Assets: Link to external high-resolution images when the WMS provider fails to scale.

Why WMS Legends Scale Poorly

WMS legends are fetched via a GetLegendGraphic request. By default, many servers assume a standard 90-96 DPI (Dots Per Inch). If your QGIS project is set to 300 DPI for printing, the legend stays at its original pixel dimensions, appearing four times smaller than it should. Since QGIS is essentially "requesting a picture," we have to change the instructions of that request to get a better result.

Step-by-Step: Three Ways to Increase Legend Size

Method 1: The Legend Graphic URL Override (Most Effective)

This method manually adjusts the request sent to the server to specify a larger size or higher DPI.

  1. Right-click your WMS layer in the Layers Panel and select Properties.
  2. Navigate to the Legend tab.
  3. Check the box for Legend Graphic.
  4. In the URL field, you can often append parameters like &LEGEND_OPTIONS=dpi:300 or &WIDTH=50&HEIGHT=50 (depending on the server type like GeoServer).

Method 2: Adjusting Print Layout Scaling

If you are in the Print Layout view and the legend is too small:

  1. Select the Legend item in your layout.
  2. In the Item Properties tab, scroll down to Main Properties.
  3. Look for WMS LegendGraphic.
  4. Adjust the Legend Graphic Width and Height sliders. Note: This scales the image, so if the server sends a low-res file, it may become blurry.

Method 3: The "DPI Mode" Fix

Some WMS providers support a MAP_RESOLUTION parameter. You can add this to the original WMS connection string:

# Example of a modified connection URL in the Browser panel
https://example.com/wms?SERVICE=WMS&MAP_RESOLUTION=300...

Use Case: Creating High-DPI Geological Maps

A cartographer is using a national WMS for soil classifications. In the QGIS Canvas, the legend looks fine, but when exporting a PDF at A0 size, the legend symbols are mere dots.

  • The Action: The user goes to Layer Properties > Legend and overrides the Legend Graphic URL by appending SCALE=2 to the request.
  • The Result: The server interprets this request and sends a graphic twice the original size, ensuring the PDF output is legible for field researchers.

Best Results

Technique Pros Cons
URL Parameter (DPI) Crystal clear, server-rendered scaling. Not supported by all WMS providers.
Layout Manual Resize Easy to do via UI sliders. Can cause pixelation/blurriness.
Static Image Replacement Total control over design. Legend won't update if data changes.

FAQ

Why is my WMS legend blurry after resizing?

This happens because you are scaling a low-resolution raster image. To fix this, you must use Method 1 to request a higher-resolution version directly from the server rather than stretching the small one in QGIS.

Does this work for WFS or WMTS?

WFS layers are vector-based, so QGIS generates the legend locally; you can just change font sizes. WMTS is tile-based and often doesn't support GetLegendGraphic at all, requiring you to use a static image.

Can I change the font of a WMS legend?

Generally, no. Since the image is generated by the server, the font is baked into the graphic. You can hide the WMS graphic and create a "fake" legend using QGIS shapes and text if you need specific branding.

Disclaimer

The success of these methods depends entirely on the capabilities of the remote WMS server (GeoServer, ArcGIS Server, etc.). Many public servers restrict the maximum width/height of a legend graphic to prevent server load. Use these overrides responsibly. March 2026.

Tags: QGIS_Tutorial, WMS_Legend, GIS_Cartography, Layout_Scaling



What’s new

Close [x]
Loading special offers...