> For the complete documentation index, see [llms.txt](https://docs.mapsindoors.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mapsindoors.com/sdks-and-frameworks/web/display-rules-in-practice/icon-zoom-scaling.md). Agents can also search and read this documentation through its [MCP server](https://docs.mapsindoors.com/~gitbook/mcp).

# Icon Zoom Scaling

Zoom-responsive Icon scaling with the Web SDK v4

With Icon zoom scaling, Location Icons grow as the user zooms in, between two zoom levels set for the Solution. How much each Icon grows is the **Zoom scaling** value of its Display Rule. To learn how it works and how to set it up, read the CMS page [Icon Zoom Scaling](https://docs.mapsindoors.com/products/cms/display-rules/icon-zoom-scaling.md) first.

{% hint style="info" %}
Icon zoom scaling works with the Mapbox map view (`MapboxV3View`) only. Google Maps ignores it.
{% endhint %}

## Requirements

* Web SDK **4.62.0** or later.
* A Solution with Icon zoom scaling turned on in the CMS.

## No code changes needed

The SDK reads the zoom range and the Zoom scaling values from the Solution's CMS configuration and scales the Icons itself. Updating the SDK is all that's needed.

## Changing Zoom scaling at runtime

Zoom scaling is the `iconZoomFactor` property of a Display Rule. You can override it for specific Locations, like any other Display Rule property:

```javascript
// Keep these Locations at their normal size at every zoom level.
mapsIndoors.setDisplayRule(['locationId1', 'locationId2'], { iconZoomFactor: 1 });

// Let a Location grow to 1.5 times its normal size.
mapsIndoors.setDisplayRule('locationId3', { iconZoomFactor: 1.5 });

// Go back to the value from the CMS.
mapsIndoors.setDisplayRule('locationId3', null);
```

`iconZoomFactor` must be greater than 0 and at most 4. Other values are ignored.

## Reading the zoom range

The zoom range comes from the CMS. You can read it from the Solution config:

```javascript
const { iconScaleZoomFrom, iconScaleZoomTo } = mapsIndoors.getSolutionConfig();
```

Both are MapsIndoors zoom levels. When neither is set, Icon zoom scaling is off for the Solution.

## Dynamic icon scaling module

If your Solution uses the `dynamicIconScaling` module, Icon zoom scaling takes over when a valid zoom range is set, and the module's own Icon collision handling is turned off. Without a zoom range, the module works as before.

## Markers drawn by your app

The SDK only scales what it draws. If your app draws its own callouts, labels or markers at a fixed offset from a MapsIndoors Icon, they won't move as the Icon grows and may overlap it. Contact MapsPeople support if you need help adjusting them.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mapsindoors.com/sdks-and-frameworks/web/display-rules-in-practice/icon-zoom-scaling.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
