Google map not loading inside modal. But it is loading without modal. I am using laravel in my project.
This is what I have done. This solution from here itself. but not working for me.
<script>
$(document).ready(function(){
$('#exampleModal').on('shown.bs.modal',function(){
google.maps.event.trigger(map, "resize");
});
});
</script>
This is my modal. id of modal is exampleModal.
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Search your location</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<!--<iframe src="{{url('geocode')}}">Your browser isn't compatible</iframe>-->
<!--map-->
<div style="display: none">
<input id="pac-input" class="controls" type="text" placeholder="Enter a location"/>
</div>
<div id="map"></div>
<div id="infowindow-content">
<span id="place-name" class="title"></span><br />
<strong>Latitude </strong>: <span id="place-id"></span><br />
<strong>Longitude </strong>: <span id="place-address"></span>
</div>
<!--endmap-->
</div>
</div>
</div>
</div>