Print at Dec 17, 2025, 12:51:09 PM

Posted by PacWood at Mar 13, 2018, 10:27:06 PM
Re: zoom for HTML5 tool file is weak compared to program zoom
While re-reading the post, I noticed I did not copy this line in the previous post:

"UP.setAerialViewCenteredOnSelectionEnabled(true);"

Below is the code with the missing line at the end.


<script>

var HPC = viewHome("viewerCanvas",
homeUrl,
onerror,
onprogression,
{roundsPerMinute: 0,
navigationPanel: "default",
levelsAndCamerasListId: "levelsAndCameras",
selectableLevels: ["Level 1", "Level 2"],
activateCameraSwitchKey: true
});


console.log(HPC);
var UP = HPC.getUserPreferences;
console.log(UP);
UP.setAerialViewCenteredOnSelectionEnabled(true);

</script>


Below is a screen shot of the console log while running the above script that is in the .html file.

The console shows an "undefined".

Am I accessing the User Preference correctly?

thank you.