2012-03-16 2 views
0

현재 Google 시스템은 지정된 위치의 지역 정보를 다시 가져옵니다. 따라서 우편 번호를 입력하면 범위를 사용하고 지역 목록을 가져옵니다. 이것은 잘 작동합니다.Google Maps API - 일치하는 모든 위치에서 결과 가져 오기

그러나 'Newcastle'을 검색하면 Lyme의 Newcastle보다는 Newcastle Tyneside가 기본값이됩니다.

지도 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); 

어떤 도움이나 조언이 많이 주시면 감사하겠습니다 :

다음은 내가 주소를 지오 코딩을 사용하고 기본 스크립트입니다.

답변

0

예, 결과 개체는 둘 이상의 위치를 ​​반환합니다. 결과의 모든 객체를 반복합니다.

+0

내가 무슨 뜻인지 알 것 같아. –