When typing a gridsquare in the field on the QSO page it will only get bearing and when the field has 4 chars saves useless calculation

这个提交包含在:
Peter Goodhall 2019-06-24 16:02:02 +01:00
父节点 6aa0e5dfcc
当前提交 6ef6680aaa

查看文件

@ -345,23 +345,22 @@ $(document).ready(function(){
/* On Key up Calculate Bearing and Distance */ /* On Key up Calculate Bearing and Distance */
$("#locator").keyup(function(){ $("#locator").keyup(function(){
if ($(this).val()) { if ($(this).val()) {
$.getJSON('logbook/qralatlngjson/' + $(this).val(), function(result) var qra_input = $(this).val();
{
console.log(result[0]);
// Set Map to Lat/Long if(qra_input.length > 3) {
markers.clearLayers(); $.getJSON('logbook/qralatlngjson/' + $(this).val(), function(result)
if (typeof result !== "undefined") { {
console.log("defined!"); // Set Map to Lat/Long
var marker = L.marker([result[0], result[1]]); markers.clearLayers();
mymap.setView([result[0], result[1]], 8); if (typeof result !== "undefined") {
} var marker = L.marker([result[0], result[1]]);
mymap.setView([result[0], result[1]], 8);
markers.addLayer(marker).addTo(mymap); }
markers.addLayer(marker).addTo(mymap);
}) })
$('#locator_info').load("logbook/searchbearing/" + $(this).val()).fadeIn("slow"); $('#locator_info').load("logbook/searchbearing/" + $(this).val()).fadeIn("slow");
}
} }
}); });