如何在ubilabs中获取formatted_address和其他的geocomplete?
我使用ubilabs geocomplete。
https://github.com/ubilabs/geocomplete
http://ubilabs.github.io/geocomplete/docs/
如何获取formatted_address和其他。
I对于get LAT和LNG,我使用以下代码:
$("#geocomplete").bind("geocode:dragged", function(event, latLng){
$("input[name=lat]").val(latLng.lat());
$("input[name=lng]").val(latLng.lng());
$("#reset").show();
});但我需要:
location
location_type
formatted_address
street_number
postal_code
locality
sublocality
country
country_short
administrative_area_level_1
place_id怎样才能用ubilabs的geocomplete?
发布于 2016-03-15 18:03:37
我也有同样的问题,我设法用下面的代码解决了它
$("#geocomplete").bind("geocode:dragged", function(event, latLng){
$("input[name=lat]").val(latLng.lat());
$("input[name=lng]").val(latLng.lng());
$("input[name=formatted_address]").geocomplete("find", latLng.lat() + "," + latLng.lng());
$("#reset").show();
});然后简单地把下面的输入放在你想要显示formatted_address的地方
<input name="formatted_address" type="text" value="">它在工作!
发布于 2014-11-24 22:27:19
在这里搜索"componentTypes“:http://ubilabs.github.io/geocomplete/docs/希望它有用
https://stackoverflow.com/questions/25766078
复制相似问题