# Code coverage report for ol/imageurlfunction.js

## Statements: 100% (9 / 9) Branches: 100% (0 / 0) Functions: 100% (3 / 3) Lines: 100% (9 / 9) Ignored: none

All files » ol/ » imageurlfunction.js

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    471
    1

    1

    1

    1

    5

    5

    1

    1

     goog.provide('ol.ImageUrlFunction');
    goog.provide('ol.ImageUrlFunctionType');

    goog.require('ol.Size');

    /**
     * @typedef {function(this:ol.source.Image, ol.Extent, ol.Size,
     *     ol.proj.Projection): (string|undefined)}
     */
    ol.ImageUrlFunctionType;

    /**
     * @param {string} baseUrl Base URL (may have query data).
     * @param {Object.<string,*>} params to encode in the URL.
     * @param {function(string, Object.<string,*>, ol.Extent, ol.Size,
     *     ol.proj.Projection): (string|undefined)} paramsFunction params function.
     * @return {ol.ImageUrlFunctionType} Image URL function.
     */
    ol.ImageUrlFunction.createFromParamsFunction =
        function(baseUrl, params, paramsFunction) {
      return (
          /**
           * @this {ol.source.Image}
           * @param {ol.Extent} extent Extent.
           * @param {ol.Size} size Size.
           * @param {ol.proj.Projection} projection Projection.
           * @return {string|undefined} URL.
           */
          function(extent, size, projection) {
            return paramsFunction(baseUrl, params, extent, size, projection);
          });
    };

    /**
     * @this {ol.source.Image}
     * @param {ol.Extent} extent Extent.
     * @param {ol.Size} size Size.
     * @return {string|undefined} Image URL.
     */
    ol.ImageUrlFunction.nullImageUrlFunction =
        function(extent, size) {
      return undefined;
    };