diff --git a/google-map-search.html b/google-map-search.html index daf1832..fa3529f 100644 --- a/google-map-search.html +++ b/google-map-search.html @@ -103,6 +103,20 @@

{{marker.name}}

value: null }, + /** + * Whether or not the search is in progress. + * This is set to true when the search begins and it is set to false when it completes. + * This will be updated to false before `google-map-search-results` is fired. + * + * When this is false, `results` has been set and is available. + */ + loading: { + type: Boolean, + value: false, + notify: true, + readOnly: true + }, + /** * The search results. */ @@ -157,6 +171,7 @@

{{marker.name}}

} else if (!this.globalSearch) { var bounds = this.map.getBounds(); } + this._setLoading( true ); places.textSearch({ query: this.query, types: types, @@ -195,6 +210,7 @@

{{marker.name}}

result.longitude = result.geometry.location.lng(); return result; }); + this._setLoading( false ); this.fire('google-map-search-results', this.results); }, diff --git a/test/google-map-search.html b/test/google-map-search.html new file mode 100644 index 0000000..9a3d02d --- /dev/null +++ b/test/google-map-search.html @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + diff --git a/test/index.html b/test/index.html index 7ee5222..f7f2d6c 100644 --- a/test/index.html +++ b/test/index.html @@ -12,6 +12,7 @@ WCT.loadSuites([ 'google-map-basic.html', 'google-map-update-pos.html', + 'google-map-search.html', 'marker-basic.html', 'markers-add-remove.html', 'markers-add-remove.html?dom=shadow',