diff --git a/src/services/dms-deg/index.html b/src/services/dms-deg/index.html new file mode 100644 index 0000000..c5ae558 --- /dev/null +++ b/src/services/dms-deg/index.html @@ -0,0 +1,86 @@ + + + + + + DMS - Decimal Degree Converter + + + + + +
+
+

Degrees Minutes Seconds - Decimal Degree Converter

+ + + + + + + + +
+ Latitude + + ° + ' + '' + +
+ Longitude + + ° + ' + '' + +
+ +

Output

+
+ + content_copy +
+ +
+
+ + \ No newline at end of file diff --git a/src/services/dms-deg/index.js b/src/services/dms-deg/index.js new file mode 100644 index 0000000..228357d --- /dev/null +++ b/src/services/dms-deg/index.js @@ -0,0 +1,47 @@ +const degLat = document.getElementById( 'deg-lat' ); +const minLat = document.getElementById( 'min-lat' ); +const secLat = document.getElementById( 'sec-lat' ); +const latitude = document.getElementById( 'lat' ); +const degLong = document.getElementById( 'deg-long' ); +const minLong = document.getElementById( 'min-long' ); +const secLong = document.getElementById( 'sec-long' ); +const longitude = document.getElementById( 'long' ); + +const output = document.getElementById( 'out' ); + + +var convertDMSDecimal = () => { + let long = 0; + let lat = 0; + if ( !isNaN( degLat.value ) && !isNaN( minLat.value ) && !isNaN( secLat.value ) && !isNaN( degLong.value ) && !isNaN( minLong.value ) && !isNaN( secLong.value ) ) { + try { + // calculate latitude + lat = Math.round( ( parseInt( degLat.value ) + parseInt( minLat.value ) / 60 + parseFloat( secLat.value ) / 6000 ) * 100000 ) / 100000; + + // calculate longitude + long = Math.round( ( parseInt( degLong.value ) + parseInt( minLong.value ) / 60 + parseFloat( secLong.value ) / 6000 ) * 100000 ) / 100000; + } catch ( err ) { + console.error( err ); + alert( 'An error occurred whilst calculating. Please ensure that degrees & minutes are entered as whole numbers' ); + } + output.value = String( lat ) + latitude.value + ' ' + String( long ) + longitude.value; + } else { + alert( 'Invalid input. Please ensure that all input fields only contain numbers!' ); + } +} + +var copy = () => { + navigator.clipboard.writeText( output.value ); +} + + +var clearApp = () => { + degLat.value = ''; + minLat.value = ''; + secLat.value = ''; + degLong.value = ''; + minLong.value = ''; + secLong.value = ''; + latitude.value = 'N'; + longitude.value = 'W'; +} \ No newline at end of file diff --git a/src/sitemap.xml b/src/sitemap.xml index c04304f..41f6d43 100644 --- a/src/sitemap.xml +++ b/src/sitemap.xml @@ -11,22 +11,7 @@ 2024-05-20 - https://www.janishutz.com/legal/privacy - 0.67 - 2024-05-20 - - - https://www.janishutz.com/about - 0.67 - 2024-05-20 - - - https://www.janishutz.com/presentations - 0.67 - 2024-05-20 - - - https://www.janishutz.com/projects + https://www.janishutz.com/support 0.67 2024-05-20 @@ -36,17 +21,42 @@ 2024-05-20 - https://www.janishutz.com/support + https://www.janishutz.com/projects 0.67 2024-05-20 - https://www.janishutz.com/legal/licenses - 0.50 + https://www.janishutz.com/presentations + 0.67 2024-05-20 - https://www.janishutz.com/projects/arch-dev-vm + https://www.janishutz.com/about + 0.67 + 2024-05-20 + + + https://www.janishutz.com/legal/privacy + 0.67 + 2024-05-20 + + + https://www.janishutz.com/services/dms-deg + 0.50 + 2024-06-14 + + + https://www.janishutz.com/projects/store + 0.50 + 2024-06-05 + + + https://www.janishutz.com/legal/returns + 0.50 + 2024-06-04 + + + https://www.janishutz.com/legal/tos 0.50 2024-05-20 @@ -56,62 +66,22 @@ 2024-05-20 - https://www.janishutz.com/legal/tos + https://www.janishutz.com/projects/arch-dev-vm 0.50 2024-05-20 - https://www.janishutz.com/legal/returns + https://www.janishutz.com/legal/licenses 0.50 - 2024-06-04 + 2024-05-20 - https://www.janishutz.com/projects/store - 0.50 - 2024-06-05 - - - https://www.janishutz.com/about/aboutme + https://www.janishutz.com/support/js-disabled 0.33 2024-05-20 - https://www.janishutz.com/presentations/auth - 0.33 - 2024-05-20 - - - https://www.janishutz.com/projects/impress - 0.33 - 2024-04-30 - - - https://www.janishutz.com/projects/languageschoolhossegor-booking - 0.33 - 2024-04-30 - - - https://www.janishutz.com/projects/libreevent - 0.33 - 2024-05-20 - - - https://www.janishutz.com/projects/musicplayer - 0.33 - 2024-05-20 - - - https://www.janishutz.com/projects/qrscanner - 0.33 - 2024-04-30 - - - https://www.janishutz.com/projects/schoolprojects - 0.33 - 2024-04-30 - - - https://www.janishutz.com/projects/smuL + https://www.janishutz.com/support/contact 0.33 2024-05-20 @@ -121,18 +91,48 @@ 2024-04-30 - https://www.janishutz.com/support/contact + https://www.janishutz.com/projects/smuL 0.33 2024-05-20 - https://www.janishutz.com/support/js-disabled + https://www.janishutz.com/projects/schoolprojects + 0.33 + 2024-04-30 + + + https://www.janishutz.com/projects/qrscanner + 0.33 + 2024-04-30 + + + https://www.janishutz.com/projects/musicplayer 0.33 2024-05-20 - https://www.janishutz.com/legal/licences/proprietary - 0.25 + https://www.janishutz.com/projects/libreevent + 0.33 + 2024-05-20 + + + https://www.janishutz.com/projects/languageschoolhossegor-booking + 0.33 + 2024-04-30 + + + https://www.janishutz.com/projects/impress + 0.33 + 2024-04-30 + + + https://www.janishutz.com/presentations/auth + 0.33 + 2024-05-20 + + + https://www.janishutz.com/about/aboutme + 0.33 2024-05-20 @@ -140,6 +140,11 @@ 0.25 2024-05-20 + + https://www.janishutz.com/legal/licences/proprietary + 0.25 + 2024-05-20 + https://www.janishutz.com/legal/privacy/v1 0.00