Update Image

<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Campzimmer | Update Image</title>
    <link href="https://cdn.campzimmer.com/campzimmer.css" rel="stylesheet">
    <script src="https://cdn.campzimmer.com/campzimmer.js"></script>
    <style>
      #viewer{
        width: 100%;
        height: 50vh;
        position: relative;
      }
    </style>
  </head>
  <body>
    <div id="viewer"></div>
    <script>
      var resource1 = '96891';// Site IDs from RIDB data.
      var resource2 = '102308'
      var instance = new Campzimmer.Campzimmer({
        container: 'three-sixty-viewer',
        resource: resource1,
        loading_image: '/images/logo.png'
      });
      var button = document.querySelector('.update-image-button');
      var state = 0;
      button.addEventListener('click', function(){
        if(state === 0){
          state = 1;
          instance.loadResource(resource2).then(function(){
          });
        } else {
          state = 0;
          instance.loadResource(resource1).then(function(){
          });
        }
      });
    </script>
  </body>
</html>