diff --git a/README.md b/README.md index bff8d73..ad21095 100644 --- a/README.md +++ b/README.md @@ -51,3 +51,4 @@ Option | Default | Version | Description `callback` | - | v0.0.5 | any valid function as callback. By default internal callback is set and just pan the map to found position `autocomplete_options`| {} | v0.0.5 | default options for google autocomplete `collapsed_mode` | `false`:bool | v0.0.6 | if set to true, then just click-able icon will be displayed +`placeholder` | `null`:string | v0.0.7 | custom placeholder for input text diff --git a/src/js/leaflet-gplaces-autocomplete.js b/src/js/leaflet-gplaces-autocomplete.js index c3f9612..fca6803 100755 --- a/src/js/leaflet-gplaces-autocomplete.js +++ b/src/js/leaflet-gplaces-autocomplete.js @@ -6,6 +6,7 @@ position: "topright", prepend: true, collapsed_mode: false, + placeholder: null, autocomplete_options: {} }, @@ -33,6 +34,10 @@ this.searchBox = L.DomUtil.create("input", "leaflet-gac-control"); this.autocomplete = new google.maps.places.Autocomplete(this.searchBox, this.options.autocomplete_options); + if (this.options.placeholder) { + this.searchBox.setAttribute("placeholder", this.options.placeholder) + } + // if collapse mode set - create icon and register events if (this.options.collapsed_mode) { this.collapsedModeIsExpanded = false;