The read-only Longitude property of the GeolocationCoordinates interface is a double-precision floating-point value that represents the longitude of the location in decimal degrees.
The GeolocationCooperatives object is a component of the GeolocationPosition interface because it is the type of object provided by Geolocation API calls that capture a geographic location and provide it with a DOMTimeStamp that provides the measurement time.
navigator.geolocation.getCurrentPosition(success, error, options);
Parameters − It contains three parameters, which are listed below and are detailed above:
- success − This is a function that is used when the data from the getCurrentPosition() API method has been successfully collected.
- error − It also includes a callback function that sends back the location’s warnings and errors.
- options − Setting a timer, enabling High Accuracy, and the maximumAge is helpful.
Difference between latitude and longitude
Latitude and Longitude are known as geographical coordinates, which offer a systematic network of lines. They help determine the location, distance, and direction of various points on the Earth.
|The geographic coordinates that indicate the distance of a location north-south of the equator are referred to as latitude.||Longitude refers to a geographic coordinate that indicates a point’s east-west distance from the Prime Meridian.|
|It’s referred to as parallelism.||It’s referred to as meridians|
|The lines are of various lengths.||The lines are all the same length.|
|It divides the world into heat zones.||It is used to categorise time zones.|
|There are 180 lines of latitude.||There are 360 lines of longitude.|
Frequently Asked Questions
What is latitude and longitude
Both longitude and latitude are angles measured with the center of the earth as an origin. A longitude is an angle from the prime merdian, measured to the east (longitudes to the west are negative). Latitudes measure an angle up from the equator (latitudes to the south are negative).
Latitude and Longitude of India
20.5937° N, 78.9629° E
You can always support by sharing on social media or recommending my blog to your friends and colleagues. If you have any suggestions or problems about this tutorial, please comment on the form below.😊