【问题标题】:How do I get the Google Autofill to return positional information如何让 Google 自动填充返回位置信息
【发布时间】:2015-10-10 08:35:28
【问题描述】:

我正在使用 google address api 来自动填充地址表单。我真正想要的只是纬度和经度。 api 调用正在运行,并为我提供了地址组件。我如何让它给我经纬度?

我找不到任何关于它可以返回哪些其他组件的文档。这是选项部分

var componentForm = {
  street_number: 'short_name',
  route: 'long_name',
  locality: 'long_name',
  administrative_area_level_1: 'short_name',
  country: 'long_name',
  postal_code: 'short_name'
};

这是我使用的表单和代码https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform

【问题讨论】:

    标签: html google-maps-api-3 geolocation


    【解决方案1】:

    你在寻找类似的东西吗?

    http://codepen.io/algib/pen/Kpxzpy

    你有没有考虑打电话

    place.geometry.location.lat();
    place.geometry.location.lng();
    

    【讨论】:

    • 太棒了!祝你的项目好运!
    猜你喜欢
    • 1970-01-01
    • 2012-04-27
    • 2015-09-17
    • 2014-03-28
    • 2015-06-15
    • 2019-02-04
    • 1970-01-01
    • 2013-02-10
    • 2017-07-14
    相关资源
    最近更新 更多