Navigator. Geolocation

Source: Internet
Author: User

 

51815467

Positionoptions: JSON object that listens to device location information Parameters

Navigator. geolocation. getcurrentposition ( Function  (Position) {alert ( 'Latitude '+ Position. coords. Latitude )},  Function  () {Alert ( 'Error' )}, {Enablehighaccuracy:  True , // Whether to obtain high-precision longitude and latitude. The default value is false. Timeout: 5000, //  Timeout time for obtaining location information. Unit: Millisecond (MS), default is not time-out Maximumage: 0, //  The cache time for obtaining location information. Unit: milliseconds (MS), default value: 0 (get updated immediately ). If the location information cached by the device exceeds the specified cache time, the location information will be updated and then returned. Provider: /*  (String type) the positioning module is preferred. The following providers are recommended: "system": system positioning module. The WGS84 coordinate system is supported. "Baidu": Baidu positioning module. gcj02/bd09/bd09ll coordinate system is supported. "AMAP ": it indicates the AMAP positioning template and supports the gcj02 coordinate system. The default value is obtained first (AMAP> Baidu> system). If the specified provider does not exist or is invalid, an error callback is returned. Note: Baidu/autonavi positioning module must be configured with parameters related to Baidu/autonavi maps for normal use. The Platform supports Android-2.2 + (supported), iOS-4.5 + (supported): When the provider is "Baidu", only the bd09ll coordinate system is supported, and the AMAP positioning module is not currently supported.  */ Coordstype:  /*  (String type) specifies the type of the retrieved positioning data coordinate system. Take the following coordinate system type: "WGS84": represents the WGS-84 coordinate system; "gcj02": represents the national test Bureau latitude and longitude coordinate system; "bd09": represents Baidu mocato coordinate system; "bd09ll ": the coordinate system of Baidu longitude and latitude. When the provider is "system", the "WGS84" type is used by default. If the provider is "Baidu", the "bd09ll" type is used by default. If the specified coordinate system type provider is not supported, an error is returned.  */  Geocode:  /*  (Boolean Type) Whether to parse the address information. The resolved address information is saved to the address and addresses attributes of the position object. True indicates that the address information is parsed. False indicates that the address information is not parsed. The returned value of the address and addresses attribute of the position object is undefined, the default value is true. If the address information fails to be parsed, the returned position object's address and addresses attribute values are null.  */  }); 

 

navigator. geolocation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.