Fork me on GitHub

PanoramaSensorsViewer v0.7.7 - r.067dd4b6

QR Code to this page
Tweet

To test the examples of this page on your mobile device, just snap the QR-Code on the left.

You should also check out Topheman Street View, an application based on PanoramaSensorsViewer.

Summary :


Getting started with PanoramaSensorsViewer

Here is a list of demos using PanoramaSensorsViewer, so you could understand how to use the Google Maps API inside it.
This will work as well on a desktop as on a mobile device (what you should do is test it on your mobile device and watch the code on your desktop).
For each example, you will find :

Examples

Basic
This is a basic demo like this one on the Google API doc, but with sensors.
Events
Add Street View events to your panorama, inside the success callback of PanoramaManager.init.
Alter controls
Alter the controls of your panorama via the setOptions method of Google Maps API for panorama, inside the success callback of PanoramaManager.init (zoom control and address will be hidden).
Custom panorama
In the options, setup your own panoProvider and pano (like you would with Google Maps API) and get your own custom panorama with PanoramaSensorsViewer !
Custom panorama tiles
Connect your own custom panorama provider (with a tiled panorama) to the Google panoramas !

API Doc

Check the API Doc on github.


Dependency utils that you can use standalone

PanoramaSensorsViewer ships some utils I made that can run in standalone (both non-AMD and AMD compatible). While you use PanoramaSensorsViewer, you don't have to worry about them but, it could come handy in some of your project.

blockedPopup.js

We all have popup blockers like AdBlock on our browser, so if your application ever needs popups (I know it's old) and make sure it's been authorized by your user, the little class will let you know.

See the code on the PanoramaSensorsViewer github repository

sensorsChecker.js

Mostly all recent browsers expose an api for deviceorientation and devicemotion events. That doesn't mean the device you're on has sensors (accelerometer+gyroscope) to feed them.

So to check if the device has sensors, you can't rely on simple feature detection like "ondeviceorientation" in window or "ondevicemotion" in window

This module will let you check if there is really an accelerometer+gyroscope to rely on.

See the code on the PanoramaSensorsViewer github repository