You are not logged in.

Fernando

Intermediate

  • "Fernando" started this thread

Posts: 330

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

1

Monday, December 27th 2021, 10:33pm

[solved] How to control from PLUGIN (ex. Radar.js) new krpano layer

Hi, this question is about to control from plugin a new krpano layer. For example in the opensource "radar_source.js"

Source code

1
2
3
4
5
6
7
function svg_mouse_move(msevent)
{
(...)
//Change scene view with radar movement:
krpanoview.hlookat = hlookattemp;
(...)
}


How to code above for the new krpano layer?
Something as:

Source code

1
2
3
4
5
(...)
//for change krpanolayer view...?
layer[newkrpanolayer].krpano.view.hlookat = hlookattemp
//This did not work!
(...)


Thanks for any advice.
Best regards,
Fernando

This post has been edited 2 times, last edit by "Fernando" (Dec 29th 2021, 1:51am)


2

Tuesday, December 28th 2021, 10:17pm

Hi,

using just:

Source code

1
layer[newkrpanolayer]
is not possible in Javascript, that's krpano Action script syntax.

The Javascript equivalent is:

Source code

1
krpano.get("layer[newkrpanolayer]");

or this:

Source code

1
krpano.layer.getItem("newkrpanolayer");


Here an example:

Source code

1
2
var otherkrpano = krpano.get("layer[newkrpanolayer]").krpano;
otherkrpano.view.hlookat = hlookattemp


Best regards,
Klaus

Fernando

Intermediate

  • "Fernando" started this thread

Posts: 330

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

3

Wednesday, December 29th 2021, 1:55am

Hi Klaus, thank you very much again, this is exactly what I needed to know. *thumbsup*
Best regards,
Fdo