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.

panomaster

Intermediate

  • "panomaster" started this thread

Posts: 272

Location: Kobyłka, Poland

Occupation: Virtual Tours - Spherical Panoramas - Krpano developer

  • Send private message

1

Thursday, September 27th 2018, 4:41pm

Hermetising

I'd like to enclose all attributes (properities) and method (actions ) in one krpano object. I hope it's the best way for creating plugins. Something like this:

Source code

1
2
3
4
5
6
7
		<layer  name="element_name" type="container"
				<!-- other attributes -->
				...
				<!-- methods/actions -->
				show="trace(get(name))"
				
				>


How to access object attributest in this way? get(name) returns null.

2

Thursday, October 4th 2018, 10:20am

Hi,

it depends on 'how' will call the code...

When calling that code in your 'show' attribute from an plugin event (e.g. like onclick), it will work, but when calling from somewhere else, then not.

For calling code with a dedicated scope the callwith action can be used:
https://krpano.com/docu/actions/#callwith

E.g.

Source code

1
callwith(layer[element_name], show);


Best regards,
Klaus