All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.maps.gwt.client.StreetViewPanorama Maven / Gradle / Ivy

/*
 * Copyright 2011 The Google Web Toolkit Authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.maps.gwt.client;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.dom.client.Node;
import com.google.gwt.event.dom.client.ClickEvent;

/**
 * Displays the panorama for a given 
 * LatLng
 * 
 * or panorama ID. A 
 * StreetViewPanorama
 * 
 * object provides a Street View "viewer" which can be stand-alone within a separate 
 * <div>
 * 
 * or bound to a 
 * Map
 * 
 * .
 *
 * THIS SOURCE CODE IS GENERATED, DO NOT MODIFY
 */
public class StreetViewPanorama extends MVCObject {

  /**
   * Callback type for handling asynchronous responses from registerPanoProvider.
   */
  public interface Callback  {

    /**
     * Called by the callback handler
     */ 
    StreetViewPanoramaData handle(String a);
  }

  /**
   * This event is fired when the close button is clicked.
   */
  public interface CloseClickHandler  {

    /**
     * Override to handle event.
     */ 
    void handle(ClickEvent event);
  }

  /**
   * This event is fired when the panorama's links change.  The links
   * change asynchronously following a pano id change.
   */
  public interface LinksChangedHandler  {

    /**
     * Override to handle event.
     */ 
    void handle();
  }

  /**
   * This event is fired when the panorama's pano id changes.  The pano
   * may change as the user navigates through the panorama or the position
   * is manually set.  Note that not all position changes trigger a
   * pano_changed
   * 
   * .
   */
  public interface PanoChangedHandler  {

    /**
     * Override to handle event.
     */ 
    void handle();
  }

  /**
   * This event is fired when the panorama's position changes.  The
   * position changes as the user navigates through the panorama or the
   * position is set manually.
   */
  public interface PositionChangedHandler  {

    /**
     * Override to handle event.
     */ 
    void handle();
  }

  /**
   * This event is fired when the panorama's point-of-view changes. The
   * point of view changes as the pitch, zoom, or heading changes.
   */
  public interface PovChangedHandler  {

    /**
     * Override to handle event.
     */ 
    void handle();
  }

  /**
   * Developers should trigger this event on the panorama when its div changes size: 
   * 
   * google.maps.event.trigger(panorama, 'resize')
   * 
   * .
   */
  public interface ResizeHandler  {

    /**
     * Override to handle event.
     */ 
    void handle();
  }

  /**
   * This event is fired when the panorama's visibility changes.  The
   * visibility is changed when the Pegman id dragged onto the map, the
   * close button is clicked, or
   * setVisible()
   * 
   * is called.
   */
  public interface VisibleChangedHandler  {

    /**
     * Override to handle event.
     */ 
    void handle();
  }

  /**
   * Creates a panorama with the passed 
   * StreetViewPanoramaOptions
   * 
   * .
   */ 
  public static native StreetViewPanorama create(Node container, StreetViewPanoramaOptions opts)/*-{
    var _opts;
    if(@com.google.gwt.core.client.GWT::isScript()()) {
      _opts = opts;
    } else {
      _opts = {};
      for(k in opts) {
        if(k != "__gwt_ObjectId") {
          _opts[k] = opts[k];
        }
      }
    } 
    return new $wnd.google.maps.StreetViewPanorama(container, _opts);
  }-*/;

  /**
   * Creates a panorama with the passed 
   * StreetViewPanoramaOptions
   * 
   * .
   */ 
  public static native StreetViewPanorama create(Node container)/*-{
    return new $wnd.google.maps.StreetViewPanorama(container);
  }-*/;


  /**
   * Protected constructor avoids default public constructor.
   */
  protected StreetViewPanorama() {
    /* Java constructor is protected, */
  }

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addCloseClickListener(CloseClickHandler handler)/*-{
    var _handler = $entry(function(event) {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.CloseClickHandler::handle(Lcom/google/gwt/event/dom/client/ClickEvent;)(event);

    }); 
    $wnd.google.maps.event.addListener(this, "closeclick", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addCloseClickListenerOnce(CloseClickHandler handler)/*-{
    var _handler = $entry(function(event) {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.CloseClickHandler::handle(Lcom/google/gwt/event/dom/client/ClickEvent;)(event);

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "closeclick", _handler);
  }-*/;

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addLinksChangedListener(LinksChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.LinksChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListener(this, "links_changed", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addLinksChangedListenerOnce(LinksChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.LinksChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "links_changed", _handler);
  }-*/;

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addPanoChangedListener(PanoChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.PanoChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListener(this, "pano_changed", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addPanoChangedListenerOnce(PanoChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.PanoChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "pano_changed", _handler);
  }-*/;

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addPositionChangedListener(PositionChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.PositionChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListener(this, "position_changed", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addPositionChangedListenerOnce(PositionChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.PositionChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "position_changed", _handler);
  }-*/;

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addPovChangedListener(PovChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.PovChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListener(this, "pov_changed", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addPovChangedListenerOnce(PovChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.PovChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "pov_changed", _handler);
  }-*/;

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addResizeListener(ResizeHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.ResizeHandler::handle()();

    }); 
    $wnd.google.maps.event.addListener(this, "resize", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addResizeListenerOnce(ResizeHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.ResizeHandler::handle()();

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "resize", _handler);
  }-*/;

  /**
   * Adds the given listener function to the given event name for the
   * given object instance. Returns an identifier for this listener that
   * can be used with removeListener().
   */ 
  public final native void addVisibleChangedListener(VisibleChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.VisibleChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListener(this, "visible_changed", _handler);
  }-*/;

  /**
   * Like addListener, but the handler removes itself after handling the first event.
   */ 
  public final native void addVisibleChangedListenerOnce(VisibleChangedHandler handler)/*-{
    var _handler = $entry(function() {
      handler.@com.google.maps.gwt.client.StreetViewPanorama.VisibleChangedHandler::handle()();

    }); 
    $wnd.google.maps.event.addListenerOnce(this, "visible_changed", _handler);
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearCloseClickListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "closeclick");
  }-*/;

  /**
   * Removes all listeners for all events for the given instance.
   */ 
  public final native void clearInstanceListeners()/*-{
    $wnd.google.maps.event.clearInstanceListeners(this);
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearLinksChangedListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "links_changed");
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearPanoChangedListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "pano_changed");
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearPositionChangedListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "position_changed");
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearPovChangedListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "pov_changed");
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearResizeListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "resize");
  }-*/;

  /**
   * Removes all listeners for the given event for the given instance.
   */ 
  public final native void clearVisibleChangedListeners()/*-{
    $wnd.google.maps.event.clearListeners(this, "visible_changed");
  }-*/;

  /**
   * Additional controls to attach to the panorama. To add a control to
   * the panorama, add the control's
   * <div>
   * 
   * to the
   * MVCArray
   * 
   *  corresponding to the 
   * ControlPosition
   * 
   * where it should be rendered.
   */ 
  public final native JsArray> getControls()/*-{
    return this.controls;

  }-*/;

  /**
   * Returns the set of navigation links for the Street View panorama.
   */ 
  public final native JsArray getLinks()/*-{
    return this.getLinks();

  }-*/;

  /**
   * Returns the current panorama ID for the Street View panorama.  This
   * id is stable within the browser's current session only.
   */ 
  public final native String getPano()/*-{
    return this.getPano();

  }-*/;

  /**
   * Returns the current 
   * LatLng
   * 
   * position for the Street View panorama.
   */ 
  public final native LatLng getPosition()/*-{
    return this.getPosition();

  }-*/;

  /**
   * Returns the current point of view for the Street View panorama.
   */ 
  public final native StreetViewPov getPov()/*-{
    return this.getPov();

  }-*/;

  /**
   * Returns 
   * true
   * 
   * if the panorama is visible.  It does not specify whether Street View
   * imagery is available at the specified position.
   */ 
  public final native boolean getVisible()/*-{
    return this.getVisible();

  }-*/;

  /**
   * Set the custom panorama provider called on pano change to load custom panoramas.
   */ 
  public final native void registerPanoProvider(Callback provider)/*-{
    var _provider = $entry(function(a) {
      return [email protected]::handle(Ljava/lang/String;)(a);

    }); 
    this.registerPanoProvider(_provider);

  }-*/;

  /**
   * Additional controls to attach to the panorama. To add a control to
   * the panorama, add the control's
   * <div>
   * 
   * to the
   * MVCArray
   * 
   *  corresponding to the 
   * ControlPosition
   * 
   * where it should be rendered.
   */ 
  public final native void setControls(JsArray> controls)/*-{
    this.controls = controls;
  }-*/;

  /**
   * Sets the current panorama ID for the Street View panorama.
   */ 
  public final native void setPano(String pano)/*-{
    this.setPano(pano);

  }-*/;

  /**
   * Sets the current 
   * LatLng
   * 
   * position for the Street View panorama.
   */ 
  public final native void setPosition(LatLng latLng)/*-{
    this.setPosition(latLng);

  }-*/;

  /**
   * Sets the point of view for the Street View panorama.
   */ 
  public final native void setPov(StreetViewPov pov)/*-{
    this.setPov(pov);

  }-*/;

  /**
   * Sets to 
   * true
   * 
   * to make the panorama visible.  If set to
   * false
   * 
   * , the panorama will be hidden whether it is embedded in the map or in its own 
   * <div>
   * 
   * .
   */ 
  public final native void setVisible(boolean flag)/*-{
    this.setVisible(flag);

  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerCloseClick(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "closeclick", _varargs);
  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerLinksChanged(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "links_changed", _varargs);
  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerPanoChanged(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "pano_changed", _varargs);
  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerPositionChanged(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "position_changed", _varargs);
  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerPovChanged(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "pov_changed", _varargs);
  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerResize(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "resize", _varargs);
  }-*/;

  /**
   * Triggers the given event. All arguments after eventName are passed as
   * arguments to the listeners.
   */ 
  public final native void triggerVisibleChanged(JavaScriptObject... varargs)/*-{
    var _varargs =
        @com.google.maps.gwt.client.ArrayHelper::toJsArray([Lcom/google/gwt/core/client/JavaScriptObject;)(varargs); 
    $wnd.google.maps.event.trigger(this, "visible_changed", _varargs);
  }-*/;

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy