Open mbridak opened 6 months ago
yah, I agree, or calculate gridsquare from lat/lon, or both.
Is anyone here smart enough to write java script that would auto-populate the gridsquare field as the user enters the lat/lon? i'm not the javascript guy
Something like:
function latlonToMaiden(lat, lon)
{
// This is assuming lat and lon have been parsed with parseFloat() from user input
lon += 180;
lat += 90;
var longitude = Math.floor(lon/20);
var latitude = Math.floor(lat/10);
var maiden = String.fromCharCode(65 + longitude) + String.fromCharCode(65 + latitude);
var square_lon = Math.floor((lon - 20*longitude)/2);
var square_lat = Math.floor(lat - 10*latitude);
maiden += square_lon.toString() + square_lat.toString();
var subsquare_longitude = Math.floor(12*(lon - 20*longitude - 2*square_lon))
var subsquare_latitude = Math.floor(24*(lat - 10*latitude - square_lat))
maiden += String.fromCharCode(97 + subsquare_longitude) + String.fromCharCode(97 + subsquare_latitude)
return maiden;
}
I'm just assuming this works. Found in one of my old projects.
Hello Sir, I believe it would be a nicer on-boarding experience if the initial configuration screen had an option to enter the users grid square and have the latitude and longitude calculated for them.
Something like:
Since most people know their gridsquare, this maybe useful.
Cheers! Mike K6GTE