V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
AlanZhang
V2EX  ›  问与答

Google Map 的 API,用的是固定的版本 3.14,为什么接口会经常变化

  •  
  •   AlanZhang · 2014-11-28 11:19:11 +08:00 · 2377 次点击
    这是一个创建于 3436 天前的主题,其中的信息可能已经有所发展或是发生改变。
    比如下面代码中的new_location.k 和new_location.B今年都已经改了好几次了(比如需要改成new_location.A)

    google.maps.event.addListener(marker, 'dragend', function() {
    var new_location=marker.getPosition();
    // console.log(new_location);
    $("#x").attr("value",new_location.k);
    $("#y").attr("value",new_location.B);
    });
    2 条回复    2014-11-28 15:40:31 +08:00
    aliuwr
        1
    aliuwr  
       2014-11-28 13:57:31 +08:00   ❤️ 1
    你看文档了吗? 不会是看 new_location 里有什么字段, 然后猜测哪个是想要的内容吧?

    https://developers.google.com/maps/documentation/javascript/reference#LatLng
    lat() Returns the latitude in degrees.
    lng() Returns the longitude in degrees.
    AlanZhang
        2
    AlanZhang  
    OP
       2014-11-28 15:40:31 +08:00
    @aliuwr 多谢,知道咋改了。没看文档。因为只是一个小bug,经纬度获取有错误,看是B就写B,是A就用A,哪里知道变来变去的。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   985 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:00 · PVG 05:00 · LAX 14:00 · JFK 17:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.