Best Way to Use One Viewer for Multiple Panoramas

  • I am wondering if there is a "best practice" way to serve the krpano viewer for multiple panoramas.

    I have a number of panoramas ( http://andrewcrawford.me/Static/Panoramas.html ), each created with the multires droplet. Each one is in its own sub-directory and, contains a copy of the viewer, both HTML5 and Flash, named the same as the panorama.

    It would be nice to be able to update the viewer for all of the panoramas without having to replace and name it in every sub-directory. I can probably do something with symlinks but, it seems like this would be a common issue someone has already solved.

    This seems like it would be a FAQ or, in the docs somewhere but, I haven't had any luck finding it. So, apologies if this is a daft newbie question.

    Thanks in advance for any tips!

    --
    Andrew Crawford

  • Just put the viewer and all the plugins in a folder that is logical. I tend to use something from the root directory like /lib/krpano/ or something.

    From that point on you can load the stuff from any relative position. Say if you have ~/panorama/room1/index.html it would load ../../lib/krpano/krpano.js and the implementation would be embedpano({swf:"../../lib/krpano/krpano.swf"......

    The XML file would still be relative to the pano location, so you could standardize that to your needs.

    For upgrading KRpano, I'd recommend building a testing feature that lets you use various engines without having to replace the working one. Such a thing could easily be done with javascript or PHP from the index file.

  • Thank you.

    I got it working pretty quickly. There are three places to change the path: the skin include in the XML file and, the script source and Flash embed lines in the HTML file.

    Using relative paths that climb up the tree won't work if you launch from a local file system due to security restrictions but, it works if served from a webserver.

    Good thought on testing. Fortunately, I also have a development server where I can test before pushing live.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!