Convert Figma logo to code with AI

google logomarzipano

A 360° media viewer for the modern web.

1,978
997
1,978
142

Top Related Projects

Pannellum is a lightweight, free, and open source panorama viewer for the web.

36,911

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.

Javascript panorama viewer based on Three.js

An open-source, web-based viewer for zoomable images, implemented in pure JavaScript.

16,566

:a: Web framework for building virtual reality experiences.

Quick Overview

Marzipano is an open-source JavaScript library for creating interactive 360-degree panoramic experiences on the web. It provides a flexible and customizable way to display and navigate panoramic images and videos, making it suitable for a variety of applications such as virtual tours, real estate listings, and immersive experiences.

Pros

  • Flexible and Customizable: Marzipano offers a wide range of configuration options and customization capabilities, allowing developers to tailor the experience to their specific needs.
  • Cross-Platform Compatibility: The library is designed to work across a variety of devices and browsers, ensuring a consistent experience for users.
  • Performance Optimization: Marzipano utilizes efficient rendering techniques and progressive loading to provide a smooth and responsive user experience, even with large panoramic assets.
  • Active Development and Community: The project is actively maintained by Google and has a growing community of contributors, ensuring ongoing support and improvements.

Cons

  • Steep Learning Curve: Integrating Marzipano into a project may require a significant amount of time and effort, especially for developers who are new to the library or 360-degree content creation.
  • Limited Documentation: While the project has some documentation, it may not be as comprehensive or user-friendly as some developers would prefer, making it challenging to get started.
  • Dependency on Third-Party Libraries: Marzipano relies on several third-party libraries, such as Three.js and Hammer.js, which can add complexity to the project setup and maintenance.
  • Potential Performance Issues with Large Panoramas: While Marzipano is optimized for performance, very large or high-resolution panoramic assets may still cause performance issues, especially on lower-end devices.

Code Examples

Here are a few examples of how to use Marzipano in your project:

  1. Creating a Basic Panorama Viewer:
// Initialize the viewer
const viewer = new Marzipano.Viewer(document.getElementById('pano'));

// Load the panorama
const source = Marzipano.ImageUrlSource.fromString('path/to/panorama.jpg');
const geometry = new Marzipano.EquirectGeometry([{ width: 4000 }]);
const view = new Marzipano.RectilinearView();
const scene = viewer.createScene({
  source: source,
  geometry: geometry,
  view: view
});

// Display the panorama
scene.switchTo();
  1. Adding Hotspots and Annotations:
// Create a hotspot
const hotspot = viewer.createHotspot(
  document.createElement('div'),
  Marzipano.util.selectionPosition(0.5, 0.5),
  { yaw: 0, pitch: 0 }
);

// Add the hotspot to the scene
scene.addHotspot(hotspot);

// Add an annotation to the hotspot
hotspot.element().innerHTML = '<h3>Interesting Spot</h3><p>Click to learn more.</p>';
  1. Handling User Interactions:
// Add event listeners to the viewer
viewer.on('viewChange', () => {
  console.log('View changed:', viewer.view().parameters());
});

viewer.on('click', (event) => {
  console.log('Clicked at:', event.x, event.y);
});
  1. Integrating with React:
import React, { useEffect, useRef } from 'react';
import Marzipano from 'marzipano';

const PanoramaViewer = () => {
  const containerRef = useRef(null);

  useEffect(() => {
    // Initialize the Marzipano viewer
    const viewer = new Marzipano.Viewer(containerRef.current);

    // Load the panorama
    // ... (similar to the first code example)

    // Clean up the viewer on component unmount
    return () => {
      viewer.destroy();
    };
  }, []);

  return <div ref={containerRef} style={{ width: '100%', height: '500px' }} />;
};

Getting Started

To get started with Marzip

Competitor Comparisons

Pannellum is a lightweight, free, and open source panorama viewer for the web.

Pros of Pannellum

  • Lightweight and easy to integrate
  • Supports both equirectangular and cubemap panoramas
  • Offers a built-in tour feature for multiple panoramas

Cons of Pannellum

  • Less actively maintained compared to Marzipano
  • Limited documentation and examples
  • Fewer advanced features for complex projects

Code Comparison

Pannellum:

pannellum.viewer('panorama', {
    "type": "equirectangular",
    "panorama": "path/to/image.jpg"
});

Marzipano:

var viewer = new Marzipano.Viewer(document.getElementById('pano'));
var source = Marzipano.ImageUrlSource.fromString("path/to/image.jpg");
var geometry = new Marzipano.EquirectGeometry([{ width: 4000 }]);
var view = new Marzipano.RectilinearView();
var scene = viewer.createScene({source: source, geometry: geometry, view: view});
scene.switchTo();

Pannellum offers a simpler API for basic panorama viewing, while Marzipano provides more granular control over the viewer setup. Marzipano's approach allows for greater customization but requires more code for basic implementation.

36,911

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.

Pros of Phaser

  • More versatile for general game development, supporting various game types
  • Larger community and ecosystem, with extensive documentation and tutorials
  • Regular updates and active development

Cons of Phaser

  • Steeper learning curve for beginners compared to Marzipano's focused approach
  • Potentially overkill for simple panoramic or VR projects

Code Comparison

Marzipano (creating a viewer):

var viewer = new Marzipano.Viewer(document.getElementById('pano'));
var source = Marzipano.ImageUrlSource.fromString('path/to/image.jpg');
var geometry = new Marzipano.EquirectGeometry([{ width: 4000 }]);
var view = new Marzipano.RectilinearView();
var scene = viewer.createScene({source: source, geometry: geometry, view: view});

Phaser (creating a basic game):

var config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    scene: {
        create: create
    }
};
var game = new Phaser.Game(config);

While Marzipano is specifically designed for creating 360° viewers and virtual tours, Phaser is a more general-purpose game framework. Phaser offers greater flexibility for various game types but may require more setup for panoramic projects. Marzipano provides a more streamlined experience for creating virtual tours and panoramic viewers out of the box.

Javascript panorama viewer based on Three.js

Pros of Panolens.js

  • Simpler API and easier to get started for beginners
  • Built-in support for various types of panoramas (equirectangular, cube, etc.)
  • Integrated with Three.js, allowing for more advanced 3D features

Cons of Panolens.js

  • Less customization options compared to Marzipano
  • Smaller community and fewer resources available
  • May have performance limitations for large or complex panoramas

Code Comparison

Panolens.js:

const viewer = new PANOLENS.Viewer();
const panorama = new PANOLENS.ImagePanorama('path/to/image.jpg');
viewer.add(panorama);

Marzipano:

const viewer = new Marzipano.Viewer(document.getElementById('pano'));
const source = Marzipano.ImageUrlSource.fromString('path/to/image.jpg');
const geometry = new Marzipano.EquirectGeometry([{ width: 4000 }]);
const view = new Marzipano.RectilinearView();
const scene = viewer.createScene({ source, geometry, view });
scene.switchTo();

The code comparison shows that Panolens.js requires fewer lines of code to set up a basic panorama viewer, making it more accessible for beginners. Marzipano, on the other hand, offers more granular control over the viewer setup, allowing for greater customization but with a steeper learning curve.

An open-source, web-based viewer for zoomable images, implemented in pure JavaScript.

Pros of OpenSeadragon

  • More mature and established project with a larger community
  • Extensive documentation and examples
  • Supports a wider range of image formats and tile sources

Cons of OpenSeadragon

  • Steeper learning curve for beginners
  • Larger file size and potentially slower load times
  • Less focus on modern web technologies like WebGL

Code Comparison

OpenSeadragon:

var viewer = OpenSeadragon({
    id: "openseadragon",
    prefixUrl: "/openseadragon/images/",
    tileSources: "/path/to/image.dzi"
});

Marzipano:

var viewer = new Marzipano.Viewer(document.getElementById('pano'));
var source = Marzipano.ImageUrlSource.fromString("/path/to/image.jpg");
var geometry = new Marzipano.EquirectGeometry([{ width: 4000 }]);
var view = new Marzipano.RectilinearView();
var scene = viewer.createScene({source: source, geometry: geometry, view: view});

OpenSeadragon's code is more concise and easier to set up for basic usage, while Marzipano offers more granular control over the viewer configuration. Marzipano's approach is more modular, allowing for greater flexibility in advanced use cases.

16,566

:a: Web framework for building virtual reality experiences.

Pros of A-Frame

  • More comprehensive VR/AR framework with a wider range of features
  • Active community and extensive documentation
  • Supports a declarative HTML-based approach, making it easier for web developers

Cons of A-Frame

  • Steeper learning curve for complex projects
  • Potentially heavier and slower for simple 360° panorama viewers
  • May be overkill for projects that only require basic panorama functionality

Code Comparison

Marzipano (JavaScript):

var viewer = new Marzipano.Viewer(document.getElementById('pano'));
var source = Marzipano.ImageUrlSource.fromString('path/to/image.jpg');
var geometry = new Marzipano.EquirectGeometry([{ width: 4000 }]);
var view = new Marzipano.RectilinearView();
var scene = viewer.createScene({source: source, geometry: geometry, view: view});

A-Frame (HTML):

<a-scene>
  <a-sky src="path/to/image.jpg"></a-sky>
  <a-camera></a-camera>
</a-scene>

Marzipano is more focused on creating panoramic viewers with a lower-level API, while A-Frame provides a higher-level abstraction for creating VR experiences. Marzipano may be more suitable for projects specifically centered around panoramic content, whereas A-Frame is better suited for more complex VR/AR applications that require additional interactivity and 3D elements.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Marzipano

A 360° media viewer for the modern web.

This is not an official Google product.

Check out our website at http://www.marzipano.net/, including the demos and the documentation.

Please report bugs using the issue tracker. If you have any questions, head over to our discussion forum.

User guide

You can include Marzipano in your project in two different ways:

  • Obtain the marzipano.js file from the latest release at http://www.marzipano.net and copy them into your project.

  • Install Marzipano as a dependency using the npm package manager and require it as a module.

Developer guide

This is an npm-based project. A Node.js installation is required for development.

Some dependencies expect the Node.js interpreter to be called node. However, on Debian and Ubuntu systems, the binary installed by the nodejs package is called nodejs. To work around this, install the nodejs-legacy package, or use nvm instead.

Run npm install to install the dependencies. If you haven't in a while, bring them up to date with npm update.

Run npm run dev to serve this directory at http://localhost:8080. While this script is running, the demos are live-reloaded whenever the source files are edited.

Run npm test to automatically run the browser-based test suite on all available browsers in your system.

Run npm run livetest to serve the browser-based test suite at http://localhost:7357. While this script is running, the test suite is live-reloaded whenever the source or test files are edited.

Maintainer guide

Before preparing a release, make sure there are no uncommitted changes and verify that the tests pass and all of the demos work correctly.

Update the CHANGELOG file and bump the version number in package.json. Create a new commit containing only the changes to these two files, tag it with git tag vX.Y.Z, and push it to GitHub with git push --tags.

Run npm run release to prepare a new release.

Run npm run deploy to deploy the release to the website.

Run npm publish to publish the release to the npm registry.

NPM DownloadsLast 30 Days