1
SetCenter 기능을 작동 시키려고 시도했지만 작동하지 않습니다. 여기 Google지도 SetCenter 기능이 작동하지 않습니다.
코드입니다 :$("#searchclick").click(function(){
var address = document.getElementById('searchbar').value;
var geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latitude2 = results[0].geometry.location.lat();
var longitude2 = results[0].geometry.location.lng();
var relocate = ("(" + latitude2 + ", " + longitude2 + ")");
alert("setting the center to: " + relocate);
map.setCenter(relocate);
} //when status is OK
}); // geocode
});
경고가 제대로 반환 다음 setting the center to: (40.7143528, -74.0059731)
하지만이지도의 올바른 지점의 중심을하지 ...
어떤 아이디어 왜 ?