Validate latitude and longitude

后端 未结 4 1347
鱼传尺愫
鱼传尺愫 2021-02-01 03:04

I want to validate the latitude and longitude. Right now, I check just so that the value is not empty, but I want a validation to check that it is a valid latidue or longitude.<

4条回答
  •  有刺的猬
    2021-02-01 03:06

    typically latitude/longitude are decimals, not a strings.

    Decimal degrees are an alternative to using degrees, minutes, and seconds (DMS). As with latitude and longitude, the values are bounded by ±90° and ±180° respectively. Positive latitudes are north of the equator, negative latitudes are south of the equator. Positive longitudes are east of Prime Meridian, negative longitudes are west of the Prime Meridian. Latitude and longitude are usually expressed in that sequence, latitude before longitude.

提交回复
热议问题