X

Geertjan's Blog

  • June 11, 2016

Getting Started Integrating LuciadRIA into Oracle JET

Geertjan Wielenga
Product Manager

So you need Geospatial Situational Awareness in your Oracle JET application and you've decided that LuciadRIA is the right choice for you. LuciadRIA offers Geospatial Situational Awareness in the browser. LuciadRIA enables the development of advanced and easy-to-use browser applications, using web technologies, such as JavaScript, WebGL, and HTML5.

You've obtained LuciadRIA and now you're wondering how to integrate it into an Oracle JET application. The aim here is to get this result, as a kind of "hello world" scenario:

Here are the steps, with thanks to Tom Mahieu from Luciad, who provided me with an Oracle JET application that incorporates LuciadRIA and from which I have extrapolated the instructions below.

  1. In "js/libs", include "dijit", "dojo", "luciad", and "luciadui":



  2. In the "paths" of your "require.config" section, reference the libraries you added above:

    'dojo': 'libs/dojo',
    'dijit': 'libs/dijit',
    'luciad': 'libs/luciad',
    'luciadui': 'libs/luciadui'
  3. In the "css" folder, include "luciad.css" and reference it in your "index.html" file.

  4. In the view of one of your JET modules, include this:

    <div class="claro" 
    id="luciadMap"
    style="width: 100%; height: 500px; background-color: black; position: relative;">
    <div id="logo"/>
    </div>
  5. In the viewModel of one of your JET modules, include this:
  6. define([
    'ojs/ojcore',
    'knockout',
    'jquery',
    'luciad/view/WebGLMap',
    'luciad/reference/ReferenceProvider',
    'luciad/model/tileset/FusionTileSetModel',
    'luciad/view/tileset/RasterTileSetLayer',
    'luciad/view/LayerType',
    'luciad/shape/ShapeFactory',
    'luciadui/layertreecontrol/FoldableLayerControl'
    ], function(oj, ko, $, WebGLMap, ReferenceProvider,
    FusionTileSetModel, RasterTileSetLayer,
    LayerType, ShapeFactory,
    FoldableLayerControl) {
    function createElevationLayer() {
    var tileSetReference = ReferenceProvider.getReference("EPSG:4326");
    var elevationParameters = {
    reference: tileSetReference,
    level0Columns: 4,
    level0Rows: 2,
    levelCount: 24,
    bounds: ShapeFactory.createBounds(tileSetReference, [-180, 360, -90, 180]),
    url: "http://fusion.3d.luciad.com/lts",
    coverageId: "1baecde9-0209-4570-b110-90eff3263e9b",
    tileWidth: 64,
    tileHeight: 64,
    dataType: FusionTileSetModel.DataType.ELEVATION,
    samplingMode: FusionTileSetModel.SamplingMode.AREA
    };
    return new RasterTileSetLayer(
    new FusionTileSetModel(elevationParameters),
    {label: "Elevation"}
    );
    }
    function createFusionBackgroundLayer() {
    var tileSetReference = ReferenceProvider.getReference("EPSG:4326");
    var elevationParameters = {
    reference: tileSetReference,
    level0Columns: 4,
    level0Rows: 2,
    levelCount: 24,
    bounds: ShapeFactory.createBounds(tileSetReference, [-180, 360, -90, 180]),
    url: "http://fusion.3d.luciad.com/lts",
    coverageId: "4ceea49c-3e7c-4e2d-973d-c608fb2fb07e",
    tileWidth: 256,
    tileHeight: 256
    };
    return new RasterTileSetLayer(
    new FusionTileSetModel(elevationParameters), {
    label: "Satellite imagery",
    layerType: LayerType.BASE
    }
    );
    }
    function LuciadContentViewModel() {
    var self = this;
    self.handleAttached = function() {
    var node = document.getElementById("luciadMap");
    self.map = new WebGLMap(node, {
    reference: ReferenceProvider.getReference("EPSG:4978")
    });
    new FoldableLayerControl(self.map, node);
    self.map.layerTree.addChild(createElevationLayer());
    self.map.layerTree.addChild(createFusionBackgroundLayer(), "bottom");
    };
    self.handleDetached = function() {
    self.map.destroy();
    };
    }
    return new LuciadContentViewModel();
    });

That's it, you're done. Make sure to include your license files in "libs/luciad/licenses" and then run the application and you should see the result with which this blog entry started!

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services