Interface GeoGraticuleGenerator

A Feature generator for graticules: a uniform grid of meridians and parallels for showing projection distortion. The default graticule has meridians and parallels every 10° between ±80° latitude; for the polar regions, there are meridians every 90°.

interface GeoGraticuleGenerator {
    extent(): [[number, number], [number, number]];
    extent(extent): GeoGraticuleGenerator;
    extentMajor(): [[number, number], [number, number]];
    extentMajor(extent): GeoGraticuleGenerator;
    extentMinor(): [[number, number], [number, number]];
    extentMinor(extent): GeoGraticuleGenerator;
    lines(): LineString[];
    outline(): Polygon;
    precision(): number;
    precision(angle): GeoGraticuleGenerator;
    step(): [number, number];
    step(step): GeoGraticuleGenerator;
    stepMajor(): [number, number];
    stepMajor(step): GeoGraticuleGenerator;
    stepMinor(): [number, number];
    stepMinor(step): GeoGraticuleGenerator;
    (): MultiLineString;
}
  • Returns a GeoJSON MultiLineString geometry object representing all meridians and parallels for this graticule.

    Returns MultiLineString

Methods

  • Returns the current minor extent, which defaults to ⟨⟨-180°, -80° - ε⟩, ⟨180°, 80° + ε⟩⟩.

    Returns [[number, number], [number, number]]

  • Sets the major and minor extents of this graticule.

    Parameters

    • extent: [[number, number], [number, number]]

      Extent to use for major and minor extent of graticule.

    Returns GeoGraticuleGenerator

  • Returns the current major extent, which defaults to ⟨⟨-180°, -90° + ε⟩, ⟨180°, 90° - ε⟩⟩.

    Returns [[number, number], [number, number]]

  • Sets the major extent of this graticule.

    Parameters

    • extent: [[number, number], [number, number]]

      Major extent of graticule.

    Returns GeoGraticuleGenerator

  • Returns the current minor extent, which defaults to ⟨⟨-180°, -80° - ε⟩, ⟨180°, 80° + ε⟩⟩.

    Returns [[number, number], [number, number]]

  • Sets the minor extent of this graticule.

    Parameters

    • extent: [[number, number], [number, number]]

      Minor extent of graticule.

    Returns GeoGraticuleGenerator

  • Returns an array of GeoJSON LineString geometry objects, one for each meridian or parallel for this graticule.

    Returns LineString[]

  • Returns a GeoJSON Polygon geometry object representing the outline of this graticule, i.e. along the meridians and parallels defining its extent.

    Returns Polygon

  • Returns the current precision, which defaults to 2.5°.

    Returns number

  • Sets the precision for this graticule, in degrees.

    Parameters

    • angle: number

      Precision in degrees.

    Returns GeoGraticuleGenerator

  • Returns the current minor step, which defaults to ⟨10°, 10°⟩.

    Returns [number, number]

  • Sets the major and minor step for this graticule

    Parameters

    • step: [number, number]

      Major and minor step to use for this graticule.

    Returns GeoGraticuleGenerator

  • Returns the current major step, which defaults to ⟨90°, 360°⟩.

    Returns [number, number]

  • Sets the major step for this graticule.

    Parameters

    • step: [number, number]

      Major step.

    Returns GeoGraticuleGenerator

  • Returns the current major step, which defaults to ⟨10°, 10°⟩.

    Returns [number, number]

  • Sets the minor step for this graticule.

    Parameters

    • step: [number, number]

      Minor step.

    Returns GeoGraticuleGenerator