V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
023yangbo

咨询高手 google 的 geocoding 写在函数里面的话,怎么才能够接收返回呢,还是用 promise,如果用 promise 怎么写代码呢

  •  
  •   023yangbo · Jan 18, 2016 · 1663 views
    This topic created in 3759 days ago, the information mentioned may be changed or developed.

    function division(e, f) {
    (new google.maps.Geocoder).geocode({
    location : {
    lat : e,
    lng : f
    }
    }, function(c, d) {
    console.log(c,d)
    //返回这里的结果
    }
    };
    想这样调用的话是肯定不行的
    var a=division(22,102)

    求高手帮下忙啊

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1037 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:57 · PVG 01:57 · LAX 10:57 · JFK 13:57
    ♥ Do have faith in what you're doing.