|
188 | 188 | if (inputBinding) { |
189 | 189 | if (inputBinding.radiusInput){ |
190 | 190 | inputBinding.radiusInput.on("change", function(e) { |
191 | | - if (!e.originalEvent) { return } |
192 | | - gmapContext.radius = $(this).val(); |
| 191 | + var radiusInputValue = $(this).val(); |
| 192 | + if (!e.originalEvent || isNaN(radiusInputValue)) { return } |
| 193 | + gmapContext.radius = radiusInputValue; |
193 | 194 | GmUtility.setPosition(gmapContext, gmapContext.location, function(context){ |
194 | 195 | context.settings.onchanged.apply(gmapContext.domContainer, |
195 | 196 | [GmUtility.locationFromLatLng(context.location), context.radius, false]); |
|
239 | 240 | } |
240 | 241 | if (inputBinding.latitudeInput) { |
241 | 242 | inputBinding.latitudeInput.on("change", function(e) { |
242 | | - if (!e.originalEvent) { return } |
243 | | - GmUtility.setPosition(gmapContext, new google.maps.LatLng($(this).val(), gmapContext.location.lng()), function(context){ |
244 | | - context.settings.onchanged.apply(gmapContext.domContainer, |
| 243 | + var latitudeInputValue = $(this).val(); |
| 244 | + if (!e.originalEvent || isNaN(latitudeInputValue) ) { return } |
| 245 | + GmUtility.setPosition(gmapContext, new google.maps.LatLng(latitudeInputValue, gmapContext.location.lng()), function(context){ context.settings.onchanged.apply(gmapContext.domContainer, |
245 | 246 | [GmUtility.locationFromLatLng(context.location), context.radius, false]); |
246 | 247 | updateInputValues(gmapContext.settings.inputBinding, gmapContext); |
247 | 248 | }); |
248 | 249 | }); |
249 | 250 | } |
250 | 251 | if (inputBinding.longitudeInput) { |
251 | 252 | inputBinding.longitudeInput.on("change", function(e) { |
252 | | - if (!e.originalEvent) { return } |
253 | | - GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.location.lat(), $(this).val()), function(context){ |
| 253 | + var longitudeInputValue = $(this).val(); |
| 254 | + if (!e.originalEvent || isNaN(longitudeInputValue) ) { return } |
| 255 | + GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.location.lat(), longitudeInputValue), function(context){ |
254 | 256 | context.settings.onchanged.apply(gmapContext.domContainer, |
255 | 257 | [GmUtility.locationFromLatLng(context.location), context.radius, false]); |
256 | 258 | updateInputValues(gmapContext.settings.inputBinding, gmapContext); |
|
0 commit comments