我正在尝试搜索州内的所有地方,我认为下面的网址可能有效,但遗憾的是,它甚至可能吗? https://maps.googleapis.com/maps/api/place/textsearch/json?query=kansas,usa&sensor=false&key=[insert key here]
答案 0 :(得分:0)
请参阅以下链接。
geocoder.geocode({ 'address': addresscity }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
latitude = results[0].geometry.location.lat();
longitude = results[0].geometry.location.lng();
document.getElementById("lat").value= latitude;
document.getElementById("lon").value= longitude;
var myLatlng = new google.maps.LatLng(latitude, longitude);
var mapOptions = {
center: new google.maps.LatLng(latitude, longitude),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
});