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
这个提交包含在:
父节点
6aa0e5dfcc
当前提交
6ef6680aaa
共有 1 个文件被更改,包括 15 次插入 和 16 次删除
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
正在加载…
在新工单中引用