Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: polymer_1.0.4/bower_components/google-map/google-map-search.html

Issue 1205703007: Add polymer 1.0 to npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Renamed folder to 1.0.4 Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: polymer_1.0.4/bower_components/google-map/google-map-search.html
diff --git a/polymer_1.0.4/bower_components/google-map/google-map-search.html b/polymer_1.0.4/bower_components/google-map/google-map-search.html
new file mode 100644
index 0000000000000000000000000000000000000000..a27947af5627801f61b5c5b705cbe2ad5d1e37b5
--- /dev/null
+++ b/polymer_1.0.4/bower_components/google-map/google-map-search.html
@@ -0,0 +1,92 @@
+<!-- Copyright (c) 2015 Google Inc. All rights reserved. -->
+
+<link rel="import" href="../polymer/polymer.html">
+
+
+<script>
+/**
+Provides Google Maps Places API functionality.
+
+See https://developers.google.com/maps/documentation/javascript/places for more
+information on the API.
+
+#### Example:
+
+ <template is="dom-bind">
+ <google-map-search map="{{map}}" query="Pizza"
+ result="{{result}}"></google-map-search>
+ <google-map map="{{map}}" latitude="37.779"
+ longitude="-122.3892"></google-map>
+ <div>Result:
+ <span>{{result.latitude}}</span>,
+ <span>{{result.longitude}}</span>
+ </div>
+ </template>
+ <script>
+ document.querySelector('google-map-search').search();
+ < /script>
+
+*/
+ Polymer({
+
+ is: 'google-map-search',
+
+/**
+Fired when the search element returns a result.
+
+@event google-map-search-result
+@param {Object} detail
+ @param {number} detail.latitude Latitude of the result.
+ @param {number} detail.longitude Longitude of the result.
+ @param {bool} detail.show Whether to show the result on the map.
+*/
+ properties: {
+ /**
+ * The Google map object.
+ */
+ map: {
+ type: Object,
+ value: null
+ },
+ /**
+ * The search query.
+ */
+ query: {
+ type: String,
+ value: null
+ },
+
+ /**
+ * The search result.
+ */
+ result: {
+ type: Object,
+ value: null,
+ notify: true
+ }
+ },
+
+ observers: [
+ 'search(query,map)'
+ ],
+
+ /**
+ * Performance a search using for `query` for the search term.
+ */
+ search: function() {
+ if (this.query && this.map) {
+ var places = new google.maps.places.PlacesService(this.map);
+ places.textSearch({query: this.query}, this._gotResults.bind(this));
+ }
+ },
+
+ _gotResults: function(results, status) {
+ this.result = {
+ latitude: results[0].geometry.location.lat(),
+ longitude: results[0].geometry.location.lng(),
+ show: true
+ }
+ this.fire('google-map-search-result', this.result);
+ }
+ });
+</script>
« no previous file with comments | « polymer_1.0.4/bower_components/google-map/google-map-marker.html ('k') | polymer_1.0.4/bower_components/google-map/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698