OpenLayers v4.0.1 API - Class: Graticule

# Class: Graticule

This documentation is for OpenLayers v4.0.1. The latest is v.

## ol.Graticule

#### new ol.Graticule(opt_options)

src/ol/graticule.js, line 19

  Render a grid for a coordinate system on a map.

  Name | Type | Description
  --- | --- | ---

  `options`

  Options.

  Name | Type | Description
  --- | --- | ---
  `map` | ol.Map | undefined | Reference to an `ol.Map` object.
  `maxLines` | number | undefined | The maximum number of meridians and parallels from the center of the map. The default value is 100, which means that at most 200 meridians and 200 parallels will be displayed. The default value is appropriate for conformal projections like Spherical Mercator. If you increase the value more lines will be drawn and the drawing performance will decrease.
  `strokeStyle` | ol.style.Stroke | undefined | The stroke style to use for drawing the graticule. If not provided, the lines will be drawn with `rgba(0,0,0,0.2)`, a not fully opaque black.
  `targetSize` | number | undefined | The target size of the graticule cells, in pixels. Default value is 100 pixels.

### Methods

#### getMap(){ol.Map}

src/ol/graticule.js, line 317

  Get the map associated with this graticule.

  ##### Returns:

  The map.

#### getMeridians(){Array.<ol.geom.LineString>}

src/ol/graticule.js, line 347

  Get the list of meridians. Meridians are lines of equal longitude.

  ##### Returns:

  The meridians.

#### getParallels(){Array.<ol.geom.LineString>}

src/ol/graticule.js, line 377

  Get the list of parallels. Pallels are lines of equal latitude.

  ##### Returns:

  The parallels.

#### setMap(map)

src/ol/graticule.js, line 490

  Set the map for this graticule. The graticule will be rendered on the provided map.

  Name | Type | Description
  --- | --- | ---
  `map` | ol.Map | Map.