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 */
$("#locator").keyup(function(){
if ($(this).val()) {
$.getJSON('logbook/qralatlngjson/' + $(this).val(), function(result)
{
console.log(result[0]);
var qra_input = $(this).val();
// Set Map to Lat/Long
markers.clearLayers();
if (typeof result !== "undefined") {
console.log("defined!");
var marker = L.marker([result[0], result[1]]);
mymap.setView([result[0], result[1]], 8);
}
markers.addLayer(marker).addTo(mymap);
})
$('#locator_info').load("logbook/searchbearing/" + $(this).val()).fadeIn("slow");
if(qra_input.length > 3) {
$.getJSON('logbook/qralatlngjson/' + $(this).val(), function(result)
{
// Set Map to Lat/Long
markers.clearLayers();
if (typeof result !== "undefined") {
var marker = L.marker([result[0], result[1]]);
mymap.setView([result[0], result[1]], 8);
}
markers.addLayer(marker).addTo(mymap);
})
$('#locator_info').load("logbook/searchbearing/" + $(this).val()).fadeIn("slow");
}
}
});