-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
230 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<!doctype html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<script src="bg/action.ts" type="module"></script> | ||
<script src="bg/bg.ts" type="module"></script> | ||
<script src="bg/action.js" type="module"></script> | ||
<script src="bg/bg.js" type="module"></script> | ||
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Domain ends of google | ||
export const domainEnds: string[] = [ | ||
export const domainEnds = [ | ||
'com', | ||
'ac', | ||
'ad', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Converts DMS coordinates to Lat and Lon | ||
* @param {string} input String containing DMS coordinates | ||
* @returns {[number, number]} Array containing Latitude and Longitude | ||
*/ | ||
export function parseDMS(input) { | ||
/** @type {string[]} */ | ||
const parts = input.split(/[^\d\w\.]+/) | ||
const lat = convertDMSToDD(parts.slice(0, 4)) | ||
const lon = convertDMSToDD(parts.slice(4)) | ||
|
||
return [lat, lon] | ||
} | ||
/** | ||
* Converts DMS part to Lat/Lon | ||
* @param {string[]} dms Array of four strings representing: Degree Minutes Seconds Direction | ||
* @returns {number} DMS part converted to Latitude / Longitude | ||
*/ | ||
function convertDMSToDD(dms) { | ||
const [degrees, minutes, seconds, direction] = dms | ||
let dd = Number(degrees) + Number(minutes) / 60 + Number(seconds) / (60 * 60) | ||
|
||
if (direction === 'S' || direction === 'W') { | ||
dd = dd * -1 | ||
} // Don't do anything for N or E | ||
return dd | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.