2012-02-23 4 views
0

안녕하세요. 여기에 잘못된 모양이 있습니다.이 페이지에서지도를 클릭하고 드래그하여 이동할 때. 포인터를 업데이트하는 함수가 호출되지만 문제는 마우스에서지도를 놓을 수 없다는 것입니다.Google지도에서 패닝 할 때지도를 공개 할 수 없습니다.

http://demo.fltdata.com/airport/antonio-b-won-pat-international-airport/5433

패닝을 처리하기위한 코드는 다음과 같습니다

업데이트는지도의 경계에 따라 포인터를 검색하는 기능이
mapp.prototype.initialise = function(){ 
    this.map = new google.maps.Map(this.id, this.options); 
    xmap = this.map; 

    tm = this; 
    //this.update(); 

    if(this.updateUrl != ''){ 
    google.maps.event.addListener(xmap, 'zoom_changed', function(event){ 
     tm.update(); 
    }); 

    google.maps.event.addListener(xmap, 'bounds_changed', function(event){ 
     tm.update(); 
    }); 

    google.maps.event.addListenerOnce(xmap, 'tilesloaded', function(){ 
     tm.update(); 
    }); 
    } 
} 

.

답변

0

큰 Google지도 develoepr이 아니지만 유휴 이벤트가 발생한 후에 만 ​​업데이트를 시도 할 수 있습니다.

zoom_changed, bounds_changed 또는 tiles_loaded라는 사실을 캡처 한 다음 유휴 상태가되어 실제로 업데이트를 수행합니다. 다음은 페이지의 마커를 업데이트하는 데 사용하는 코드입니다.

var boundsChanged = false; 

function setupBoundsListener(map) { 
    google.maps.event.addListener(map, "bounds_changed", function() { 
    boundsChanged = true; 
    }); 
} 


function setupIdleListener(map) { 
    google.maps.event.addListener(map, "idle", function() { 
     if (boundsChanged) { 
      clearMarkers(map); 
      populateMarkers(map); 
      resetBoundsChanged(); 
     } 
    }); 
} 
관련 문제