If I get the lon and lat of a Point by Google maps or bing maps API, what are the maximum and minimum valid values for that variables?
I want to check some user Input before storing lon and lat into a database.
Assuming, those values correspond to longitude and latitude:
The longitude is between -180° to 180° and the latitude between -90° and 90°.
I think you will find that it is the earth, or rather human conventions in mathematics that defined a circle to have 360 degrees, that define the maximum and minimum of latitude and longitude. Latitude ranges from -90 to 90 and longitude from -180 to 180.
However, in web mapping there is often a lot of confusion about coordinate systems. Google maps use something called web mercator which is a projected coordinate system, ie, in meters, with the assumption of a spherical earth.
EDIT: Yes, Bing also uses Web Mercator to represent position on the earth, also known as EPSG 900913 or 3857 in official designation. My personal view is that the Google Maps api is nicer to use and the quality of the mapping is higher, especially now that they have introduced vector-based tiles.
A big issue to be aware of, which I cannot advise on, with both Google and Bing, is over the ownership of derived data -- ie, there are legal considerations as well as technical considerations.
I use a library called OpenLayers which is a very fully featured mapping API, but does not come with any built in mapping -- so you either have to provide your own wms or use somehthing like Open Street Map (which is extremely good in most developed parts of the world, but somewhat lacking elsewhere). There are other options, such as, Leaflet which are slightly lighter-weight than OpenLayers, but will suffice for many needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With