모두 좋음을 바랍니다.빙지도, 여러 지오 코드 검색 결과 찾기 (의미 : 기능)
버전 7.0을 사용 중입니다.
오늘 아침 나는 다소 단순해야한다고 생각했던 것 때문에 고생했습니다. Store Locator 시나리오에서 대체 검색 결과를 제공합니다. (그냥 여기처럼 - http://www.bing.com/maps)
그래서 같이 빙지도 나머지 서비스에 지오 요청합니다
이 모든 위대한 작품! 내 함수에 반환 된 결과를 캡처하여 일치하는 지오 코드가있는 쿼리를 사용자가 입력하는 한 올바르게 파싱 할 수 있습니다.
function GeocodeCallbackSearch(result) {
try
{
alert(result.resourceSets[0].resources.length);
// When the user searches an address that isn't quite right, I notice that the
// Length of the result set is greater then 1.
// I would like to get at these so I can provide the "Did you Know"
// functionality.
// This is where I am having problems accessing the other results
for (var i =0; i < result.resourceSets[0].resources.length;i++)
{
alert (result.resourceSets[i].resources[i].name);
}
}
catch(err){
alert(err.message)
}
오류 : 나는 점점 result.resourceSets을 유지 [I] .resources [I] .name을이 정의되지 않습니다.
길이가 때때로 1보다 길기 때문에 거기에 묻혀 있다는 것을 알고 있습니다! result.resourceSets [0] .resources.length는 반환되는 지오 코드 결과의 개수입니까?
고맙습니다.