Options
All
  • Public
  • Public/Protected
  • All
Menu

A longitude-latitude grid. This class contains specific information about the grid, such as the increment between grid lines and various options for styling and labeling. To paint this grid on a map, create a new GridLayer with an object of this class as input.

since

2013.0

Hierarchy

  • LonLatGrid

Implements

Overview

Constructors

constructor

  • Constructs a new LonLatGrid. The constructor parameters determine how many grid lines are drawn for each scale. This cannot be changed afterwards.

    The creation of an example grid where the density of the grid lines increases when you zoom in is shown below:

      var settings=[];
      settings.push( {scale: 2.0E-8 * 4, deltaLon:  1, deltaLat:  1 });
      settings.push( {scale: 2.0E-8    , deltaLon:  5, deltaLat:  5 });
      settings.push( {scale: 9.0E-9    , deltaLon: 10, deltaLat: 10 });
      settings.push( {scale: 5.0E-9    , deltaLon: 20, deltaLat: 20 });
      settings.push( {scale: 0         , deltaLon: 45, deltaLat: 45 });
    
      var grid = new LonLatGrid( settings );

    This will for example show a grid line every 20 degrees longitude and every 20 degrees latitude for all scales between 5.0E-9 and 9.0E-9.

    By default the grid origin is located at (0,0). Optionally, you can specify a new origin as well.

      var grid = new LonLatGrid( settings, {originLon: 10, originLat: 10} );

    Parameters

    Returns LonLatGrid

Accessors

coordinateType

fallbackStyle

  • The style which will be used for scales which do not define their own style. If you want to modify the fallback style, you should replace this instance and not modify the existing instance.

    Defining a style for a specific scale can be done using the setStyle method.

    When this is not set, a default fallback style is used. The default style configuration may change over time, so it is encouraged to set this property explicitly.

    Null values are not allowed. To turn off the grid, you can always GridLayer.setPaintRepresentationVisible set the paint representations to false.

    Returns StyleSettings

  • The style which will be used for scales which do not define their own style. If you want to modify the fallback style, you should replace this instance and not modify the existing instance.

    Defining a style for a specific scale can be done using the setStyle method.

    When this is not set, a default fallback style is used. The default style configuration may change over time, so it is encouraged to set this property explicitly.

    Null values are not allowed. To turn off the grid, you can always GridLayer.setPaintRepresentationVisible set the paint representations to false.

    Parameters

    Returns any

modelDescriptor

originLat

  • get originLat(): number
  • The latitude of the grid origin.

    Returns number

originLon

  • get originLon(): number
  • The longitude of the grid origin.

    Returns number

reference

scales

  • get scales(): number[]
  • The different scales which were passed in the constructor.

    Returns number[]

Methods

getDeltaLat

  • (scaleIndex: number): number
  • Return the latitude line increment at the specified scale.

    Parameters

    • scaleIndex: number

      The index of the scale. Must be an index of the this.scales array.

    Returns number

    The latitude line increment.

getDeltaLon

  • (scaleIndex: number): number
  • Return the longitude line increment at the specified scale.

    Parameters

    • scaleIndex: number

      The index of the scale. Must be an index of the this.scales array.

    Returns number

    The longitude line increment.

getStyle

  • Returns the style which will be used to visualize the grid lines at the specified scale.

    You should not modify the StyleSettings instance returned by this method. If you want to modify the style for a certain scale, use the setStyle method to replace the style instance.

    Parameters

    • scaleIndex: number

      The index of the scale. Must be a valid index in the scales array.

    Returns StyleSettings | null

    The style for the specified scale. Will return null when no style was specified for that scale.

setStyle

  • Sets the style which needs to be used for the specified scale.

    Once a style is set, the style object should no longer be modified. If you want to modify the style for a certain scale afterwards, call this method again with the new/modified style instance.

    All scales for which no style is specified will be visualized using the fallback style.

    Parameters

    • scaleIndex: number

      The index of the scale. Must be a valid index in the this.scales array.

    • style: StyleSettings

      The style

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method