Geoportal Extension for OpenLayers
API Reference

Module: LayerUtils

module:~utils/LayerUtils

...

Example

import LayerUtils from "gpf-ext-ol/utils/LayerUtils"
ou 
import {LayerUtils} from "gpf-ext-ol
LayerUtils.getZoomLevelFromScaleDenominator();
LayerUtils.getAttributions();
LayerUtils.intersects();

Methods

innergetAttributions(params){Object}

Utils/LayerUtils.js, line 188

Get attributions list for a layer, based on current zoom and extent

Name Type Description
params Object

function params

Name Type Description
extent Array.<Float>

map current geographical extent (EPSG:4326) : [top, left, bottom, right] = [maxy, minx, miny, maxx]

zoom Number

map current zoom

crs String

map current projection code (ex "EPSG:2154")

visibility Boolean

layer visibility

originators Gp.Services.Config.Originator

resource originators (from Gp.Config.layers[].originators)

Returns:
- associative array, mapping originators url (keys) with their properties : html attributions elements

innergetZoomLevelFromScaleDenominator(scaleDenominator, crs){Integer}

Utils/LayerUtils.js, line 18

Obtenir le ZoomLevel à partir du ScaleDenominator

Name Type Description
scaleDenominator Number

the scale denominator

crs String

the crs

Returns:
level

innerintersects(extent1, extent2){Boolean}

Utils/LayerUtils.js, line 304

Determines if one extent (extent1) intersects another (extent2)

Name Type Description
extent1 Array.<Float>

First extent : [top, left, bottom, right] = [maxy, minx, miny, maxx]

extent2 Array.<Float>

Second extent : [top, left, bottom, right] = [maxy, minx, miny, maxx]

Returns:
- True if the two extents intersect, false otherwise.