PDA

View Full Version : All Saints: Floorplan question


GregorH
09-12-2009, 09:39 AM
Hello Plugin Guru :)

No need to say how fantastic, time saving and cute your floorplan plugin is...

Configuring a clients tour I have a little problem you might be able to point me in the right direction:

Situation:
One Building with two floors.
Some rooms on the ground floor, some more on first floor linked with normal hotspots and floor plan.

Question:
How do I update the camera/floor when a visitor clicks on one of the "normal" Hotspots (not the ones on the floorplan).

On the normal hotspot code I tried to reference the id's
(builing/floor/cam):
onClick="loadPano(panoName=../360/medusa3&pan=116&tilt=0&zoom=0.95); external.floorplan.goCamera=CasaMedusa:ErsteEtage: Appartment3"

and (floor/cam):
onClick="loadPano(panoName=../360/medusa3&pan=116&tilt=0&zoom=0.95); external.floorplan.goCamera=ErsteEtage:Appartment3"

or even (only id of cam, which I thought it wouldn't work):
onClick="loadPano(panoName=../360/medusa3&pan=116&tilt=0&zoom=0.95); external.floorplan.goCamera=Appartment3"

but the floor image never changes from ground to first floor. :(
What else could I try??

thanks a ton!!
Gregor

allSaints
09-12-2009, 10:59 PM
Hello again Gregor,

I'm happy to see you trying out the floorplan plugin.

On my test page I have two buildings - one of them with two floors. And this is the way I did it:

I have a number of pano loading functions:
goWork1="loadPano(panoName=../eniro/img/eniro1&tilthome=0&panHome=80,500,fade)"
goWork2="loadPano(panoName=../eniro/img/eniro2&tilthome=-2&panHome=-10,500,fade)"
goWork3="loadPano(panoName=../eniro/img/eniro3&tilthome=-22&panHome=-30,500,fade)"
goWork4="loadPano(panoName=../eniro/img/eniro4&tilthome=-3&panHome=82,500,fade)"
...

When a viewer selects a camera in the floorplan, the plugin executes one of these functions as described in the plugin xml file:
<camera id="Reception" pos="185:190" offset="-150" command="global.goWork1()" />


But when he selects a pano in any other way (for example by clicking another spot), I execute this command:
onClick="external.floorplan.goCamera=Reception"
When the plugin receives this command, it will look for the "Reception" camera - first on the current floor in the current building, then everywhere else. So if the camera name is unique, you don't have to specify the building or the floor at all. If you specify all three items, it will of course look only there.
Anyway, when the camera is found, the plugin executes the associated FPP command - in this case "global.goWork1()", which loads the "Reception" pano.


The difference between our solutions is that you first load the new pano and then change camera. But when you execute the "goCamera" command, doesn't that try to load the pano too? If you want to go to another camera without executing its command you have to use the "selectCamera" command.

I hope this solves your problem - if not, email me (tommy@wirestam.com) so we can work it out.


Tommy

DaveGibson
05-07-2010, 12:42 PM
Hi Tommy, I have a similar situation, one building (called vista) with two floors (called heron and oriole). I would like to be able to start the tour on either floor, depending on which floor the person chooses (on my picMenu). Is is possible to set the floor and camera onStart or onLoad? It seems I must put selected="1" next to one camera on one of the floors. My floorplan always shows the floor which contains the selected="1" camera even though I want it to start on the other floor.
I have tried the following in my xml file:
onLoad="external.floorplan.selectCamera=vista:heron:salon"
onStart="external.floorplan.selectCamera=vista:heron:salon"
onLoad="external.floorplan.goCamera=vista:heron:salon"
onStart="external.floorplan.goCamera=vista:heron:salon"

but no luck. If I omit the selected="1" in my floorplan.xml file it defaults to the first camera on the first floor.
I also tried putting the command selectCamera right in the floorplan declaration
<floorplan>
!setupMode=1
xmlfile=vista_floorplan.xml
selectCamera=vista:heron:salon
</floorplan>
I'm probably making some simple mistake but so far I cannot find it.
Thanks for any help.
Dave

allSaints
05-07-2010, 10:07 PM
Dave,

my suggestion is to init the floorplan with visible="0", and when the viewer selects a floor from picMenu (or from any other place) execute the two commands:
external.floorplan.selectCamera=vista:heron:salon; external.floorplan.visible=1
The problem at initialization is that everything happens at (almost) the same time, and getting the correct timing can be pretty tricky. You have no idea how long it will take to load images and other files. And what makes it even worse is when there is a low-resolution preview. Then - before everything has been completed and settled - you have to go through a pano change. Which makes your current pano reference - that you have just obtained from FPP - obsolete...

Well, that's why the plugin may not be ready to execute any commands at onLoad or OnStart.

Tommy

DaveGibson
05-08-2010, 02:32 AM
Thank you again! This works perfectly. The floorplan pops up with the correct camera selected in each case. It appears rather quickly, before the pano loads but that is actually a nice feature- it gives something to look at while waiting for the new pano to load.
Dave