How to validate Latitude and Longitude value

2653
validate latitude and longitude c# image

Validation for latitude and longitude values

Latitude and longitude are basic geographic terms that determine location coordinate of any place located on earth. They are similar to the fingerprint and just like two people cannot have the same fingerprint, two different geographic locations cannot ever share common coordinates. This article demonstrates how to validate latitude and longitude value in JavaScript C# ASP.Net.

  • Latitude: Latitude is a geographic coordinate that specifies the north-south position of a point on the Earth.
  • Longitude: latitude is a geographic coordinate that specifies the east-west position of a point on the Earth.
  • Altitude: it is the height of the object from sea level

To implement validation for latitude and longitude values we can write a logic that, latitude must be a number between -90 and 90 and the longitude between -180 and 180 degree inclusive.

  • Validate latitude and longitude JavaScript

In this example, we will learn latitude and longitude validation in JavaScript. Find the code snippet below:-

  • Validate Latitude and Longitude C#

In this example, we will learn latitude and longitude validation in C# asp.net. Find the below source code:-

Output

validation for latitude and longitude values demo image validate latitude and longitude How to validate Latitude and Longitude value validation for latitude and longitude values demo

Download Code

What do you think?

I hope you liked this article. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.

LEAVE A REPLY

Please enter your comment!
Please enter your name here