From 8dd2f045c42bcd88f84412949826fa786a699398 Mon Sep 17 00:00:00 2001 From: David Hudlow Date: Mon, 25 Apr 2016 20:07:18 -0500 Subject: [PATCH 1/2] Add type parameter to google-map-search --- google-map-search.html | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/google-map-search.html b/google-map-search.html index cd9a234..e8aa7a9 100644 --- a/google-map-search.html +++ b/google-map-search.html @@ -94,6 +94,16 @@

{{marker.name}}

}, /** + * @deprecated + * + * 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 @@ -105,6 +115,18 @@

{{marker.name}}

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 From f293bd3e8d8cdfbf308121a8421453c0e48672bf Mon Sep 17 00:00:00 2001 From: David Hudlow Date: Wed, 15 Jun 2016 06:51:22 -0500 Subject: [PATCH 2/2] Move deprecated note --- google-map-search.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-map-search.html b/google-map-search.html index e8aa7a9..510cf68 100644 --- a/google-map-search.html +++ b/google-map-search.html @@ -94,8 +94,6 @@

{{marker.name}}

}, /** - * @deprecated - * * 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 @@ -109,6 +107,8 @@

{{marker.name}}

* 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,