ria-panocontroller
v2024.1.7
Published
Implements an easy to integrate LuciadRIA toolbox
Readme
RIA Pano Controller
An easy-to-integrate LuciadRIA pano controller derived from the LuciadRIA 2024.1.07 samples.
Key Advantages
- Seamless Deployment: Deploy as a standard npm package without complex wiring.
- TypeScript Flexibility: Use your preferred TypeScript version and configuration.
- React Compatibility: Compatible with React version 16.14 or higher.
- LuciadRIA Compatibility: Works with any LuciadRIA version 2024.1.x or higher.
- Multiple Panorama layers supported: It is not limited to one panorama layer, you can have several panorama layers in the map
Overview of Pano Controller
The LuciadRIA Pano controller allows you to easily add LuciadRIA panoramas to your LuciadRIA map
Installation
To install the RIA Pano Controller, use the following npm command:
npm install ria-panocontrollerIntegration
Import the code from
ria-panocontroller/libs
For instance:
- To get the painter:
// Painter:
import {PanoramaFeaturePainter} from "ria-panocontroller/libs/painters/PanoramaFeaturePainter";
// Assig the painter to your panorama layer:
const layer = new FeatureLayer(model, {
panoramaModel: new FusionPanoramaModel(targetUrl),
selectable: false,
hoverable: true,
label: "Label",
painter:new PanoramaFeaturePainter({
overview: false,
iconHeightOffset: 0
})
});- For the PanoramaActions and controller
// Use:
import { PanoramaActions } from "ria-panocontroller/libs/actions/PanoramaActions";
import { attachPanoControllers} from "ria-panocontroller/libs/attachPanoControllers";
// After the LuciadRIA map is created create the actions
panoramaActions = new PanoramaActions(map);
attachPanoControllers(map, panoramaActions);
// Call attachPanoControllers every time a Panorama layer is added or removed,
// this allows multiple Panorama layers to coexist
const attachPanoController = () => {
if (panoramaActions && map) {
attachPanoControllers(map, panoramaActions);
}
}
nodeAddedHandler = map.layerTree.on("NodeAdded", attachPanoController);
nodeRemovedHandler = map.layerTree.on("NodeRemoved", attachPanoController);Customization
The original source code is located in the src folder. Feel free to create a branch and modify it to suit your specific requirements. Make the changes you need and run the build script to generate the libs folder.
