get current latitude and longitude from gps enabled device
问题 I would like to get the latitude and longitude of current location from gps enabled mobile device right from the web browser. May I know is this possible? how to do it? does it require geolocation api? Some coding example would be helpful. Thanks. 回答1: Use the HTML5 Geolocation API, here's the official spec and examples. EDIT I've updated my answer to include current browser support. W3C Geolocation API support Firefox 3.5+ Safari 5.0+ Chrome 5.0+ Opera iPhone 3.0+ Android 2.0+ · · Other