Classdesc

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.

Fires

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

Api

Hierarchy

Constructors

  • Parameters

    • Optional options: 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

    Api

  • 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.

    Api

  • Clean up.

    Returns void

  • Protected

    Extension point for disposable objects.

    Returns void

  • Gets a value.

    Parameters

    • key: string

      Key name.

    Returns any

    Value.

    Api

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

    Parameters

    • Optional view: 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.

    Api

  • 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 boolean

    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.

    Observable

    Api

  • 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.

    Api

  • 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

    • Optional managed: boolean

      Layer is managed.

    Returns State

    Layer state.

  • Parameters

    • Optional states: State[]

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

    Returns State[]

    List of layer states.

    Abstract

  • Parameters

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

      Array of layers (to be modified in place).

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

    Array of layers.

    Abstract

  • 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.

    Observable

    Api

  • 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.

    Observable

    Api

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

    Returns LineString[]

    The meridians.

    Api

  • 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.

    Observable

    Api

  • 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.

    Observable

    Api

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

    Returns number

    The opacity of the layer.

    Observable

    Api

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

    Returns LineString[]

    The parallels.

    Api

  • Get an object of all property names and values.

    Returns {
        [x: string]: any;
    }

    Object.

    • [x: string]: any

    Api

  • Get an object of all property names and values.

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

    Object.

  • Returns undefined | number

    Render buffer.

  • Returns ((arg0, arg1) => undefined | null | number)

    Render order.

  • 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.

    Api

  • Returns State

    Source state.

    Abstract

  • 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

    Layer style.

    Api

  • Get the style function.

    Returns undefined | StyleFunction

    Layer style function.

    Api

  • 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.

    Observable

    Api

  • 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.

    Observable

    Api

  • Parameters

    • Optional type: 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

    • Optional view: 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.

    Api

  • 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) => unknown)

      Listener.

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns EventsKey | EventsKey[]

    Event key.

  • Protected

    Parameters

    • type: string | string[]

      Type.

    • listener: ((arg0) => 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.

  • Render declutter items for this layer

    Parameters

    • frameState: FrameState

      Frame state.

    Returns void

  • Sets a value.

    Parameters

    • key: string

      Key name.

    • value: any

      Value.

    • Optional silent: boolean

      Update without triggering an event.

    Returns void

    Api

  • Sets the background color.

    Parameters

    • Optional background: 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

    Observable

    Api

  • 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

    Api

  • 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

    Observable

    Api

  • 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

    Observable

    Api

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

    Parameters

    • minResolution: number

      The minimum resolution of the layer.

    Returns void

    Observable

    Api

  • 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

    Observable

    Api

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

    Parameters

    • opacity: number

      The opacity of the layer.

    Returns void

    Observable

    Api

  • 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
    • Optional silent: boolean

      Update without triggering an event.

    Returns void

    Api

  • Parameters

    • renderOrder: undefined | null | OrderFunction

      Render order.

    Returns void

  • Set the layer source.

    Parameters

    Returns void

    Observable

    Api

  • 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

    • Optional style: null | StyleLike | FlatStyleLike

      Layer style.

    Returns void

    Api

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

    Parameters

    • visible: boolean

      The visibility of the layer.

    Returns void

    Observable

    Api

  • 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

    Observable

    Api

  • 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) => 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.

    • Optional silent: boolean

      Unset without triggering an event.

    Returns void

    Api