File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 74
74
tr = L . DomUtil . create ( 'tr' , '' , this . _resultTable ) ;
75
75
tr . setAttribute ( 'data-result-index' , i ) ;
76
76
td = L . DomUtil . create ( 'td' , '' , tr ) ;
77
- text = document . createTextNode ( results [ i ] . name ) ;
77
+
78
+ if ( this . options . formatGeocoderResult ) {
79
+ text = this . options . formatGeocoderResult ( results [ i ] ) ;
80
+ } else {
81
+ text = document . createTextNode ( results [ i ] . name ) ;
82
+ }
83
+
78
84
td . appendChild ( text ) ;
79
85
// mousedown + click because:
80
86
// http://stackoverflow.com/questions/10652852/jquery-fire-click-before-blur-event
Original file line number Diff line number Diff line change 85
85
} , this ) ;
86
86
}
87
87
88
+ if ( typeof this . options . formatGeocoderResult == 'function' ) {
89
+ this . options . autocompleteOptions . formatGeocoderResult = this . options . formatGeocoderResult ;
90
+ }
91
+
88
92
new Autocomplete ( geocoderInput , function ( r ) {
89
93
geocoderInput . value = r . name ;
90
94
wp . name = r . name ;
You can’t perform that action at this time.
0 commit comments