모달 부트 스트랩으로 googlemap을로드해야합니다. 그러나 정상적으로로드해야하고 콘솔에로드되는지도가 표시되지만 요소 검사가 표시됩니다. 내지도에 사용되는 이미지Google지도가 부트 스트랩 모달로로드되지 않습니다.
코드처럼 빈지도를로드해야하는 요소는, 난 그냥 모달 외부의지도를 만들려고,
var map;
var drawingManager;
var selectedShape;
function initializeMap() {
var mapOptions = {
center : new google.maps.LatLng(-16.4237766667, -71.54262),
zoom : 15,
mapTypeId : google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("mapCanvas"),
mapOptions);
console.debug(map);
}
$(document).ready(
function() {
initializeMap();
$('#createleaf').click(function() {
$('#modalFence').modal('show');
});
$('#modalFence').on('shown',function(event) {
//console.debug(map);
google.maps.event.trigger(map, "resize");
map.setZoom(map.getZoom());
var modal = $(this);
modal.css('margin-top',(modal.outerHeight()/2) * -1)
.css('margin-left',(modal.outerWidth()/2) * -1);
return this;
});
});
한 가지 더 나는 페이지에서 의미하고, 그것은 잘 실행된다, prob LEM 단지 내 전체 코드는
덕분에 난 그냥 오류를 발견 많은
더 많은 HTML 코드 삽입 또는 JSFiddle에서 재생 – PiLHA
http://pastebin.com에 내 전체 코드를 붙여 넣습니다./2qkMZ93a – Carlos
지도가 크기가 있습니까 (크기 조정 이벤트를 트리거 할 때)? – geocodezip