001 package com.google.gwt.maps.client.weatherlib;
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 WeatherLayer object. <br>
009 * <br>
010 * See <a href=
011 * "https://developers.google.com/maps/documentation/javascript/reference#WeatherLayerOptions"
012 * >WeatherLayerOptions API Doc</a>
013 */
014 public class WeatherLayerOptions extends JavaScriptObject {
015
016 /**
017 * use newInstance();
018 */
019 protected WeatherLayerOptions() {
020 }
021
022 /**
023 * creates - This object defines the properties that can be set on a
024 * WeatherLayer object.
025 */
026 public static final WeatherLayerOptions newInstance() {
027 return JavaScriptObject.createObject().cast();
028 }
029
030 /**
031 * sets If true, the layer receives mouse events. Default value is true.
032 *
033 * @param clickable
034 */
035 public final native void setClickable(boolean clickable) /*-{
036 this.clickable = clickable;
037 }-*/;
038
039 /**
040 * gets If true, the layer receives mouse events. Default value is true.
041 */
042 public final native boolean getClickable() /*-{
043 return this.clickable;
044 }-*/;
045
046 /**
047 * Sets the color of labels on the weather layer. If this is not explicitly set, the label color is chosen automatically depending on the map type.
048 *
049 * @param labelColor
050 */
051 public final native void setLabelColor(LabelColor labelColor) /*-{
052 this.labelColor = labelColor;
053 }-*/;
054
055 /**
056 * Sets the color of labels on the weather layer.
057 */
058 public final native LabelColor getLabelColor() /*-{
059 return this.labelColor;
060 }-*/;
061
062 /**
063 * Sets the units to use for temperature.
064 *
065 * @param temperatureUnits
066 */
067 public final native void setTemperatureUnits(TemperatureUnit temperatureUnits) /*-{
068 this.temperatureUnits = temperatureUnits;
069 }-*/;
070
071 /**
072 * Gets the units to use for temperature.
073 */
074 public final native TemperatureUnit getTemperatureUnits() /*-{
075 return this.temperatureUnits;
076 }-*/;
077
078 /**
079 * Sets the units to use for wind speed.
080 *
081 * @param windSpeedUnits
082 */
083 public final native void setWindSpeedUnits(WindSpeedUnit windSpeedUnits) /*-{
084 this.windSpeedUnits = windSpeedUnits;
085 }-*/;
086
087 /**
088 * Gets the units to use for wind speed.
089 */
090 public final native WindSpeedUnit getWindSpeedUnits() /*-{
091 return this.windSpeedUnits;
092 }-*/;
093
094 /**
095 * Layer will be rendered to this map
096 *
097 * @param mapWidget
098 */
099 public final void setMap(MapWidget mapWidget) {
100 if (mapWidget == null) {
101 setMapImpl(null);
102 } else {
103 setMapImpl(mapWidget.getJso());
104 }
105 }
106
107 private final native void setMapImpl(MapImpl map) /*-{
108 this.map = map;
109 }-*/;
110
111 /**
112 * Returns the map on which this layer is displayed.
113 */
114 public final MapWidget getMap() {
115 return MapWidget.newInstance(getMapImpl());
116 }
117
118 private final native MapImpl getMapImpl() /*-{
119 return this.map;
120 }-*/;
121
122 /**
123 * Sets Suppress the rendering of info windows when layer features are
124 * clicked.
125 *
126 * @param suppressInfoWindows
127 */
128 public final native void setSuppressInfoWindows(boolean suppressInfoWindows) /*-{
129 this.suppressInfoWindows = suppressInfoWindows;
130 }-*/;
131
132 /**
133 * gets Suppress the rendering of info windows when layer features are
134 * clicked.
135 */
136 public final native boolean getSuppressInfoWindows() /*-{
137 return this.suppressInfoWindows;
138 }-*/;
139
140 }