'+
'
'+
'title here
'+
''+
'description here
'+
''+
'
description here
'+ '我想在模态弹出窗口中显示谷歌地图,但它似乎没有出现.需要帮忙.
这是HTML -
JS -
function initialize() { var myloc = new google.maps.LatLng(-34.397, 150.644); var mapOptions = { zoom: 17, center: myloc, scrollwheel: false }; var map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions); var marker = new google.maps.Marker({ position: map.getCenter(), map: map, animation: google.maps.Animation.BOUNCE }); var contentString = ''+ ''; var infowindow = new google.maps.InfoWindow({ content: contentString, maxWidth: 250 }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); } google.maps.event.addDomListener(window, 'load', initialize);'+ ''+ '
title here
'+ ''+ ''+ 'description here
'+ '
这是弹出预览图像 - 图像预览
你应该使用resize
on modal来刷新你的地图:
$('modal-id').on('shown.bs.modal', function () { google.maps.event.trigger(map, "resize"); });
希望这可以帮助.