【发布时间】:2013-12-30 04:20:22
【问题描述】:
目前,我们的系统从指定位置的某个区域带回列表。因此,如果我输入邮政编码,它将使用边界并带回本地列表。这很好用。
但是,如果我搜索“Newcastle”,它将默认为 Newcastle Tyneside 而不是 Lyme 下的 Newcastle。
有没有办法告诉地图 API 不使用它认为是“默认”的任何东西并从所有位置带回列表?
以下是我用来对地址进行地理编码的基本脚本:
var address = "<?php echo $_GET['place']." UK";?>";
///set map center position and place marker
geocoder.geocode( { 'address': address}, function(results, status) {
///set center position
map.setCenter(results[0].geometry.location);
circ = new google.maps.Circle();
circ.setCenter(results[0].geometry.location);
circ.setRadius(miles * 1609.0);
map.fitBounds(circ.getBounds());
circ.setMap(map);
// Set co-ordinates of address
var addresslong = results[0].geometry.location.lat();
var addresslat = results[0].geometry.location.lng();
var addresslatlng = new google.maps.LatLng(addresslong, addresslat);
placeMarkers(addresslatlng);
任何帮助或建议将不胜感激。
【问题讨论】:
标签: google-maps