|
192 | 192 | [GmUtility.locationFromLatLng(context.location), context.radius, false]); |
193 | 193 | }); |
194 | 194 | }); |
195 | | - inputBinding.locationNameInput.on("change", function(e) { |
196 | | - if (!e.originalEvent) { return } |
197 | | - blur = true; |
198 | | - }); |
199 | | - inputBinding.locationNameInput.on("blur", function(e) { |
200 | | - if (!e.originalEvent) { return } |
201 | | - setTimeout(function() { |
202 | | - var address = $(inputBinding.locationNameInput).val(); |
203 | | - if (address.length > 5 && blur) { |
204 | | - blur = false; |
205 | | - gmapContext.geodecoder.geocode({'address': address}, function(results, status) { |
206 | | - if(status == google.maps.GeocoderStatus.OK && results && results.length) { |
207 | | - GmUtility.setPosition(gmapContext, results[0].geometry.location, function(context) { |
208 | | - updateInputValues(inputBinding, context); |
209 | | - context.settings.onchanged.apply(gmapContext.domContainer, |
210 | | - [GmUtility.locationFromLatLng(context.location), context.radius, false]); |
211 | | - }); |
212 | | - } |
213 | | - }); |
214 | | - } |
215 | | - }, 1000); |
216 | | - }); |
| 195 | + if(gmapContext.settings.enableAutocompleteBlur) { |
| 196 | + inputBinding.locationNameInput.on("change", function(e) { |
| 197 | + if (!e.originalEvent) { return } |
| 198 | + blur = true; |
| 199 | + }); |
| 200 | + inputBinding.locationNameInput.on("blur", function(e) { |
| 201 | + if (!e.originalEvent) { return } |
| 202 | + setTimeout(function() { |
| 203 | + var address = $(inputBinding.locationNameInput).val(); |
| 204 | + if (address.length > 5 && blur) { |
| 205 | + blur = false; |
| 206 | + gmapContext.geodecoder.geocode({'address': address}, function(results, status) { |
| 207 | + if(status == google.maps.GeocoderStatus.OK && results && results.length) { |
| 208 | + GmUtility.setPosition(gmapContext, results[0].geometry.location, function(context) { |
| 209 | + updateInputValues(inputBinding, context); |
| 210 | + context.settings.onchanged.apply(gmapContext.domContainer, |
| 211 | + [GmUtility.locationFromLatLng(context.location), context.radius, false]); |
| 212 | + }); |
| 213 | + } |
| 214 | + }); |
| 215 | + } |
| 216 | + }, 1000); |
| 217 | + }); |
| 218 | + } |
217 | 219 | } |
218 | 220 | if (inputBinding.latitudeInput) { |
219 | 221 | inputBinding.latitudeInput.on("change", function(e) { |
|
369 | 371 | locationNameInput: null |
370 | 372 | }, |
371 | 373 | enableAutocomplete: false, |
| 374 | + enableAutocompleteBlur: false, |
372 | 375 | enableReverseGeocode: true, |
373 | 376 | draggable: true, |
374 | 377 | onchanged: function(currentLocation, radius, isMarkerDropped) {}, |
|
0 commit comments