<br />

> [!NOTE]
> **Note:** New in Looker 22.14, you can use GeoJSON files for custom map layers defined in the [`map_layer`](https://docs.cloud.google.com/looker/docs/reference/param-model-map-layer.md.txt) parameter.

## Usage

```
view: view_name {
  dimension: field_name {
    map_layer_name: name_of_map_layer
  }
}
```

|---|---|
| Hierarchy [View File](https://docs.cloud.google.com/looker/docs/reference/param-view.md.txt) [`view`](https://docs.cloud.google.com/looker/docs/reference/param-view-view.md.txt) [Field Type](https://docs.cloud.google.com/looker/docs/reference/param-field.md.txt) `map_layer_name` | Possible Field Types Dimension <br /> Accepts A map name specified in the model-level `map_layer` parameter <br /> |

## Basics

The `map_layer_name` parameter lets you associate a dimension with a TopoJSON or GeoJSON map layer. This lets users create [map charts](https://docs.cloud.google.com/looker/docs/visualization-types.md.txt#maps) by charting the values in the dimension on the map layer. For example, to be able to chart data by US state, you could associate a dimension called "State" to the built-in map layer `us_states`. You could also chart data in a dimension called "Neighborhood" to a custom map of New York City neighborhoods.

If you are using a custom TopoJSON or GeoJSON map, you must specify the map layer in the LookML model by using the [`map_layer`](https://docs.cloud.google.com/looker/docs/reference/param-model-map-layer.md.txt) parameter.

Dimensions of [`type: zipcode`](https://docs.cloud.google.com/looker/docs/reference/param-dimension-filter-parameter-types.md.txt#zipcode) automatically receive a `map_layer_name` of `us_zipcode_tabulation_areas`.

### Built-in map layers

Looker includes the following built-in map layers:

- `countries` --- Accepts full country names, [ISO 3166-1 alpha-3](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) three-letter country codes, and [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) two-letter country codes. If your data includes ISO 3166-1 alpha-2 country codes, using `map_layer_name` with the `countries` map is recommended to ensure that Looker interprets your data as country codes and not as state codes.

- `uk_postcode_areas` --- Accepts [UK postcode areas](https://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#Postcode_area) (for example, `L` for Liverpool, `RH` for Redhill, or `EH` for Edinburgh).

- `us_states` --- Accepts full state names or two-letter state
  abbreviations. Use a single consistent format in your underlying data column;
  if a column mixes full state names and two-letter abbreviations (for example,
  both `California` and `CA`), those values are not grouped together on a map.

- `us_counties_fips` --- Works on string fields that are five-character FIPS county codes for a US county. This layer works only on the interactive map.

- `us_zipcode_tabulation_areas` --- Works on string fields that are five-character US zip codes. Dimensions of [`type: zipcode`](https://docs.cloud.google.com/looker/docs/reference/param-dimension-filter-parameter-types.md.txt#zipcode) automatically use the `us_zipcode_tabulation_areas` map layer.

  > Zip code regions are based on the 2010 zip code tabulation areas (ZCTAs), so this map layer does not include many zip codes, such as those assigned to P.O. boxes, that do not map directly to regions.

## Example

    dimension: state {
      map_layer_name: us_states
      sql: ${TABLE}.state ;;
    }