빌딩 등급에 맞는 주소가 포함 된 데이터베이스가 있습니다. Google지도의 검색에 수동으로 입력하면 Google지도에서 문제가없는 것으로 확인합니다. 올바른 건물 바로 위에 표시됩니다. 그러나 아래 코드를 사용하여 동일한 주소를 Google Maps API 지오 코더에 전달하면 마커는 건물이 아닌 거리에만 표시됩니다.Google지도 지오 코더가 Google지도만큼 정확하지 않습니다.
정확도를 높이려면 어떻게해야합니까?
HTML/PHP :
<div id="addressline"><?php echo theaddress(); ?></div>
JS :
function myGeocodeFirst() {
geocoder = new google.maps.Geocoder();
geocoder.geocode({'address': document.getElementById("addressline").innerHTML},
function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
firstLoc = results[0].geometry.location;
map = new google.maps.Map(document.getElementById("map_canvas"),
{
center: firstLoc,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
markers = new google.maps.Marker({
position: firstLoc,
map: map,
});
}
else {
document.getElementById("text_status").value = status;
}
}
);
}
window.onload=myGeocodeFirst;
올바른 위치가 이미있는 경우 왜 지오 코더를 사용하고 있습니까? Google지도에서보고하는 위치가 지오 코더가 아닌 지역 정보 데이터베이스의 항목이 아닙니까? 예제를 제공 할 수 있습니까? – geocodezip
나는 위도/경도가 없으며 양식의 주소는 123 Road, City, P05T C0D3 – user1444027
문제를 보여주는 주소가 있습니까? – geocodezip