Code Monkey home page Code Monkey logo

gsvpano's Introduction

GSVPano - Google Street View Panorama lib

Build Status

Library to help requesting and stitching Google Street View panoramas.

Given a Google Maps Location, this library downloads each part of the corresponding panorama, and gives you the complete image ready to use.

Simple Example

// Create a PanoLoader object
var loader = new GSVPANO.PanoLoader({
	zoom: 3
});

// Implement the onPanoramaLoad handler
loader.on('panorama.load', function(panorama) {
	// panorama will now be loaded

  // for individual progress
  panorama.on('progress', changeProgress); 
  
  // for individual complete callback
  panorama.on('complete', completeCallback);
});

// Invoke the load method with a LatLng point
loader.load( new google.maps.LatLng( 42.216188,-75.726578 ) );

Installation

Dependencies:

Remember that you'll need google.maps API, so don't forget this script tag.

<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
Github CDN
<script src="//juampi92.github.io/GSVPano/build/GSVPano.min.js"></script>

Or you can just use it with a specific version:

<script src="//juampi92.github.io/GSVPano/build/GSVPano-1.0.0.min.js"></script>
Bower
$ bower install GSVPano
npm
$ npm install gsvpano

And you can require the source files and compile it using browserify

API Reference

Events
  • panorama.data ( pano ) When a new panorama has been added and its about to start downloading
  • panorama.nodata ( location, status ) When the location had trouble fetching the panorama
  • panorama.progress ( p , pano ) Shows the panorama load progress
  • panorama.load ( pano ) When the panorama has finished loading
  • error ( message ) When the panorama has finished loading
loader.on('panorama.data', function(pano) { 
	console.log('Panorama ' + pano.id + ' has been added');
});
Methods
  • on ( eventName, callback ) EventEmitter inheritance
  • load ( location ) Starts the load of the panorama on that location
  • setZoom ( z ) Sets the zoom
Read the Documentation for more detail

Contribute

First, do

	$ npm install
	$ npm install -g grunt-cli

to get all the dependencies.

$ grunt build

lints the project, browserifies it, minifies it and builds the documentation also.

If you just wanna build it with browserify, use

$ grunt watch

that will watchify the src/ folder.

Forks, pull requests and code critiques are welcome!

License

MIT License (MIT)

gsvpano's People

Contributors

juampi92 avatar konforti avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.