001 package com.google.gwt.maps.client.layers;
002
003 import com.google.gwt.core.client.JavaScriptObject;
004 import com.google.gwt.maps.client.MapImpl;
005 import com.google.gwt.maps.client.MapWidget;
006
007 /**
008 * This object defines the properties that can be set on a KmlLayer object.
009 * <br><br>
010 * See <a href="https://developers.google.com/maps/documentation/javascript/reference#KmlLayerOptions">KmlLayerOptions API Doc</a>
011 */
012 public class KmlLayerOptions extends JavaScriptObject {
013
014 /**
015 * use newInstance();
016 */
017 protected KmlLayerOptions() {}
018
019 /**
020 * This object defines the properties that can be set on a KmlLayer object.
021 */
022 public static final KmlLayerOptions newInstance() {
023 return JavaScriptObject.createObject().cast();
024 }
025
026 /**
027 * If true, the layer receives mouse events. Default value is true.
028 * @param clickable
029 */
030 public final native void setClickable(boolean clickable) /*-{
031 this.clickable = clickable;
032 }-*/;
033
034 /**
035 * If true, the layer receives mouse events. Default value is true.
036 */
037 public final native boolean getClickable() /*-{
038 return this.clickable;
039 }-*/;
040
041 /**
042 * Renders the KML Layer on the specified map. If map is set to null, the layer is removed.
043 * @param mapWidget
044 */
045 public final void setMap(MapWidget mapWidget) {
046 setMapImpl(mapWidget.getJso());
047 }
048
049 private final native void setMapImpl(MapImpl map) /*-{
050 this.map = map;
051 }-*/;
052
053 /**
054 * Get the map on which the KML Layer is being rendered.
055 */
056 public final MapWidget getMap() {
057 return MapWidget.newInstance(getMapImpl());
058 }
059
060 private final native MapImpl getMapImpl() /*-{
061 return this.map;
062 }-*/;
063
064 /**
065 * By default, the input map is centered and zoomed to the bounding box of the contents of the layer. If this option is set to true, the viewport is left unchanged, unless the map's center and zoom were never set.
066 * @param preserveViewport
067 */
068 public final native void setPreserveViewport(boolean preserveViewport) /*-{
069 this.preserveViewport = preserveViewport;
070 }-*/;
071
072 /**
073 * By default, the input map is centered and zoomed to the bounding box of the contents of the layer. If this option is set to true, the viewport is left unchanged, unless the map's center and zoom were never set.
074 */
075 public final native boolean getPreserveViewport() /*-{
076 return this.preserveViewport;
077 }-*/;
078
079 /**
080 * Suppress the rendering of info windows when layer features are clicked.
081 * @param suppressInfoWindows
082 */
083 public final native void setSuppressInfoWindows(boolean suppressInfoWindows) /*-{
084 this.suppressInfoWindows = suppressInfoWindows;
085 }-*/;
086
087 /**
088 * Suppress the rendering of info windows when layer features are clicked.
089 */
090 public final native boolean getSuppressInfoWindows() /*-{
091 return this.suppressInfoWindows;
092 }-*/;
093
094 }