Skip to content

Commit

Permalink
Merge pull request #1190 from openlayers/convert_all_wms_load_functions
Browse files Browse the repository at this point in the history
Convert all image WMS load functions
  • Loading branch information
gberaudo authored Apr 24, 2024
2 parents 088b1fa + 101b9c5 commit 85d262f
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 114 deletions.
11 changes: 11 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog


## v 2.20.0

* Changes
* Convert all image WMS sources regardless of their load functions
* Allow to force a specific tileLoadFunction using the olcs\_tileLoadFunction property
* Test with OL 9.1

* Breaking changes
* Rename all 'olcs.xx' properties to 'olcs\_xx' and document them in PROPERTIES.md

## v 2.19.3

* Changes
Expand Down
27 changes: 24 additions & 3 deletions PROPERTIES.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# OLCEsium Properties
# OLCEsium Properties

## olcs_extruded_height
## olcs_extruded_height
Value: number
The distance in meters between the polygon's extruded face and the ellipsoid surface.
Check buildings example for usage in context.

## olcs_shadows
Value: boolean
Enables shadow casting in 3D. Can be either applied to the entire feature set or by feature individually.
Enables shadow casting in 3D. Can be either applied to the entire feature set or by feature individually.
In order for it to work, [shadowMap](https://cesium.com/learn/cesiumjs/ref-doc/Scene.html?classFilter=scene#shadowMap) needs to be enabled in the Cesium scene. To use the sun as light source, enable [enableLighting](https://cesium.com/learn/cesiumjs/ref-doc/Globe.html#enableLighting) on the Globe.
Check buildings example for usage in context.

Expand All @@ -33,5 +33,26 @@ Value: number
Allows you to set a minimum zoom level for rendering 3D tiles in the Cesium view. This property helps to control the level of detail displayed in the 3D view based on the current zoom level.
Check mvt example for usage in context.

## olcs_tileLoadFunction (ImageWMS sources)
Value: https://openlayers.org/en/latest/apidoc/module-ol_Tile.html#~LoadFunction
Allows to use a custom function, for example when converting a WMS image source to a tiled one.

## olcs_projection
Value: https://openlayers.org/en/latest/apidoc/module-ol_proj_Projection-Projection.html
Allows to use an alternative projection in CesiumJS. See the customProj example.

## olcs_polygon_kind
Value: "rectangle"
Allows to use the Cesium Rectangle geometry instead of a polygon geometry. See the vector example.

## olcs_3d_geometry (OL vector source)
Value: https://openlayers.org/en/latest/apidoc/module-ol_geom_Geometry-Geometry.html
Allows to use an alternative geometry in CesiumJS.

## olcs_proxy
Value: https://cesium.com/learn/cesiumjs/ref-doc/Proxy.html
Allows to add authentication information to requests sent by CesiumJS or manipulate request.

## olcs_extent
Value: An array of numbers representing an extent: [minx, miny, maxx, maxy]
Allows to restrict a tiled imagery layer to a rectangle. This avoid sending useless requests.
2 changes: 1 addition & 1 deletion examples/customProj.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const customProjSource = new olSourceImageWMS({
url: 'https://wms.geo.admin.ch/'
});

customProjSource.set('olcs.projection', getProjection('EPSG:3857'));
customProjSource.set('olcs_projection', getProjection('EPSG:3857'));

Cesium.Ion.defaultAccessToken = OLCS_ION_TOKEN;
const ol2d = new olMap({
Expand Down
4 changes: 2 additions & 2 deletions examples/vectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const cartographicRectangleStyle = new olStyleStyle({
});
const cartographicRectangleGeometry = new olGeomPolygon([[[-5e6, 11e6],
[4e6, 11e6], [4e6, 10.5e6], [-5e6, 10.5e6], [-5e6, 11e6]]]);
cartographicRectangleGeometry.set('olcs.polygon_kind', 'rectangle');
cartographicRectangleGeometry.set('olcs_polygon_kind', 'rectangle');
const cartographicRectangle = new olFeature({
geometry: cartographicRectangleGeometry
});
Expand All @@ -263,7 +263,7 @@ const cartographicRectangleGeometry2 = new olGeomMultiPolygon([
[-5e6, 11e6, 1e6], [-5e6, 11.5e6, 1e6]
]]
]);
cartographicRectangleGeometry2.set('olcs.polygon_kind', 'rectangle');
cartographicRectangleGeometry2.set('olcs_polygon_kind', 'rectangle');
const cartographicRectangle2 = new olFeature({
geometry: cartographicRectangleGeometry2
});
Expand Down
Loading

0 comments on commit 85d262f

Please sign in to comment.