cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling Zoom and Pan functions in HTML Viewer

Former Member
0 Kudos

Hello,

I am trying to integrate HTML viewer. I am able to successfully integrate the vds file on HTML viewer.

I am using following code.

<script src="resources/sap/ve/js/Loco.js" type="text/javascript"></script>

  <script src="resources/sap/ve/js/dvl.js" type="text/javascript"></script>

var url = url of vds file;

var oDvl = new Dvl.Create("canvas", true, {configureCanvas: true, totalMemory: 268435456 });

oDvl.Helpers.SetVideoMode(768, 512); //Creates WebGL context and sets the width & height

oDvl.CreateCoreInstance(); //Create an instance of the DVL Core

oDvl.Settings.MajorVersion = oDvl.Core.GetMajorVersion(); //Get the major version of Core

oDvl.Settings.MinorVersion = oDvl.Core.GetMinorVersion(); //Get the minor version of core

oDvl.Core.Init(oDvl.Settings.MajorVersion, oDvl.Settings.MinorVersion);

oDvl.Helpers.LoadFile(url, null,

//code to load file

}

Above code is rendering the file, but Zoom and Pan Functionality are not working,

Could you please provide suggestions to enable Zoom and Pan functions.

Best Regards,

Rajesh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Jeff

Not sure if you've fixed this since it's a few months old. But...

From what I can see you have included the Loco library but you haven't hooked it up yet. You need to create a Loco object, passing in the DVL object and its canvas.

eg

oDvl = Dvl.Create(...);


var track = new sap.ve.Loco(oDvl, oDvl.canvas, false/*logging*/);


That should be all you need to do.