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 import com.google.gwt.maps.client.mvc.MVCObject; 007 008 /** 009 * A layer showing current clouds. This class extends MVCObject. <br> 010 * <br> 011 * See <a href= 012 * "https://developers.google.com/maps/documentation/javascript/reference#CloudLayer" 013 * >CloudLayer API Doc</a> 014 */ 015 public class CloudLayer extends MVCObject<CloudLayer> { 016 017 /** 018 * use newInstance(); 019 */ 020 protected CloudLayer() { 021 } 022 023 /** 024 * A layer that displays graphics showing current weather conditions. 025 */ 026 public static final CloudLayer newInstance() { 027 return createJso().cast(); 028 } 029 030 private static final native JavaScriptObject createJso() /*-{ 031 return new $wnd.google.maps.weather.CloudLayer(); 032 }-*/; 033 034 public final void setMap(MapWidget mapWidget) { 035 if (mapWidget == null) { 036 setMapImpl(null); 037 } else { 038 setMapImpl(mapWidget.getJso()); 039 } 040 } 041 042 private final native void setMapImpl(MapImpl map) /*-{ 043 this.setMap(map); 044 }-*/; 045 046 public final MapWidget getMap() { 047 return MapWidget.newInstance(getMapImpl()); 048 } 049 050 private final native MapImpl getMapImpl() /*-{ 051 return this.getMap(); 052 }-*/; 053 054 }