How to get the return value of JSAPI in JSSDK in micro-credit development

Source: Internet
Author: User
Keywords PHP Micro-mail
Php


var getLocation = document.getElementById (' getLocation ');
Getlocation.onclick = function () {

                //使用getLocation接口获取地理位置坐标                                    wx.getLocation({                    success:function(res){                        var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90                                                    var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。                        var speed = res.speed; // 速度,以米/每秒计                        var accuracy = res.accuracy; // 位置精度                        alert(JSON.stringify(res));                    },                    cancel:function(res){                        alert('用户拒绝授权获取地理位置');                    },                });            };
  • Related Article

    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.