If KEEPVIEW is used on the first panorama maxpixelzoom value (different than "") is lost. Need a first panorama with MERGE attribute.
KEEPVIEW and first panorama
-
-
How do you mean that?
-
In fact if I call on startup an action to select a scene which is like these one the maxpixelzoom="1.0" value and fovtype="MFOV" values are not take in account.
I'm obliged to create a myLoadSceneOnStart action with a loadscene with MERGE attribute to give the right value to use for the next loadscene calls with KEEPVIEW attribute.
So with MERGE loadscene get the first panorama view updated values but not with KEEPVIEW.Code
Display More<krpano onstart="myLoadScene('scene1')"> <action name="myLoadScene"> if (xml.scene != %1, loadscene(%1, NULL, KEEPVIEW, BLEND(1)); ); </action> <scene name="scene1" ...> ... <view fisheye="0" limitview="range" hlookatmin="-180" hlookatmax="180" vlookatmin="-90" vlookatmax="90" maxpixelzoom="1.0" fovmax="90" fov="90.0" hlookat="0.0" vlookat="0.0" fovtype="MFOV"/> ... </scene> <scene name="scene2" ...> ... <view fisheye="0" limitview="range" hlookatmin="-180" hlookatmax="180" vlookatmin="-90" vlookatmax="90" maxpixelzoom="1.0" fovmax="90" fov="90.0" hlookat="0.0" vlookat="0.0" fovtype="MFOV"/> ... </scene>
-
But this is what KEEPVIEW is doing - it keeps the current/previous view settings - in your case the default settings when no <view> was set before.
-
Thanks, so with KEEPVIEW the first panorama loose all it's custom view data. It has sense but I'll have to be sure.
-
Hi, Klaus!
Today I was working on a VT which has "mousetype="drag2d", and noticed that when I call a "loadscene" with KEEPVIEW setting, the mousetype is reversed to normal one, so I had to add "set(mousetype, drag2d);" after the loadscene call.
I wonder if KEEPVIEW also affects/changes the current mousetype...
-
The 'first' pano is the the xml file itself, but when no <image> or <view> will be defined, nothing will be shown. The pano loaded by the loadscene() call in the onstart event is the 'second' pano - and by using KEEPVIEW the default view settings from the empty first pano will be kept.
(also note - there is one exception for the KEEPVIEW - the pano viewing limits - they need to be set individual for each pano)
To set and keep initial view setting you could do something like this:
Code
Display More<krpano onstart="myLoadScene('scene1')"> <view maxpixelzoom="1.0" fovmax="90" fov="90.0" fovtype="MFOV" /> <action name="myLoadScene"> if (xml.scene != %1, loadscene(%1, NULL, KEEPVIEW, BLEND(1)); ); </action> <scene name="scene1" ...> ... <view limitview="range" hlookatmin="-180" hlookatmax="180" vlookatmin="-90" vlookatmax="90" hlookat="0.0" vlookat="0.0" /> ... </scene> <scene name="scene2" ...> ... <view limitview="range" hlookatmin="-180" hlookatmax="180" vlookatmin="-90" vlookatmax="90" hlookat="0.0" vlookat="0.0" /> ... </scene> </krpano>
Best regards,
Klaus -
I wonder if KEEPVIEW also affects/changes the current mousetype...
No - to keep the current control settings use additionally also the KEEPCONTROL or MERGE flag.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!