Pannellum
Namespace: Wisej.Web.Ext.Pannellum
Assembly: Wisej.Web.Ext.Pannellum (4.1.0.0)
Pannellum is a lightweight, free, and open source panorama viewer for the web. Built using HTML5, CSS3, JavaScript, and WebGL. See https://pannellum.org/.
- C#
- VB.NET
public class Pannellum : Widget
Public Class Pannellum
Inherits Widget
The viewer is configured through the dynamic Options property inherited from Widget using the configuration keys documented at https://pannellum.org/documentation/reference/. Any change to the options destroys and recreates the viewer on the client. In design mode autoLoad is forced to false and the load button is removed.
The client fires the following widget events, received on the server through the WidgetEvent event (e.Type): "load", "scenechange" (e.Data is the scene id), "error" (e.Data is the error message), "errorcleared" and "hotspot" (e.Data is the hot spot configuration that was clicked).
Example:
Loading an equirectangular panorama with a clickable hot spot:
this.pannellum1.Options.type = "equirectangular";
this.pannellum1.Options.panorama = "Images/lobby.jpg";
this.pannellum1.Options.autoLoad = true;
this.pannellum1.Options.hotSpots = new[] {
new { pitch = -2.1, yaw = 132.9, type = "info", text = "Reception" }
};
this.pannellum1.Update();
this.pannellum1.WidgetEvent += (s, e) =>
{
if (e.Type == "hotspot")
AlertBox.Show("Clicked: " + e.Data.text);
};
Constructors
Pannellum()
Initializes a new instance of Pannellum.
Properties
InitScript
String: Returns the initialization script that creates the Pannellum viewer on the client.
The script is loaded from the embedded startup.js resource; the setter is ignored. Configure the viewer using the Options property instead.
Packages
List<Package>: Returns the list of packages (pannellum.js and pannellum.css, version 2.3.2) loaded by the client before the widget is initialized.
The packages are served from the resources embedded in this assembly and are added the first time the property is read, only if the list is empty.