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

com.google.maps.gwt.client.panoramio.PanoramioLayer 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.panoramio;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.maps.gwt.client.GoogleMap;
import com.google.maps.gwt.client.MVCObject;

/**
 * A 
 * PanoramioLayer
 * 
 * displays photos from Panoramio as a rendered layer.
 *
 * THIS SOURCE CODE IS GENERATED, DO NOT MODIFY
 */
public class PanoramioLayer extends MVCObject {

  /**
   * This event is fired when a feature in the layer is clicked.
   */
  public interface ClickHandler  {

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

  /**
   * A layer that displays data from Panoramio.
   */ 
  public static native PanoramioLayer create(PanoramioLayerOptions 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.panoramio.PanoramioLayer(_opts);
  }-*/;

  /**
   * A layer that displays data from Panoramio.
   */ 
  public static native PanoramioLayer create()/*-{
    return new $wnd.google.maps.panoramio.PanoramioLayer();
  }-*/;


  /**
   * Protected constructor avoids default public constructor.
   */
  protected PanoramioLayer() {
    /* 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 addClickListener(ClickHandler handler)/*-{
    var _handler = $entry(function(event) {
      handler.@com.google.maps.gwt.client.panoramio.PanoramioLayer.ClickHandler::handle(Lcom/google/maps/gwt/client/panoramio/PanoramioMouseEvent;)(event);

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

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

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

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

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

  /**
   * Returns the map on which this layer is displayed.
   */ 
  public final native GoogleMap getMap()/*-{
    return this.getMap();

  }-*/;

  public final native String getTag()/*-{
    return this.getTag();

  }-*/;

  public final native String getUserId()/*-{
    return this.getUserId();

  }-*/;

  /**
   * Renders the layer on the specified map.  If map is set to null, the
   * layer will be removed.
   */ 
  public final native void setMap(GoogleMap map)/*-{
    this.setMap(map);

  }-*/;

  public final native void setOptions(PanoramioLayerOptions options)/*-{
    var _options;
    if(@com.google.gwt.core.client.GWT::isScript()()) {
      _options = options;
    } else {
      _options = {};
      for(k in options) {
        if(k != "__gwt_ObjectId") {
          _options[k] = options[k];
        }
      }
    } 
    this.setOptions(_options);

  }-*/;

  public final native void setTag(String tag)/*-{
    this.setTag(tag);

  }-*/;

  public final native void setUserId(String userId)/*-{
    this.setUserId(userId);

  }-*/;

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

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy