diff --git a/google-map-search.html b/google-map-search.html
index cd9a234..510cf68 100644
--- a/google-map-search.html
+++ b/google-map-search.html
@@ -94,17 +94,39 @@
{{marker.name}}
},
/**
+ * Warning: The implementation for types in text search requests is changing. The types parameter is deprecated
+ * as of February 16, 2016, replaced by a new type parameter which only supports one type per search request.
+ * Additionally, the establishment, place_of_worship, food, health, general_contractor and finance types will
+ * no longer be supported as search parameters (however these types may still be returned in the results of a
+ * search). Requests using the deprecated features will be supported until February 16, 2017, after which all
+ * text searches must use the new implementation.
+ * See https://developers.google.com/maps/documentation/javascript/places
+ *
* Space-separated list of result types.
* The search will only return results of the listed types.
* See https://developers.google.com/places/documentation/supported_types
* for a list of supported types.
* Leave empty or null to search for all result types.
+ *
+ * @deprecated
*/
types: {
type: String,
value: null
},
+ /**
+ * Search result type
+ * The search will only return results of the listed type.
+ * See https://developers.google.com/places/documentation/supported_types
+ * for a list of supported types.
+ * Leave empty or null to search for all result types.
+ */
+ type: {
+ type: String,
+ value: null
+ },
+
/**
* The search results.
*/
@@ -147,13 +169,18 @@ {{marker.name}}
* Perform a search using for `query` for the search term.
*/
search: function() {
- if (this.query && this.map) {
+ if (this.map && (this.query || this.type)) {
var places = new google.maps.places.PlacesService(this.map);
if (this.types && typeof this.types == 'string') {
var types = this.types.split(' ');
}
+ if (this.type && typeof this.type == 'string') {
+ var typeArray = this.type.split(' ');
+ var type = typeArray[0];
+ }
+
if (!this.globalSearch) {
var bounds = this.map.getBounds();
} else if (this.radius) {
@@ -164,6 +191,7 @@ {{marker.name}}
places.textSearch({
query: this.query,
types: types,
+ type: type,
bounds: bounds,
radius: radius,
location: location