Oskari goes 3D - with Ol-Cesium and 3D Tiles

Oskari supports also 3D map view since version 1.54 as an optional 3D-capable mapmodule has been added to Oskari. 3D mapmodule is based on Ol-Cesium library, which is meant for integrating OpenLayers and Cesium. Since Oskari 2D uses OpenLayers for map rendering and many map tools are built using OpenLayers most of the tools work out-of-the-box in 3D with Ol-Cesium.

Oskari supports 3D Tiles for 3D data rendering. 3D Tiles is an OGC Community standard and is designed for streaming and rendering massive 3D geospatial content.

3D map view setup

Add Ol-Cesium packages to main.js

// Remove the default mapmodule import if you have one ('oskari-loader!oskari-frontend/packages/mapping/ol/mapmodule/bundle.js')

import 'oskari-loader!oskari-frontend/packages/mapping/olcs/mapmodule/bundle.js';
import 'oskari-loader!oskari-frontend/packages/mapping/olcs/map3dtiles/bundle.js';

Add 3D tiles plugin to mapfull bundle's plugins array

{ "id": "Oskari.mapframework.mapmodule.Tiles3DLayerPlugin" }

Configuring the terrain

Optional terrain configuration can be given in mapfull's bundle configuration under mapOptions.

"mapOptions": {
    "terrain": {
        "providerUrl": "<url>",
        "ionAssetId": "<asset-id>",
        "ionAccessToken": "<your-ion-access-token>"
    }
}
  • terrain and all it's children are optional.
    • Using providerUrl one can set the TMS service end point. Supported terrain formats are heightmap-1.0 and quantized-mesh-1.0.
    • When ionAssetId is provided, the terrain is streamed from Cesium ion service which also requires ionAccessToken.
    • When ionAccessToken is provided without ionAssetId Cesium World Terrain is used for providing detailed terrain all over the globe.

Adding your own 3D data

3D tilesets can be added to the map using admin tools and choosing 3D Tiles as the layer type.

Oskari 3D current state and next steps

The released version of 3D map is the initial version which will be developed further during the next couple of months. The following features have been developed to support the use of 3D map:

  • adding 3D Tiles datasets
  • 3D map publishing
  • support for WFS map layers and feature data in 3D map view
  • camera flights with RPC API
  • measure tools, coordinate tool, markers and own places extended to work also in 3D map view

The following features will be developed during the next two months:

  • time control to visualize the shadows at different points of time
  • UI tools for controlling camera height and rotation
  • support for adding tilesets from Cesium ion platform with admin tool

Creating your own 3D datasets using Cesium Ion

Cesium ion is a platform for 3D geospatial data tiling, hosting and streaming. It converts different types of data (e.g. point clouds, 3D buildings, photogrammetry) to 3D Tiles format. A free Community account can be used for non-commercial personal projects, exploratory development, or unfunded educational activities within the defined usage limits. See the pricing page for more information.

Run in console

var mapmodule = Oskari.getSandbox().getStatefulComponents().mapfull.mapmodule;
mapmodule.getCesiumScene().primitives.add(
    new Cesium.Cesium3DTileset({
        url: Cesium.IonResource.fromAssetId(yourAssetId, {
            accessToken: 'your-access-token-here'
        })
    })
);

Last modified: Fri Nov 29 2019 15:37:35 GMT+0200 (EET)