Ok, so I have a very odd issue. First off, I'm generating the XML code for krpano with a PHP script that I wrote, and that is working fine, but when I try to perform a lookto action with the onloadcomplete event something weird happens. What happens is when I hard code the coordinates for lookto, it works fine, but once I pull the coordinates from GET variables (i.e. URL variables) the lookto fails to work. What makes this even more odd, is that the XML that is generated in both occasions looks exactly the same.
Here is what the XML looks like:
|
Source code
|
1
2
3
|
<action name="loaded">
plugin[map].activatespot(map_278); set(heading, 0); wait(1); lookto(151.3289129449965, 22, 14.5);
</action>
|
Here is the PHP that generates that XML:
|
Source code
|
1
2
3
4
|
$xml->startElement('action');
$xml->writeAttribute('name', 'loaded');
$xml->text("plugin[map].activatespot(map_$this->name); set(heading, 0); wait(1); lookto($hl, 22, 14.5);");
$xml->endElement();// </action>
|
So with this PHP code, it fails to pan horizontally, but it will pan vertically and when I replace $hl with the hard coded value of 151.3289129449965, it works fine. Also, just as a note, the
"plugin[map].activatespot(map_$this->name); set(heading, 0); wait(1);" all work fine in all instances and notice that the variable $this->name works just fine on that same line of code.
Anyone got any ideas as to what could be the problem?
*Edit #1*
I've also tried to type cast the variables just to make sure that there wasn't anything weird going on there and I've double checked all of the character encoding to make sure that isn't messing anything up either (everything is UTF-8).
*Edit #2*
I just loaded up the editor plugin and when the coordinates are being pulled from the GET variables in PHP, the XML viewer in the editor plugin shows that the coordinates from the URL aren't in the XML, but if I go to the actual XML file path, all of the data is there.