001 package com.google.gwt.maps.client.controls; 002 003 import com.google.gwt.core.client.JavaScriptObject; 004 005 /** 006 * Options for the rendering of the zoom control. 007 * <br><br> 008 * See <a href="https://developers.google.com/maps/documentation/javascript/reference#ZoomControlOptions">ZoomControlOptions API Doc</a> 009 */ 010 public class ZoomControlOptions extends JavaScriptObject { 011 012 /** 013 * creates Options for the rendering of the zoom control. 014 */ 015 public final static ZoomControlOptions newInstance() { 016 return JavaScriptObject.createObject().cast(); 017 } 018 019 /** 020 * Options for the rendering of the zoom control. 021 * use newInstance(); 022 */ 023 protected ZoomControlOptions() {} 024 025 /** 026 * Position id. Used to specify the position of the control on the map. The default position is TOP_LEFT. 027 */ 028 public final ControlPosition getPosition() { 029 return ControlPosition.fromValue(getPositionImpl()); 030 } 031 032 private final native int getPositionImpl() /*-{ 033 return this.position; 034 }-*/; 035 036 public final native int getStyleJs() /*-{ 037 return this.style; 038 }-*/; 039 040 /** 041 * Position id. Used to specify the position of the control on the map. The default position is TOP_LEFT. 042 * @param position {@link ControlPosition} 043 */ 044 public final void setPosition(ControlPosition position) { 045 setPositionImpl(position.value()); 046 } 047 048 private final native void setPositionImpl(int position) /*-{ 049 this.position = position; 050 }-*/; 051 052 private final native void setStyle(String type) /*-{ 053 this.style = $wnd.google.maps.ZoomControlStyle[type] 054 }-*/; 055 056 /* 057 * gets Style id. Used to select what style of zoom control to display. 058 public final ZoomControlStyle getStyle() { 059 return ZoomControlStyle.fromValue(getStyleJs()); 060 } 061 */ 062 063 /** 064 * sets Style id. Used to select what style of zoom control to display. 065 * @param zoomControlStyle 066 */ 067 public final void setStyle(ZoomControlStyle zoomControlStyle) { 068 setStyle(zoomControlStyle.value()); 069 } 070 071 }