Helper class to parse capabilities of WMS layers
+Helper class to parse capabilities of WMS layers
CapabilitiesUtil
-Static
getStatic
getStatic
getReturns the layers from a parsed WMS GetCapabilities object.
+Static
getReturns the layers from a parsed WMS GetCapabilities object.
A capabilities object.
Configure the field which should be set as the 'name' property in the openlayers layer.
-Optional
proxyFn: ((proxyUrl: string) => string)Optional proxy function which can be applied to +
Optional
proxyFn: (proxyUrl: string) => stringOptional proxy function which can be applied to
GetMap
, GetFeatureInfo
and GetLegendGraphic
requests to avoid CORS issues.
Array of OlLayerImage
-Static
getArray of OlLayerImage
+Static
getFetches and parses the WMS Capabilities document for the given URL.
Url to WMS capabilities document.
Optional fetch options to make use of while requesting the Capabilities.
An object representing the WMS capabilities.
-Static
getFetches and parses the WMS Capabilities document for the given layer.
+Static
getFetches and parses the WMS Capabilities document for the given layer.
The layer to the get the Capabilites for.
Optional fetch options to make use of while requesting the Capabilities.
An object representing the WMS capabilities.
-Helper class for working with OpenLayers features.
+Helper class for working with OpenLayers features.
FeatureUtil
-Static
getStatic
getReturns the featureType name out of a given feature. It assumes that the feature has an ID in the following structure FEATURETYPE.FEATUREID.
The feature to obtain the featureType name from.
-The (unqualified) name of the featureType or undefined if +
The (unqualified) name of the featureType or undefined if the name could not be picked.
-Static
getExtracts the featureType name from given GetFeatureInfo URL. +
Static
getExtracts the featureType name from given GetFeatureInfo URL. This method is mostly useful for raster layers which features could have no ID set.
GetFeatureInfo URL possibly containing featureType name.
Whether the qualified featureType name should be returned or not. Default is true.
-Obtained featureType name as string.
-Static
mapObtained featureType name as string.
+Static
mapStatic
resolveResolves the given template string with the given feature attributes, e.g. +
Static
resolveResolves the given template string with the given feature attributes, e.g. the template "Size of area is {{AREA_SIZE}} km²" would be to resolved to "Size of area is 1909 km²" (assuming the feature's attribute AREA_SIZE really exists).
@@ -28,13 +28,13 @@The template string to resolve.
Optional
noValueFoundText: string = 'n.v.'The text to apply, if the templated value could not be found, default is to 'n.v.'.
-Optional
valueAdjust: ((key: string, val: any) => any) = ...A method that will be called with each +
Optional
valueAdjust: (key: string, val: any) => any = ...A method that will be called with each key/value match, we'll use what this function returns for the actual replacement. Optional, defaults to a function which will return the raw value it received. This can be used for last minute adjustments before replacing happens, e.g. to filter out falsy values or to do number formatting and such.
-If set to true, template won't be wrapped into +
If set to true, template won't be wrapped into -tag and will be returned as URL. Default is false.
The resolved template string.
-Helper class for adding layers from various file formats.
-Static
addAdds a new vector layer from a geojson string.
-the geojson string or object
+Helper class for adding layers from various file formats.
+Static
addAdds a new vector layer from a geojson string.
+the geojson string or object
the map to add the layer to
-Static
addStatic
addStatic
addStatic
addHelper class for the geospatial analysis. Makes use of +
Helper class for the geospatial analysis. Makes use of Turf.js.
GeometryUtil
-Static
addAdds a buffer to a given geometry.
+unionStatic
addAdds a buffer to a given geometry.
If the target is of type ol.Feature it will return an ol.Feature. If the target is of type ol.geom.Geometry it will return ol.geom.Geometry.
-The geometry.
+The geometry.
The buffer to add in meters.
The projection of the input geometry as EPSG code. Default is to EPSG:3857.
-The geometry or feature with the added buffer.
-Static
addThe geometry or feature with the added buffer.
+Static
addAdds a buffer to a given geometry.
The geometry.
The buffer to add in meters.
The projection of the input geometry as EPSG code. Default is to EPSG:3857.
-The geometry with the added buffer.
-Static
differenceThe geometry with the added buffer.
+Static
differenceFinds the difference between two polygons by clipping the second polygon from the first.
If both polygons are of type ol.Feature it will return an ol.Feature. Else it will return an ol.geom.Geometry.
-The projection of the input polygons as EPSG code. +
The projection of the input polygons as EPSG code. Default is to EPSG:3857.
-A Feature or geometry +
A Feature or geometry with the area of polygon1 excluding the area of polygon2.
-Static
geometryFinds the difference between two polygons by clipping the second polygon from the first.
+Static
geometryFinds the difference between two polygons by clipping the second polygon from the first.
An ol.geom.Geometry
An ol.geom.Geometry
The projection of the input polygons as EPSG code. Default is to EPSG:3857.
-A with the area +
A with the area of polygon1 excluding the area of polygon2.
-Static
geometryTakes two polygons and finds their intersection.
-An ol.geom.Geometry
-An ol.geom.Geometry
+Static
geometryTakes two polygons and finds their intersection.
+An ol.geom.Geometry
+An ol.geom.Geometry
The projection of the input polygons as EPSG code. Default is to EPSG:3857.
-A Geometry with the +
A Geometry with the shared area of the two polygons or null if the polygons don't intersect.
-Static
intersectionTakes two polygons and finds their intersection.
+Static
intersectionTakes two polygons and finds their intersection.
If both polygons are of type ol.Feature it will return an ol.Feature. Else it will return an ol.geom.Geometry.
-The projection of the input polygons as EPSG code. +
The projection of the input polygons as EPSG code. Default is to EPSG:3857.
-A Feature or Geometry +
A Feature or Geometry with the shared area of the two polygons or null if the polygons don't intersect.
-Static
mergeStatic
separateSplits an array of geometries (and multi geometries) or a single MultiGeom +
Static
mergeMerges multiple geometries into one MultiGeometry.
+An array of ol.geom.geometries;
+A Multigeometry.
+Static
separateSplits an array of geometries (and multi geometries) or a single MultiGeom into an array of single geometries.
-An (array of) ol.geom.geometries;
+An (array of) ol.geom.geometries;
An array of geometries.
-Static
splitSplits an OlFeature with/or ol.geom.Polygon by an OlFeature with/or ol.geom.LineString +
Static
splitSplits an OlFeature with/or ol.geom.Polygon by an OlFeature with/or ol.geom.LineString into an array of instances of OlFeature with/or ol.geom.Polygon. If the target polygon (first param) is of type ol.Feature it will return an array with ol.Feature. If the target polygon (first param) is of type ol.geom.Geometry it will return an array with ol.geom.Geometry.
-The polygon geometry to split.
+The polygon geometry to split.
The line geometry to split the polygon geometry with.
The EPSG code of the input features. Default is to EPSG:3857.
-An array of instances of OlFeature +
An array of instances of OlFeature with/or ol.geom.Polygon
-Static
splitSplits an ol.geom.Polygon by an ol.geom.LineString +
Static
splitSplits an ol.geom.Polygon by an ol.geom.LineString into an array of instances of ol.geom.Polygon.
The polygon geometry to split.
The line geometry to split the polygon @@ -83,16 +83,16 @@
The EPSG code of the input features. Default is to EPSG:3857.
An array of instances of ol.geom.Polygon
-Static
unionTakes two or more polygons and returns a combined (Multi-)polygon.
-An +
Static
unionTakes two or more polygons and returns a combined (Multi-)polygon.
+An array of ol.Feature or ol.geom.Geometry instances of type (Multi)-Polygon.
The projection of the input polygons as EPSG code. Default is to EPSG:3857.
-A Feature or Geometry with +
A Feature or Geometry with the combined area of the (Multi-)polygons.
-Static
unionTakes two or more polygons and returns a combined (Multi-)polygon.
-An array of ol.geom.Geometry instances of type (Multi-)polygon.
+Static
unionTakes two or more polygons and returns a combined (Multi-)polygon.
+An array of ol.geom.Geometry instances of type (Multi-)polygon.
The projection of the input polygons as EPSG code. Default is to EPSG:3857.
-A FGeometry with the combined area of the (Multi-)polygons.
-A FGeometry with the combined area of the (Multi-)polygons.
+Helper class for layer interaction.
+Helper class for layer interaction.
LayerUtil
-Static
getStatic
getReturns the extent of the given layer as defined in the appropriate Capabilities document.
Optional fetch options to make use of while requesting the Capabilities.
The extent of the layer.
-Static
getReturns all attributions as text joined by a separator.
-The layer to get the attributions from.
+Static
getReturns all attributions as text joined by a separator.
+The layer to get the attributions from.
The separator separating multiple attributions.
Whether to remove duplicated attribution strings or not.
The attributions.
-Static
getReturns the configured URL of the given layer.
-The layer +
Static
getStatic
mapConverts a given OpenLayers layer to an inkmap layer spec.
-Static
mapConverts a given OpenLayers layer to an inkmap layer spec.
+Helper class for the OpenLayers map.
-Static
generateConverts a given OpenLayers map to an inkmap spec. Only returns options which can be +
Helper class for the OpenLayers map.
+Static
generateConverts a given OpenLayers map to an inkmap spec. Only returns options which can be derived from a map (center, scale, projection, layers).
The ol map.
-Promise of the inmkap print spec.
-Static
getReturns all layers of a collection. Even the hidden ones.
-The collection to get the layers +
Promise of the inmkap print spec.
+Static
getReturns all layers of a collection. Even the hidden ones.
+The collection to get the layers from. This can be an ol.layer.Group or an ol.Map.
-Optional
filter: ((olLayer: BaseLayer) => boolean) = ...A filter function that receives the layer. +
Optional
filter: (olLayer: BaseLayer) => boolean = ...A filter function that receives the layer. If it returns true it will be included in the returned layers.
-An array of all Layers.
-Static
getAn array of all Layers.
+Static
getStatic
getReturns the layer from the provided map by the given feature.
+Static
getReturns the layer from the provided map by the given feature.
The map to use for lookup.
The feature to get the layer by.
list of supported GeoServer namespaces.
-The result layer or undefined if the layer could not +
The result layer or undefined if the layer could not be found.
-Static
getReturns the layer from the provided map by the given name.
+Static
getStatic
getReturns the layer from the provided map by the given name +
Static
getReturns the layer from the provided map by the given name (parameter LAYERS).
The map to use for lookup.
The name to get the layer by.
-The result layer or undefined if the layer could not be found.
-Static
getThe result layer or undefined if the layer could not be found.
+Static
getStatic
getGet information about the LayerPosition in the tree.
+The layer.
+Static
getGet information about the LayerPosition in the tree.
The layer to get the information.
-The groupLayer or map +
The groupLayer or map containing the layer.
The groupLayer containing the layer and the position of the layer in the collection.
-Static
getReturns all layers of the specified layer group recursively.
+Static
getStatic
getReturns the list of layers matching the given pair of properties.
+Static
getStatic
getGet the getlegendGraphic url of a layer. Designed for geoserver. +
Static
getGet the getlegendGraphic url of a layer. Designed for geoserver. Currently supported Sources:
The getLegendGraphicUrl.
-Static
getStatic
getCalculates the appropriate map resolution for a given scale in the given units.
See: https://gis.stackexchange.com/questions/158435/ how-to-get-current-scale-in-openlayers-3
-The input scale to calculate the appropriate +
The input scale to calculate the appropriate resolution for.
The units to use for calculation (m or degrees).
-The calculated resolution.
-Static
getStatic
getReturns the appropriate scale for the given resolution and units.
+The resolutions to calculate the scale for.
The units the resolution is based on, typically either 'm' or 'degrees'.
-The appropriate scale.
-Static
getThe appropriate scale.
+Static
getReturns the appropriate zoom level for the given scale and units.
Map scale to get the zoom for.
Resolutions array.
The units the resolutions are based on, typically either 'm' or 'degrees'. Default is 'm'.
Determined zoom level for the given scale.
-Static
isStatic
layerChecks whether the resolution of the passed map's view lies inside of the min- and max-resolution of the passed layer, e.g. whether the layer should be displayed at the current map view resolution.
Optional
layer: BaseLayerThe layer to check.
@@ -110,14 +110,14 @@ the layer should be displayed at the current map view resolution. Will befalse
when no layer
or no map
is passed or if the view of the
map is falsy or does not have a resolution (yet).
-Static
roundRounds a scale number depending on its size.
+Static
roundStatic
setSet visibility for layer having names (if in map)
+Static
setSet visibility for layer having names (if in map)
The OpenLayers map.
An array of layer names (feature type names can also be used)
if layer should be visible or not
-Static
zoomStatic
zoomThis class provides some static methods which might be helpful when working +
This class provides some static methods which might be helpful when working with measurements.
MeasureUtil
-Static
angleDetermine the angle between two coordinates. The angle will be between
+format
Static
angleDetermine the angle between two coordinates. The angle will be between -180° and 180°, with 0° being in the east. The angle will increase counter-clockwise.
Inspired by https://stackoverflow.com/a/31136507
@@ -21,7 +21,7 @@The end coordinates of the line with the
x-coordinate being at index 0
and y-coordinate being at index 1
.
the angle in degrees, ranging from -180° to 180°.
-Static
angle360Determine the angle between two coordinates. The angle will be between +
Static
angle360Determine the angle between two coordinates. The angle will be between 0° and 360°, with 0° being in the east. The angle will increase counter-clockwise.
Inspired by https://stackoverflow.com/a/31136507
@@ -30,7 +30,7 @@The end coordinates of the line with the
x-coordinate being at index 0
and y-coordinate being at index 1
.
the angle in degrees, ranging from 0° and 360°.
-Static
formatReturns the angle of the passed linestring in degrees, with 'N' being the +
Static
formatReturns the angle of the passed linestring in degrees, with 'N' being the 0°-line and the angle increases in clockwise direction.
The linestring to get the angle from. As this line is coming from our internal draw @@ -38,32 +38,32 @@
How many decimal places will be allowed for the measure tooltips.
The formatted angle of the line.
-Static
formatFormat area output for the tooltip.
-The drawn geometry (circle or polygon).
+Static
formatFormat area output for the tooltip.
+The drawn geometry (circle or polygon).
An OlMap.
How many decimal places will be allowed for the measure tooltips.
Is the measurement geodesic.
The formatted area of the polygon.
-Static
formatFormat length output for the tooltip.
+Static
formatFormat length output for the tooltip.
The drawn line.
An OlMap.
How many decimal places will be allowed for the measure tooltips
Is the measurement geodesic (default is true).
The formatted length of the line (units: km, m or mm).
-Static
getGet the area of an OlGeomPolygon.
+Static
getGet the area of an OlGeomPolygon.
The drawn polygon.
An OlMap.
Is the measurement geodesic (default is true).
Sphere radius. By default, the radius of the earth is used (Clarke 1866 Authalic Sphere, 6371008.8).
The area of the polygon in square meter.
-Static
getGet the estimated area of an OlGeomCircle.
+Static
getStatic
getGet the length of a OlGeomLineString.
+Static
getGet the length of a OlGeomLineString.
The drawn line.
An OlMap.
Is the measurement geodesic (default is true).
@@ -72,14 +72,14 @@Set the decimal precision on length value for non-geodesic map (default value 6)
The length of line in meters.
-Static
makeGiven an angle between 0° and 360° this angle returns the exact opposite +
Static
makeGiven an angle between 0° and 360° this angle returns the exact opposite of the angle, e.g. for 90° you'll get back 270°. This effectively turns the direction of the angle from counter-clockwise to clockwise.
The input angle obtained counter-clockwise.
The clockwise angle.
-Static
makeThis methods adds an offset of 90° to an counter-clockwise increasing +
Static
makeThis methods adds an offset of 90° to an counter-clockwise increasing angle of a line so that the origin (0°) lies at the top (in the north).
The input angle obtained counter-clockwise, with 0° degrees being in the east.
The adjusted angle, with 0° being in the north.
-Helper class for some operations related to permalink function.
-Static
applyApplies an existing permalink to the given map.
+Helper class for some operations related to permalink function.
+Static
applyApplies an existing permalink to the given map.
The OpenLayers map.
The separator of the layers list and center coordinates in the link. Default is to ';'.
-Function to generate the identifier of the +
Function to generate the identifier of the layer in the link. Default is the name (given by the associated property) of the layer.
-Function to filter layers that should be +
Function to filter layers that should be handled by the link. Default is to consider all current map layers of type ol/layer/Tile.
-The customLayerAttributes, if defined. Otherwise null.
-Static
getThe customLayerAttributes, if defined. Otherwise null.
+Static
getCreates a permalink based on the given map state. It will contain the current view state of the map (center and zoom) as well as the current (filtered) list of layers.
The OpenLayers map
The separator for the layers list and center coordinates in the link. Default is to ';'.
-Function to generate the identifier of the +
Function to generate the identifier of the layer in the link. Default is the name (given by the associated property) of the layer.
-Function to filter layers that should be +
Function to filter layers that should be added to the link. Default is to add all visible layers of type ol/layer/Tile.
-Custom layer attributes which will be saved in the permalink for each layer.
+Custom layer attributes which will be saved in the permalink for each layer.
The permalink.
-Static
setSearch through the given Ol-Collection for the given id and +
Static
setSearch through the given Ol-Collection for the given id and set all parenting groups visible.
The openlayers map
The Openlayers Collection
Ther layer ol uid to search for
-Helper class for projection handling. Makes use of +
Helper class for projection handling. Makes use of Proj4js.
ProjectionUtil
-Static
initRegisters custom CRS mappings to allow automatic CRS detection. Sometimes
FeatureCollections returned by the GeoServer may be associated with
CRS identifiers (e.g. "urn:ogc:def:crs:EPSG::25832") that aren't
supported by proj4
and OpenLayers
per default. Add appropriate
mappings to allow automatic CRS detection by OpenLayers
here.
The custom CRS mappings which will be +
The custom CRS mappings which will be
added additionally to the by default available (s. defaultProj4CrsMappings
above).
Whether the default CRS should be mapped as well or not. Default is true.
-Static
initRegisters custom CRS definitions to the application.
-Optional
customCrsDefs: CrsDefinition | CrsDefinition[]The custom proj4
definitions
+
Static
initRegisters custom CRS definitions to the application.
+Optional
customCrsDefs: CrsDefinition | CrsDefinition[]The custom proj4
definitions
which should be registered additionally to default available CRS (s.
defaultProj4CrsDefinitions
above) as well.
Further CRS definitions in proj4 format can be checked under
http://epsg.io (e.g. http://epsg.io/3426.proj4).
Whether the default CRS should be registered or not. Default is true.
-Static
toStatic
toStatic
toConverts geographic coordinates given in DDD format like DD.DDDD°
to
+
Static
toStatic
zerofillAdds leading zero to all values less than 10 and returns this new +
Static
zerofillAdds leading zero to all values less than 10 and returns this new zerofilled value as String. Values which are greater than 10 are not affected.
-Value to be zerofilled.
+Value to be zerofilled.
converted value with leading zero if necessary.
-Helper class for building filters to be used with WFS GetFeature requests.
+Helper class for building filters to be used with WFS GetFeature requests.
WfsFilterUtil
-Static
getStatic
getCreates GetFeature request body for all provided featureTypes and applies related filter encoding on it.
The search config
Search string to be used with filter.
-Optional
attributionOptional
formatOptional
geojsonOptional
layerOptional
layerOptional
legendOptional
matrixOptional
opacityOptional
projectionOptional
requestOptional
styleOptional
tiledOptional
tileOptional
attributionOptional
formatOptional
geojsonOptional
layerOptional
layerOptional
legendOptional
matrixOptional
opacityOptional
projectionOptional
requestOptional
styleOptional
tiledOptional
tileOptional
projectionOptional
projectionOptional
attributionOptional
formatOptional
layerOptional
layerOptional
legendOptional
matrixOptional
opacityOptional
projectionOptional
requestOptional
tileOptional
attributionOptional
formatOptional
layerOptional
layerOptional
legendOptional
matrixOptional
opacityOptional
projectionOptional
requestOptional
tileOptional
featureOptional
filterOptional
geometryOptional
maxOptional
olOptional
outputOptional
propertyOptional
srsOptional
wfsOptional
featureOptional
filterOptional
geometryOptional
maxOptional
olOptional
outputOptional
propertyOptional
srsOptional
wfsA nested object mapping feature types to an object of their attribute details.
+A nested object mapping feature types to an object of their attribute details.
Example:
attributeDetails: {
featType1: {
attr1: {
matchCase: true,
type: 'number',
exactSearch: false
},
attr2: {
matchCase: false,
type: 'string',
exactSearch: true
}
},
featType2: {...}
}
-Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Default proj4 CRS definitions.
-Const
Default proj4 CRS definitions.
+Const
Default mappings for CRS identifiers (e.g. "urn:ogc:def:crs:EPSG::25832").
-Const
Default mappings for CRS identifiers (e.g. "urn:ogc:def:crs:EPSG::25832").
+
This class provides some static methods which might be helpful when working +
- Preparing search index...
- The search index is not available
@terrestris/ol-utilClass default
This class provides some static methods which might be helpful when working with digitize functions to animate features.
AnimateUtil
-Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static
moveMoves / translates an
OlFeature
to the givenpixel
delta +Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static
move    map: Map,
    layer: VectorLayer<VectorSource<Feature<Geometry>>, Feature<Geometry>>,
    featureToMove: Feature<Geometry>,
    duration: number,
    pixel: number,
    style?: Style,
): Promise<Feature<Geometry>>
Moves / translates an
OlFeature
to the givenpixel
delta in the end with givenduration
in ms, using the given style.Parameters
An OlMap.
-A vector layer to receive a +
A vector layer to receive a postrender event.
The feature to move.
The duration in ms for the moving to complete.
Delta of pixels to move the feature.
Optional
style: StyleThe style to use when moving the feature.
Returns Promise<Feature<Geometry>>
Promise of the moved feature.
-Settings
On This Page
Constructors
Methods
Settings
On This Page
Constructors
Methods