001 package com.google.gwt.maps.client.placeslib; 002 003 import com.google.gwt.core.client.JavaScriptObject; 004 import com.google.gwt.core.client.JsArray; 005 import com.google.gwt.core.client.JsArrayString; 006 import com.google.gwt.maps.client.services.GeocoderAddressComponent; 007 008 /** 009 * Defines information about a Place. 010 * <br><br> 011 * See <a href="https://developers.google.com/maps/documentation/javascript/reference#PlaceResult">PlaceResult API Doc</a> 012 */ 013 public class PlaceResult extends JavaScriptObject { 014 015 /** 016 * use newInstance(); 017 */ 018 protected PlaceResult() {} 019 020 /** 021 * Create new {@link PlaceResult} instance. 022 */ 023 public static final PlaceResult newInstance() { 024 return JavaScriptObject.createObject().cast(); 025 } 026 027 /** 028 * The collection of address components for this Place's location. 029 * @param address_components 030 */ 031 public final native void setAddress_Components(JsArray<GeocoderAddressComponent> address_components) /*-{ 032 this.address_components = address_components; 033 }-*/; 034 035 /** 036 * The collection of address components for this Place's location. 037 */ 038 public final native JsArray<GeocoderAddressComponent> getAddress_Components() /*-{ 039 return this.address_components; 040 }-*/; 041 042 /** 043 * The Place's full address. 044 * @param formatted_address 045 */ 046 public final native void setFormated_Address(String formatted_address) /*-{ 047 this.formatted_address = formatted_address; 048 }-*/; 049 050 /** 051 * The Place's full address. 052 */ 053 public final native String getFormatted_Address() /*-{ 054 return this.formatted_address; 055 }-*/; 056 057 /** 058 * The Place's phone number, formatted according to the number's regional convention. 059 * @param formatted_phone_number 060 */ 061 public final native void setFormatted_Phone_Number(String formatted_phone_number) /*-{ 062 this.formatted_phone_number = formatted_phone_number; 063 }-*/; 064 065 /** 066 * The Place's phone number, formatted according to the number's regional convention. 067 */ 068 public final native String getFormatted_Phone_Number() /*-{ 069 return this.formatted_phone_number; 070 }-*/; 071 072 /** 073 * The Place's geometry-related information. 074 * @param geometry 075 */ 076 public final native void setGeometry(PlaceGeometry geometry) /*-{ 077 this.geometry = geometry; 078 }-*/; 079 080 /** 081 * The Place's geometry-related information. 082 */ 083 public final native PlaceGeometry getGeometry() /*-{ 084 return this.geometry; 085 }-*/; 086 087 /** 088 * Attribution text to be displayed for this Place result. 089 * @param html_attributions 090 */ 091 public final native void setHtml_Attributions(String html_attributions) /*-{ 092 this.html_attributions = html_attributions; 093 }-*/; 094 095 /** 096 * Attribution text to be displayed for this Place result. 097 */ 098 public final native String getHtml_Attributions() /*-{ 099 return this.html_attributions; 100 }-*/; 101 102 /** 103 * URL to an image resource that can be used to represent this Place's category. 104 * @param icon 105 */ 106 public final native void setIcon(String icon) /*-{ 107 this.icon = icon; 108 }-*/; 109 110 /** 111 * URL to an image resource that can be used to represent this Place's category. 112 */ 113 public final native String getIcon() /*-{ 114 return this.icon; 115 }-*/; 116 117 /** 118 * A unique identifier denoting this Place. This identifier may not be used to retrieve information about this Place, and to verify the identity of a Place across separate searches. As ids can occasionally change, it is recommended that the stored id for a Place be compared with the id returned in later Details requests for the same Place, and updated if necessary. 119 * @param id 120 */ 121 public final native void setId(String id) /*-{ 122 this.id = id; 123 }-*/; 124 125 /** 126 * A unique identifier denoting this Place. This identifier may not be used to retrieve information about this Place, and to verify the identity of a Place across separate searches. As ids can occasionally change, it is recommended that the stored id for a Place be compared with the id returned in later Details requests for the same Place, and updated if necessary. 127 */ 128 public final native String getId() /*-{ 129 return this.id; 130 }-*/; 131 132 /** 133 * The Place's phone number in international format. International format includes the country code, and is prefixed with the plus (+) sign. 134 * @param international_phone_number 135 */ 136 public final native void setInternational_Phone_Number(String international_phone_number) /*-{ 137 this.international_phone_number = international_phone_number; 138 }-*/; 139 140 /** 141 * The Place's phone number in international format. International format includes the country code, and is prefixed with the plus (+) sign. 142 */ 143 public final native String getInternational_Phone_Number() /*-{ 144 return this.international_phone_number; 145 }-*/; 146 147 /** 148 * The Place's name. Note: In the case of user entered Places, this is the raw text, as typed by the user. Please exercise caution when using this data, as malicious users may try to use it as a vector for code injection attacks. 149 * <br><br> 150 * See <a href="http://en.wikipedia.org/wiki/Code_injection">Code Injection</a> 151 * @param name 152 */ 153 public final native void setName(String name) /*-{ 154 this.name = name; 155 }-*/; 156 157 /** 158 * The Place's name. Note: In the case of user entered Places, this is the raw text, as typed by the user. Please exercise caution when using this data, as malicious users may try to use it as a vector for code injection attacks. 159 * <br><br> 160 * See <a href="http://en.wikipedia.org/wiki/Code_injection">Code Injection</a> 161 */ 162 public final native String getName() /*-{ 163 return this.name; 164 }-*/; 165 166 /** 167 * The Place's rating, from 0.0 to 5.0, based on user reviews. 168 * @param rating 169 */ 170 public final native void setRating(int rating) /*-{ 171 this.rating = rating; 172 }-*/; 173 174 /** 175 * The Place's rating, from 0.0 to 5.0, based on user reviews. 176 */ 177 public final native int getRating() /*-{ 178 return this.rating; 179 }-*/; 180 181 /** 182 * An opaque string that may be used to retrieve up-to-date information about this Place (via PlacesService.getDetails()). reference contains a unique token that you can use to retrieve additional information about this Place in a Place Details request. You can store this token and use it at any time in future to refresh cached data about this Place, but the same token is not guaranteed to be returned for any given Place across different searches. 183 * @param reference 184 */ 185 public final native void setReference(String reference) /*-{ 186 this.reference = reference; 187 }-*/; 188 189 /** 190 * An opaque string that may be used to retrieve up-to-date information about this Place (via PlacesService.getDetails()). reference contains a unique token that you can use to retrieve additional information about this Place in a Place Details request. You can store this token and use it at any time in future to refresh cached data about this Place, but the same token is not guaranteed to be returned for any given Place across different searches. 191 */ 192 public final native String getReference() /*-{ 193 return this.reference; 194 }-*/; 195 196 /** 197 * An array of types for this Place (e.g., ["political", "locality"] or ["restaurant", "establishment"]). 198 * @param types 199 */ 200 public final native void setTypes(JsArrayString types) /*-{ 201 this.types = types; 202 }-*/; 203 204 /** 205 * An array of types for this Place (e.g., ["political", "locality"] or ["restaurant", "establishment"]). 206 */ 207 public final native JsArrayString getTypes() /*-{ 208 return this.types; 209 }-*/; 210 211 /** 212 * URL of the associated Google Place Page. 213 * @param url 214 */ 215 public final native void setUrl(String url) /*-{ 216 this.url = url; 217 }-*/; 218 219 /** 220 * URL of the associated Google Place Page. 221 */ 222 public final native String getUrl() /*-{ 223 return this.url; 224 }-*/; 225 226 /** 227 * A fragment of the Place's address for disambiguation (usually street name and locality). 228 * @param vicinity 229 */ 230 public final native void setVicinity(String vicinity) /*-{ 231 this.vicinity = vicinity; 232 }-*/; 233 234 /** 235 * A fragment of the Place's address for disambiguation (usually street name and locality). 236 */ 237 public final native String getVicinity() /*-{ 238 return this.vicinity; 239 }-*/; 240 241 /** 242 * The authoritative website for this Place, such as a business' homepage. 243 * @param website 244 */ 245 public final native void setWebsite(String website) /*-{ 246 this.website = website; 247 }-*/; 248 249 /** 250 * The authoritative website for this Place, such as a business' homepage. 251 */ 252 public final native String getWebsite() /*-{ 253 return this.website; 254 }-*/; 255 256 }