001 package com.google.gwt.maps.client.overlays; 002 003 import com.google.gwt.core.client.JavaScriptObject; 004 import com.google.gwt.core.client.JsArray; 005 import com.google.gwt.maps.client.MapImpl; 006 import com.google.gwt.maps.client.MapWidget; 007 import com.google.gwt.maps.client.base.LatLng; 008 import com.google.gwt.maps.client.mvc.MVCArray; 009 010 /** 011 * polyline options 012 * <br><br> 013 * See <a href="https://developers.google.com/maps/documentation/javascript/reference#PolygonOptions">PolygonOptions API Doc</a> 014 */ 015 public class PolylineOptions extends JavaScriptObject { 016 017 /** 018 * use newInstance(); 019 */ 020 protected PolylineOptions() {} 021 022 /** 023 * creates a new instance of options 024 */ 025 public final static PolylineOptions newInstance() { 026 return JavaScriptObject.createObject().cast(); 027 } 028 029 /** 030 * sets Indicates whether this Polyline handles click events. Defaults to true. 031 * @param clickable 032 */ 033 public final native void setClickable(boolean clickable) /*-{ 034 this.clickable = clickable; 035 }-*/; 036 037 /** 038 * gets Indicates whether this Polyline handles click events. Defaults to true. 039 */ 040 public final native boolean getClickable() /*-{ 041 return this.clickable; 042 }-*/; 043 044 /** 045 * sets When true, render each edge as a geodesic (a segment of a "great circle"). A geodesic is the shortest path between two points along the surface of the Earth. When false, render each edge as a straight line on screen. Defaults to false. 046 * @param geodesic 047 */ 048 public final native void setGeodesic(boolean geodesic) /*-{ 049 this.geodesic = geodesic; 050 }-*/; 051 052 /** 053 * gets When true, render each edge as a geodesic (a segment of a "great circle"). A geodesic is the shortest path between two points along the surface of the Earth. When false, render each edge as a straight line on screen. Defaults to false. 054 */ 055 public final native boolean getGeodesic() /*-{ 056 return this.geodesic; 057 }-*/; 058 059 /** 060 * sets Map on which to display Polyline. 061 * @param mapWidget 062 */ 063 public final void setMap(MapWidget mapWidget) { 064 setMapImpl(mapWidget.getJso()); 065 } 066 067 private final native void setMapImpl(MapImpl map) /*-{ 068 this.map = map; 069 }-*/; 070 071 /** 072 * gets Map on which to display Polyline. 073 */ 074 public final MapWidget getMapWidget() { 075 return MapWidget.newInstance(getMapImpl()); 076 } 077 078 private final native MapImpl getMapImpl() /*-{ 079 return this.map; 080 }-*/; 081 082 /** 083 * sets The ordered sequence of coordinates of the Polyline. This path may be specified using either a simple array of LatLngs, or an MVCArray of LatLngs. Note that if you pass a simple array, it will be converted to an MVCArray Inserting or removing LatLngs in the MVCArray will automatically update the polyline on the map. 084 * @param path 085 */ 086 public final native void setPath(MVCArray<LatLng> path) /*-{ 087 this.path = path; 088 }-*/; 089 090 /** 091 * sets The ordered sequence of coordinates of the Polyline. This path may be specified using either a simple array of LatLngs, or an MVCArray of LatLngs. Note that if you pass a simple array, it will be converted to an MVCArray Inserting or removing LatLngs in the MVCArray will automatically update the polyline on the map. 092 * @param path 093 */ 094 public final native void setPath(JsArray<LatLng> path) /*-{ 095 this.path = path; 096 }-*/; 097 098 /** 099 * gets The ordered sequence of coordinates of the Polyline. This path may be specified using either a simple array of LatLngs, or an MVCArray of LatLngs. Note that if you pass a simple array, it will be converted to an MVCArray Inserting or removing LatLngs in the MVCArray will automatically update the polyline on the map. 100 */ 101 public final native MVCArray<LatLng> getPath_MVCArray() /*-{ 102 return this.path; 103 }-*/; 104 105 /** 106 * gets The ordered sequence of coordinates of the Polyline. This path may be specified using either a simple array of LatLngs, or an MVCArray of LatLngs. Note that if you pass a simple array, it will be converted to an MVCArray Inserting or removing LatLngs in the MVCArray will automatically update the polyline on the map. 107 */ 108 public final native JsArray<LatLng> getPath_JsArray() /*-{ 109 return this.path; 110 }-*/; 111 112 /** 113 * sets The stroke color. All CSS3 colors are supported except for extended named colors. 114 * @param strokeColor 115 */ 116 public final native void setStrokeColor(String strokeColor) /*-{ 117 this.strokeColor = strokeColor; 118 }-*/; 119 120 /** 121 * gets The stroke color. All CSS3 colors are supported except for extended named colors. 122 */ 123 public final native String getStrokeColor() /*-{ 124 return this.strokeColor; 125 }-*/; 126 127 /** 128 * sets The stroke opacity between 0.0 and 1.0 129 * @param strokeOpacity 130 */ 131 public final native void setStrokeOpacity(double strokeOpacity) /*-{ 132 this.strokeOpacity = strokeOpacity; 133 }-*/; 134 135 /** 136 * gets The stroke opacity between 0.0 and 1.0 137 */ 138 public final native double getStrokeOpacity() /*-{ 139 return this.strokeOpacity; 140 }-*/; 141 142 /** 143 * sets The stroke width in pixels. 144 * @param strokeWeight 145 */ 146 public final native void setStrokeWeight(int strokeWeight) /*-{ 147 this.strokeWeight = strokeWeight; 148 }-*/; 149 150 /** 151 * gets The stroke width in pixels. 152 */ 153 public final native int getStrokeWeight() /*-{ 154 return this.strokeWeight; 155 }-*/; 156 157 /** 158 * sets The zIndex compared to other polys. 159 * @param zIndex 160 */ 161 public final native void setZindex(int zIndex) /*-{ 162 this.zIndex = zIndex; 163 }-*/; 164 165 /** 166 * gets The zIndex compared to other polys. 167 */ 168 public final native int getZindex() /*-{ 169 return this.zIndex; 170 }-*/; 171 172 }