# Locales

Locales are regional sub settings. Each locale is defined by a name, bounds and a set of layers.

It is possible to switch locales via the dropdown in the Layers control. The dropdown is only visible if more than one locale is defined in the workspace.

The current local is defined as a url hook. For example <https://geolytix.xyz/open/?locale=Global> will open the Global locale from the settings for the /open instance. If not defined, the first locale in the locales object will be the default.

This example shows all possible options:

```javascript
"locales": {
  "Global": {...}
  "UK": {
    "name": "United Kingdom",
    "gazetteer": {...},
    "bounds": {
      "north": 62,
      "east": 5,
      "south": 48,
      "west": -13
    },
    "showScaleBar": true,
    "maskBounds": true,
    "view": {
      "lat": 45,
      "lng": 60,
      "z": 3
    },
    "minZoom": 6,
    "maxZoom": 17,
    "layers": {...}
  }
}
```

Locales are JSON objects with a set of parameter.

The **name** value will be displayed in the locale dropdown. The locale key will be the default for the name value.

The locale's **bounds** are defined by their northern, eastern, southern and western border. The default bounds are for a global view.

Setting the **showScaleBar** entry will show a scale bar in the lower left corner of the map:

![](/files/-LWkO8A5iTV23nyvLPwB)

Setting the **maskBounds** entry will put a mask on the region which falls outside the locale bounds:

![](/files/-LWLf-CJSOhYnyXJSOrz)

The **min** and **maxZoom** define the outer zoom levels for the map object. The default zoom range is from 2 to 20.

Setting the **view** with latitude (**lat**), longitude (**lng**), and zoom (**z**) will define the view which is loaded if not overridden by either the init parameter or url hooks.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://geolytix.gitbook.io/xyz-developer-guide/workspaces/locales.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
