File tree Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ L.Control.geocoder(options);
114
114
| ` showResultIcons ` | Boolean | ` false ` | Show icons for geocoding results (if available); supported by Nominatim |
115
115
| ` suggestMinLength ` | Number | ` 3 ` | Minimum number characters before suggest functionality is used (if available from geocoder) |
116
116
| ` suggestTimeout ` | Number | ` 250 ` | Number of milliseconds after typing stopped before suggest functionality is used (if available from geocoder) |
117
+ | ` query ` | String | ` "" ` | Initial query string for text input |
117
118
| ` queryMinLength ` | Number | ` 1 ` | Minimum number of characters in search text before performing a query |
118
119
119
120
### Methods
Original file line number Diff line number Diff line change 45
45
}
46
46
47
47
var control = L . Control . geocoder ( {
48
+ query : 'Moon' ,
49
+ placeholder : 'Search here...' ,
48
50
geocoder : geocoder
49
51
} ) . addTo ( map ) ;
50
52
var marker ;
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export var Geocoder = L.Control.extend({
52
52
53
53
input = this . _input = L . DomUtil . create ( 'input' , '' , form ) ;
54
54
input . type = 'text' ;
55
+ input . value = this . options . query || '' ;
55
56
input . placeholder = this . options . placeholder ;
56
57
L . DomEvent . disableClickPropagation ( input ) ;
57
58
You can’t perform that action at this time.
0 commit comments