저는 js에별로 좋지는 않지만 웹 사이트에서 Bing지도를 사용하려하지만지도를 거의 보여주지 않으며 대부분지도를 표시하지 않습니다. 다음은로드 맵 함수의 코드는, 누군가가 나이 기능에 무슨 잘못 알려 주시기 바랍니다 수 있습니다, 나는 다른 응용 프로그램에서이를 사용하고 있습니다 :bing지도 창 크기를 조정 한 후에 만로드
function loadMap(storeData) {
var coordinates = {};
var map;
var stores = storeData.stores;
if((typeof stores !== 'undefined') && (typeof stores[0].coordinates !== 'undefined')) {
coordinates.lat = stores[0].coordinates.lat;
coordinates.lng = stores[0].coordinates.lng;
}else {
coordinates.lat = 33.74831008911133;
coordinates.lng = -84.39111328125;
}
map = new Microsoft.Maps.Map($('#bingMap')[0], {
credentials: 'mykey',
liteMode: true,
enableClickableLogo: false,
center: new Microsoft.Maps.Location(coordinates.lat, coordinates.lng)
});
self.center = new Microsoft.Maps.Location(coordinates.lat, coordinates.lng);
map.setView({zoom: 13});
return map;
}
나는 다른 유래 쿼리에서 가져온 몇 단계 만 아래 시도 이 문제는 당신 setTimeout
전화에
setTimeout(this.loadMap(storeData), 2000); Microsoft.Maps.Events.addHandler(map,'resize')
'에서는 setTimeout (this.loadMap.bind (이), 2000, storeData) ; ' – Sysix
이 작업은되었지만 이제는 핀이 사라지고 있습니다.이 함수를 호출하는 순서가 잘못되었습니다. this.bingMap = this.loadMap (storeData); this.loadPins (this.bingMap, storeData, true); setTimeout (this.loadMap.bind (this), 2000, storeData); – Sam