You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, July 22nd 2019, 7:25pm

image as plugin

Hi,
I am trying to learn with the trial version.
I see you can "insert" an image in a pano by way of a layer (url="image").
I am wondering if it is possible to do that by a file.js, like the one shown in the plugin interface example (i.e. url="file.js" in the xml layer).

Thank you for any help.

Regards,

Giuseppe

2

Monday, July 22nd 2019, 10:07pm

a krpano layer element is the same as a krpano plugin element

<layer url="mybutton.jpg" /> would be an image layer
<plugin url="myplugin.js" /> would be a js plugin

as described here, it does not matter if you write plugin or layer
https://krpano.com/docu/xml/#plugin

a js plugin example is here
https://krpano.com/docu/plugininterface/#top
(this is may not be something to start with, when using krpano)

of course you can insert layers from a js plugin:
krpano.actions.addlayer('mylayer');
var mylayer = krpano.layer.getItem('mylayer');
mylayer.url = 'mybutton.jpg';

3

Tuesday, July 23rd 2019, 12:32am

Thank you for explaination.
I was just trying to insert a floorplan in a pano.
I can do that using an image layer (url="myfloorplan.jpg").

I tried also to use a plugin (url="myplugin.js"). I used the plugin example at https://krpano.com/docu/plugininterface/#top
trying to modify: dropping the action and other stuff not related, I presume, with the insertion of the image.
I used: document.createElement("img") and document.innerHTML.........
but nothing happens.
Maybe the above is a nonsense ...
Thank you for any hints.