You can indeed use a library like Javascript GeoPoint Library, but such a conversion is rather easy to implement. Furthermore, the mentioned library expects you to already know which value is latitude (northing) and which one is longitude (easting), which may not be the case if your input is "N44°49'43.15 / W000°42'55.24''"
as you suggest.
Building on Converting latitude and longitude to decimal values, we can easily make a specific conversion utility that should fit your case:
var input = "N44°49'43.15 / W000°42'55.24''";
function parseDMS(input) {
var halves = input.split('/'); // Separate northing from easting.
return { // Ready to be fed into Leaflet.
lat: parseDMSsingle(halves[0].trim()),
lng: parseDMSsingle(halves[1].trim())
};
}
function parseDMSsingle(input) {
var direction = input[0]; // First char is direction (N, E, S or W).
input = input.substr(1);
var parts = input.split(/[^\d\w.]+/);
// 0: degrees, 1: minutes, 2: seconds; each can have decimals.
return convertDMSToDD(
parseFloat(parts[0]) || 0, // Accept missing value.
parseFloat(parts[1]) || 0,
parseFloat(parts[2]) || 0,
direction
);
}
function convertDMSToDD(degrees, minutes, seconds, direction) {
var dd = degrees + minutes/60 + seconds/(60*60);
if (direction == "S" || direction == "W") {
dd = dd * -1;
} // Don't do anything for N or E
return dd;
}
console.log(input);
console.log(parseDMS(input));