com.google.gwt.maps.client.streetview
Class StreetviewPanoramaWidget

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by com.google.gwt.maps.client.streetview.StreetviewPanoramaWidget
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget

public class StreetviewPanoramaWidget
extends com.google.gwt.user.client.ui.Composite

A class wrapping GStreetviewPanorama object that holds an instance of the Flash® Street View Panorama viewer.

See Also:
"http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama"

Nested Class Summary
static class StreetviewPanoramaWidget.ErrorValue
          An enum equivalents for error codes passed to StreetviewErrorHandler.
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
StreetviewPanoramaWidget()
          Creates new StreetviewPanoramaWidget.
StreetviewPanoramaWidget(StreetviewPanoramaOptions options)
          Creates new StreetviewPanoramaWidget with specified options.
 
Method Summary
 void addErrorHandler(StreetviewErrorHandler handler)
          Adds a handler for error events.
 void addInitializedHandler(StreetviewInitializedHandler handler)
          Adds a handler for initialized events.
 void addPitchChangedHandler(StreetviewPitchChangedHandler handler)
          Adds a handler for pitch change events.
 void addYawChangedHandler(StreetviewYawChangedHandler handler)
          Adds a handler for yaw change events.
 void addZoomChangedHandler(StreetviewZoomChangedHandler handler)
          Adds a handler for zoom change events.
 void checkResize()
          Notifies the flash viewer of a change of the size of its container.
 void followLink(double yaw)
          Follows a link from the current panorama to a neighbouring panorama.
 LatLng getLatLng()
          Returns the latitude and longitude of the panorama object.
 java.lang.String getPanoId()
          Returns the unique id of the panorama object.
 Pov getPov()
          Returns the current point of view (Pov) displayed in the flash viewer.
 void hide()
          Hides the flash viewer.
 boolean isHidden()
          Returns true if and only if the flash viewer associated with this object is hidden.
 void panTo(Pov pov, boolean longRoute)
          Changes the current point of view (Pov) displayed in the flash viewer without changing the location.
 void remove()
          Removes the instance of the flash viewer currently associated with this object from the DOM.
 void removeErrorHandler(StreetviewErrorHandler handler)
          Removes a handler for error events.
 void removeInitializedHandler(StreetviewInitializedHandler handler)
          Removes a handler for initialized events.
 void removePitchChangedHandler(StreetviewPitchChangedHandler handler)
          Removes a handler for pitch changed events.
 void removeYawChangedHandler(StreetviewYawChangedHandler handler)
          Removes a handler for yaw changed events.
 void removeZoomChangedHandler(StreetviewZoomChangedHandler handler)
          Removes a handler for zoom changed events.
 void setLocationAndPov(LatLng latLng, Pov pov)
          Sets the location and point of view (Pov) of the flash viewer.
 void setPov(Pov pov)
          Changes the current point of view (Pov) displayed in the flash viewer without changing the location.
 void setUserPhoto(PhotoSpec photoSpec)
          Shows a user-contributed photo in the flash viewer.
 void show()
          Shows the flash viewer.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StreetviewPanoramaWidget

public StreetviewPanoramaWidget()
Creates new StreetviewPanoramaWidget.


StreetviewPanoramaWidget

public StreetviewPanoramaWidget(StreetviewPanoramaOptions options)
Creates new StreetviewPanoramaWidget with specified options.

Method Detail

addErrorHandler

public void addErrorHandler(StreetviewErrorHandler handler)
Adds a handler for error events. This event is fired when an error occurs. See GStreetviewPanorama.ErrorValues for a list of error types.

Parameters:
handler - the handler to handle error eenum value for the passed error code or null if error covents
See Also:
"http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama.error"

addInitializedHandler

public void addInitializedHandler(StreetviewInitializedHandler handler)
Adds a handler for initialized events. This event is fired each time a panorama is initialized. Note that this event is fired as soon as rendering starts, but that all image data may not be loaded at this time.

Parameters:
handler - the handler to handle initialized events
See Also:
"http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama.initialized"

addPitchChangedHandler

public void addPitchChangedHandler(StreetviewPitchChangedHandler handler)
Adds a handler for pitch change events. This event is fired when the pitch displayed in the flash viewer is changed.

Parameters:
handler - the handler to handle pitch change events
See Also:
"http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama.pitchchanged"

addYawChangedHandler

public void addYawChangedHandler(StreetviewYawChangedHandler handler)
Adds a handler for yaw change events. This event is fired when the yaw displayed in the flash viewer is changed.

Parameters:
handler - the handler to handle yaw change events
See Also:
"http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama.yawchanged"

addZoomChangedHandler

public void addZoomChangedHandler(StreetviewZoomChangedHandler handler)
Adds a handler for zoom change events. This event is fired when the zoom level of the flash viewer is changed.

Parameters:
handler - the handler to handle zoom change events
See Also:
"http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama.zoomchanged"

checkResize

public void checkResize()
Notifies the flash viewer of a change of the size of its container.


followLink

public void followLink(double yaw)
Follows a link from the current panorama to a neighbouring panorama. Yaw specifies the direction of the neighbouring panorama; if there are multiple neighbouring panoramas then the nearest match will be taken.

Parameters:
yaw - the yaw specifying the direction of the neighbouring panorama;

getLatLng

public LatLng getLatLng()
Returns the latitude and longitude of the panorama object.

Returns:
the latitude and longitude of the panorama object.

getPanoId

public java.lang.String getPanoId()
Returns the unique id of the panorama object.

Returns:
the unique id of the panorama object.

getPov

public Pov getPov()
Returns the current point of view (Pov) displayed in the flash viewer.

Returns:
the current point of view (Pov) displayed in the flash viewer.

hide

public void hide()
Hides the flash viewer.


isHidden

public boolean isHidden()
Returns true if and only if the flash viewer associated with this object is hidden.

Returns:
true if and only if the flash viewer associated with this object is hidden.

panTo

public void panTo(Pov pov,
                  boolean longRoute)
Changes the current point of view (Pov) displayed in the flash viewer without changing the location. Performs a smooth animation from the current POV to the new POV. If longRoute is set then the animation will follow a long route around the sphere, otherwise the shortest route.

Parameters:
pov - the new point of view to perform an animation to
longRoute - if true the animation will follow a long route around the sphere, otherwise the shortest route.

remove

public void remove()
Removes the instance of the flash viewer currently associated with this object from the DOM. This function must be called before removing the HTML container element otherwise some browsers will fail to garbage collect the flash viewer.


removeErrorHandler

public void removeErrorHandler(StreetviewErrorHandler handler)
Removes a handler for error events.

Parameters:
handler - previously added handler
See Also:
addErrorHandler(StreetviewErrorHandler), "http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama.error"

removeInitializedHandler

public void removeInitializedHandler(StreetviewInitializedHandler handler)
Removes a handler for initialized events.

Parameters:
handler - previously added handler
See Also:
addInitializedHandler(StreetviewInitializedHandler), "http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama.initialized"

removePitchChangedHandler

public void removePitchChangedHandler(StreetviewPitchChangedHandler handler)
Removes a handler for pitch changed events.

Parameters:
handler - previously added handler
See Also:
addPitchChangedHandler(StreetviewPitchChangedHandler), "http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama.pitchchanged"

removeYawChangedHandler

public void removeYawChangedHandler(StreetviewYawChangedHandler handler)
Removes a handler for yaw changed events.

Parameters:
handler - previously added handler
See Also:
addYawChangedHandler(StreetviewYawChangedHandler), "http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama.yawchanged"

removeZoomChangedHandler

public void removeZoomChangedHandler(StreetviewZoomChangedHandler handler)
Removes a handler for zoom changed events.

Parameters:
handler - previously added handler
See Also:
addZoomChangedHandler(StreetviewZoomChangedHandler), "http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama.zoomchanged"

setLocationAndPov

public void setLocationAndPov(LatLng latLng,
                              Pov pov)
Sets the location and point of view (Pov) of the flash viewer. After calling this function, the viewer will display the nearest location to the LatLng provided if one is available. If no data is available for this location, then the flash player will remain unchanged and emit an error event.

Parameters:
latLng - the new latitude and longitude
pov - the new point of view

setPov

public void setPov(Pov pov)
Changes the current point of view (Pov) displayed in the flash viewer without changing the location.

Parameters:
pov - the new point of view

setUserPhoto

public void setUserPhoto(PhotoSpec photoSpec)
Shows a user-contributed photo in the flash viewer. After calling this method, the viewer will display the photo uniquely identified by photoSpec. If the photo cannot be displayed, then the flash player will remain unchanged and emit the error code 601 - NO_PHOTO.

Parameters:
photoSpec - specifies a photo to display.
See Also:
"http://code.google.com/apis/maps/documentation/reference.html#GStreetviewPanorama.ErrorValues.NO_PHOTO"

show

public void show()
Shows the flash viewer.