Layer that renders a grid for a coordinate system (currently only EPSG:4326 is supported). Note that the view projection must define both extent and worldExtent.

import("../render/Event.js").RenderEvent

Hierarchy

Constructors

  • Parameters

    • Optionaloptions: Options

      Options.

    Returns Graticule

Properties

disposed: boolean

The object has already been disposed.

on: LayerOnSignature<EventsKey>
once: LayerOnSignature<EventsKey>
projection_: Projection
rendered: boolean
un: LayerOnSignature<void>

Methods

  • Parameters

    • key: string

      Key name.

    • listener: Listener

      Listener.

    Returns void

  • Parameters

    • type: string

      Type.

    • listener: Listener

      Listener.

    Returns void

  • Protected

    Apply any properties from another object without triggering events.

    Parameters

    • source: Object

      The source object.

    Returns void

  • Increases the revision counter and dispatches a 'change' event.

    Returns void

  • Protected

    Create a renderer for this layer.

    Returns CanvasVectorLayerRenderer

    A layer renderer.

  • Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a type property.

    Parameters

    • event: string | BaseEvent

      Event object.

    Returns undefined | boolean

    false if anyone called preventDefault on the event object or if any of the listeners returned false.

  • Clean up.

    Returns void

  • Protected

    Extension point for disposable objects.

    Returns void

  • Gets a value.

    Parameters

    • key: string

      Key name.

    Returns any

    Value.

  • Get the attributions of the source of this layer for the given view.

    Parameters

    • Optionalview: external.ol.View | ViewStateLayerStateExtent

      View or import("../Map.js").FrameState. Only required when the layer is not added to a map.

    Returns string[]

    Attributions for this layer at the given view.

  • Get the background for this layer.

    Returns false | BackgroundColor

    Layer background.

  • Returns string

    CSS class name.

  • Parameters

    • pixel: Pixel

      Pixel.

    Returns
        | null
        | Uint8Array
        | Uint8ClampedArray
        | Float32Array
        | DataView

    Pixel data.

  • Returns string

    Declutter

  • Return the module:ol/extent~Extent extent of the layer or undefined if it will be visible regardless of extent.

    Returns undefined | Extent

    The layer extent.

  • Parameters

    • pixel: Pixel

      Pixel.

    Returns Promise<FeatureLike[]>

    Promise that resolves with an array of features.

  • Get a list of object property names.

    Returns string[]

    List of property names.

  • Parameters

    • Optionalarray: Layer<external.olsource.Source, LayerRenderer<any>>[]

      Array of layers (to be modified in place).

    Returns Layer<external.olsource.Source, LayerRenderer<any>>[]

    Array of layers.

  • This method is not meant to be called by layers or layer renderers because the state is incorrect if the layer is included in a layer group.

    Parameters

    • Optionalmanaged: boolean

      Layer is managed.

    Returns State

    Layer state.

  • Parameters

    • Optionalstates: State[]

      Optional list of layer states (to be modified in place).

    Returns State[]

    List of layer states.

  • Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.

    Parameters

    • type: string

      Type.

    Returns undefined | Listener[]

    Listeners.

  • For use inside the library only.

    Returns null | external.ol.Map

    Map.

  • Return the maximum resolution of the layer. Returns Infinity if the layer has no maximum resolution set.

    Returns number

    The maximum resolution of the layer.

  • Return the maximum zoom level of the layer. Returns Infinity if the layer has no maximum zoom set.

    Returns number

    The maximum zoom level of the layer.

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

    Returns LineString[]

    The meridians.

  • Return the minimum resolution of the layer. Returns 0 if the layer has no minimum resolution set.

    Returns number

    The minimum resolution of the layer.

  • Return the minimum zoom level of the layer. Returns -Infinity if the layer has no minimum zoom set.

    Returns number

    The minimum zoom level of the layer.

  • Return the opacity of the layer (between 0 and 1).

    Returns number

    The opacity of the layer.

  • Get the list of parallels. Parallels are lines of equal latitude.

    Returns LineString[]

    The parallels.

  • Get an object of all property names and values.

    Returns {
        [x: string]: any;
    }

    Object.

    • [x: string]: any
  • Get an object of all property names and values.

    Returns null | {
        [x: string]: any;
    }

    Object.

  • Returns undefined | number

    Render buffer.

  • Get the renderer for this layer.

    Returns null | CanvasVectorLayerRenderer

    The layer renderer.

  • Get the version number for this object. Each time the object is modified, its version number will be incremented.

    Returns number

    Revision.

  • Returns State

    Source state.

  • Get the style for features. This returns whatever was passed to the style option at construction or to the setStyle method.

    Returns
        | undefined
        | null
        | StyleLike
        | FlatStyleLike

    Layer style.

  • Get the style function.

    Returns undefined | StyleFunction

    Layer style function.

  • Returns boolean

    Whether the rendered layer should be updated while animating.

  • Returns boolean

    Whether the rendered layer should be updated while interacting.

  • Return the value of this layer's visible property. To find out whether the layer is visible on a map, use isVisible() instead.

    Returns boolean

    The value of the visible property of the layer.

  • Return the Z-index of the layer, which is used to order layers before rendering. Returns undefined if the layer is unmanaged.

    Returns undefined | number

    The Z-index of the layer.

  • Parameters

    • Optionaltype: string

      Type. If not provided, true will be returned if this event target has any listeners.

    Returns boolean

    Has listeners.

  • Returns boolean

    The object has properties.

  • Returns boolean

    The layer has a renderer.

  • The layer is visible on the map view, i.e. within its min/max resolution or zoom and extent, not set to visible: false, and not inside a layer group that is set to visible: false.

    Parameters

    • Optionalview: external.ol.View | ViewStateLayerStateExtent

      View or import("../Map.js").FrameState. Only required when the layer is not added to a map.

    Returns boolean

    The layer is visible in the map view.

  • Update geometries in the source based on current view

    Parameters

    • extent: Extent

      Extent

    • resolution: number

      Resolution

    • projection: Projection

      Projection

    Returns void

  • Parameters

    • key: string

      Key name.

    • oldValue: any

      Old value.

    Returns void

  • Protected

    Parameters

    • type: string | string[]

      Type.

    • listener: ((arg0: Event | BaseEvent) => unknown)

      Listener.

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns EventsKey | EventsKey[]

    Event key.

  • Protected

    Parameters

    • type: string | string[]

      Type.

    • listener: ((arg0: Event | BaseEvent) => unknown)

      Listener.

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns EventsKey | EventsKey[]

    Event key.

  • Parameters

    • key: string

      Key name.

    • listener: Listener

      Listener.

    Returns void

  • Parameters

    • type: string

      Type.

    • listener: Listener

      Listener.

    Returns void

  • In charge to manage the rendering of the layer. One layer type is bounded with one layer renderer.

    Parameters

    • frameState: null | FrameState

      Frame state.

    • target: HTMLElement

      Target which the renderer may (but need not) use for rendering its content.

    Returns null | HTMLElement

    The rendered element.

  • Parameters

    • frameState: FrameState

      Frame state.

    • layerState: State

      Layer state.

    Returns void

  • When the renderer follows a layout -> render approach, do the final rendering here.

    Parameters

    • frameState: FrameState

      Frame state

    Returns void

  • Sets a value.

    Parameters

    • key: string

      Key name.

    • value: any

      Value.

    • Optionalsilent: boolean

      Update without triggering an event.

    Returns void

  • Sets the background color.

    Parameters

    • Optionalbackground: BackgroundColor

      Background color.

    Returns void

  • Set the extent at which the layer is visible. If undefined, the layer will be visible at all extents.

    Parameters

    • extent: undefined | Extent

      The extent of the layer.

    Returns void

  • Sets the layer to be rendered on top of other layers on a map. The map will not manage this layer in its layers collection. This is useful for temporary layers. To remove an unmanaged layer from the map, use #setMap(null).

    To add the layer to a map and have it managed by the map, use module:ol/Map~Map#addLayer instead.

    Parameters

    Returns void

  • For use inside the library only.

    Parameters

    Returns void

  • Set the maximum resolution at which the layer is visible.

    Parameters

    • maxResolution: number

      The maximum resolution of the layer.

    Returns void

  • Set the maximum zoom (exclusive) at which the layer is visible. Note that the zoom levels for layer visibility are based on the view zoom level, which may be different from a tile source zoom level.

    Parameters

    • maxZoom: number

      The maximum zoom of the layer.

    Returns void

  • Set the minimum resolution at which the layer is visible.

    Parameters

    • minResolution: number

      The minimum resolution of the layer.

    Returns void

  • Set the minimum zoom (inclusive) at which the layer is visible. Note that the zoom levels for layer visibility are based on the view zoom level, which may be different from a tile source zoom level.

    Parameters

    • minZoom: number

      The minimum zoom of the layer.

    Returns void

  • Set the opacity of the layer, allowed values range from 0 to 1.

    Parameters

    • opacity: number

      The opacity of the layer.

    Returns void

  • Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).

    Parameters

    • values: {
          [x: string]: any;
      }

      Values.

      • [x: string]: any
    • Optionalsilent: boolean

      Update without triggering an event.

    Returns void

  • Parameters

    • renderOrder: undefined | null | OrderFunction

      Render order.

    Returns void

  • Set the layer source.

    Parameters

    Returns void

  • Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If set to null, the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. Call setStyle() without arguments to reset to the default style. See [the ol/style/Style module]module:ol/style/Style~Style for information on the default style.

    If your layer has a static style, you can use [flat style]module:ol/style/flat~FlatStyle object literals instead of using the Style and symbolizer constructors (Fill, Stroke, etc.):

    vectorLayer.setStyle({
    "fill-color": "yellow",
    "stroke-color": "black",
    "stroke-width": 4
    })

    Parameters

    • Optionalstyle: null | StyleLike | FlatStyleLike

      Layer style.

    Returns void

  • Set the visibility of the layer (true or false).

    Parameters

    • visible: boolean

      The visibility of the layer.

    Returns void

  • Set Z-index of the layer, which is used to order layers before rendering. The default Z-index is 0.

    Parameters

    • zindex: number

      The z-index of the layer.

    Returns void

  • Strategy function for loading features based on the view's extent and resolution.

    Parameters

    • extent: Extent

      Extent.

    • resolution: number

      Resolution.

    Returns Extent[]

    Extents.

  • Protected

    Unlisten for a certain type of event.

    Parameters

    • type: string | string[]

      Type.

    • listener: ((arg0: Event | BaseEvent) => unknown)

      Listener.

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns void

  • Called when a layer is not visible during a map render.

    Returns void

  • Unsets a property.

    Parameters

    • key: string

      Key name.

    • Optionalsilent: boolean

      Unset without triggering an event.

    Returns void