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

Wednesday, October 26th 2016, 1:43pm

parenting not working for a layer

hi all

i have two container (layer) that will get different maps to show.
my idea was do make two layer with the two different maps and then write an action that sets the wright container as parent to those two maps so that they get position of the parent.

at the moment this is not working for me, is the parent function supposed to do such kind of stuff?

thanks
sven

2

Monday, November 7th 2016, 4:52pm

another try

i have a layer 1:

Quoted

<layer name="skin_mainmap" state="closed" type="container" visible="true" align="bottomleft" x="10" y="10" zorder="2" width="260" height="110" bgcolor="0x000000" bgalpha="1" onover="skin_maphover(skin_mainmap);" onout="skin_maphover(skin_mainmap);" />
and a layer 2:

Quoted

<layer name="map1" type="container" parent="layer[skin_mainmap]" visible="false" width="100%" height="100%" bgcolor="0x654321" bgalpha="1"/>
why is it not aligning to the correctly to the parent object, it still aligns to the stage...
do i need to follow a special hierarchy, like first the parent and then the child in the code?
do i need special writing in parent="..."

thanks for your answers
sven

spacerywirtualne

Professional

Posts: 980

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

3

Monday, November 7th 2016, 7:26pm

Hi

It should work without any problem. Perhaps this change will help.


<layer name="map1" type="container" parent="layer[skin_mainmap]" visible="false" width="100%" height="100%" bgcolor="0x654321" bgalpha="1"/>

to

<layer name="map1" type="container" parent="skin_mainmap" visible="false" width="100%" height="100%" bgcolor="0x654321" bgalpha="1"/>



Piotr
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

Alexey Tkachenko

Professional

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

4

Tuesday, November 8th 2016, 7:31am

Hi)

Ususally code

Source code

1
parent="layer[parentlayer]"
works well enough. I see from your code that "skin_mainmap" doesn't have

Source code

1
keep="true"
attribute. That means it's located inside some other layer, perhaps. Can you share a link to see the full code?
Regards,

Alexey

5

Tuesday, November 8th 2016, 8:49am

thanks for you answers!

i already tried changing the syntay from:
parent="layer[skin_mainmap]"
to

parent="skin_mainmap"
but it's still not working.

also i've now set keep="true" for the both parent and child. still no success :(

here is the whole code of the menu layers. http://www.filedropper.com/parentingpart
the layers googlemaps and radarmaps should be parented to skin_mainmap and skin_extramap.

thanks for your help guys
sven

6

Tuesday, November 8th 2016, 9:06am

i just experienced something strange

until now i've set the parent wright in the child layer. that did not work.
now i've set it over an action called with the event onxmlcomplete. now it works.
can't believe that...

7

Tuesday, November 8th 2016, 9:31am

i just experienced something strange

until now i've set the parent wright in the child layer. that did not work.
now i've set it over an action called with the event onxmlcomplete. now it works.
can't believe that...


i just wanted to point that out...
why are you even doing this in the xml?
if you set your layer structure in xml directly, you dont need to set the parent property,
because you can just put your layer in the correct place (as child of your parent layer)

--> why dont you just move your googlemaps layer down in your structure to be the child of skin_mainmap

i think i only used parent dynamically, and its possible that it only works like this.

( btw: should we get an confirmation for your vr event on 17th? i didnt get one :) )

8

Tuesday, November 8th 2016, 9:46am

why are you even doing this in the xml?
if you set your layer structure in xml directly, you dont need to set the parent property,
for sure, normally i would do that. but this parent is not static, it changes to another parent when you change our custom settings in the xml file.
therefore it makes no sense to give it a static parent in the structure.

-> betreffend der anmeldung, gib mir doch per PN deinen Namen durch, dann schaue ich ob du auf der liste bist!

grĂ¼sse
sven