Integration into parcel bundler

  • Hello,
    I'm trying to embed the pano viewer into an existing project which is based on the parcel bundler. When i just load an additional script via the index.html, the embedpano function can not be found (Uncaught ReferenceError: embedpano is not defined).
    Does anyone know how to manage this? *confused* Any help is greatly appreciated!
    Sebastian

    Einmal editiert, zuletzt von swalter (15. September 2022 um 18:28)

  • Thanks for your reply. The problem with this method is that the krpano is then loaded in separately, so in the other scripts of my site I can not access the krpano object and its functions. I want to interactively switch on/off panoramas using different buttons than the ones offered in the viewer, for example.

  • You can acces krpano object like this

    Code
    const krpano = document.getElementById('krpanoSWFObject').get('global');


    Where krpanoSWFObject is the id that you pass to the embedpano

    Code
    embedpano({ id:"krpanoSWFObject"....})
  • This does not work. The javascript is not loaded correctly. Here is an example:

    index.html:


    index.js:


    package.json:


    Error message:

    Zitat

    document.getElementById(...).get is not a function


    Live Sandbox: https://codesandbox.io/s/angry-varaha…kage.json:0-455

Jetzt mitmachen!

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