I was trying to load xml string direclty, this is my code:
Code
ngOnChanges(changes: SimpleChanges) {
if (
'panoXML' in changes &&
!changes.panoXML.firstChange &&
changes.panoXML.currentValue !== changes.panoXML.previousValue
) {
console.log('new value:');
console.log(changes.panoXML.currentValue);
this.krpano.call('loadxml(' + changes.panoXML.currentValue + ', null, MERGE, BLEND(0.5));');
}
}
Display More
You can see here, I am using angular 6 to listen to property change, if property changed, then I hope the pano can automatically load the new panorama.
The console log is already printing the xml content like below:
Code
<krpano onstart="startup();" logkey="false" debugmode="true" showerrors="false">
<include url="%SWFPATH%/plugins/showtext.xml" />
<include url="/assets/lib/krpano/skin/vtourskin.xml"/>
<style name="alt_hotspot_ani_white"
alturl="/assets/panos/demo1/hotspots/hotspot_ani_white_64x64x20.png"
frames="20" framewidth="64" frameheight="64" frame="0"
altonloaded="set(crop,'0|0|64|64'); resetsize(); set(alpha,1.0); hotspot_animate();"
/>
<action name="hotspot_animate">
if(loaded,
inc(frame,1,get(frames),0);
mul(ypos,frame,frameheight);
txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
delayedcall(0.05, hotspot_animate() );
);
</action>
<action name="startup">
if(startscene === null, set(startscene,get(scene[0].name)) );
loadscene(get(startscene),null,MERGE);
</action>
<view fov="110" fovtype="MFOV" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto"/>
<scene title="my new pano" thumburl="https://guoyi5d-dev-pano.s3-us-west-2.amazonaws.com/123/98853df2d6/thumb.jpg">
<preview url="https://guoyi5d-dev-pano.s3-us-west-2.amazonaws.com/123/98853df2d6/preview.jpg" />
<image>
<cube url="https://guoyi5d-dev-pano.s3-us-west-2.amazonaws.com/123/98853df2d6/web_%s.jpg" />
<mobile>
<cube url="https://guoyi5d-dev-pano.s3-us-west-2.amazonaws.com/123/98853df2d6/mobile_%s.jpg" />
</mobile>
</image>
</scene>
</krpano>
Display More
but in the UI, still the original pano, not changed at all.
anything wrong here?