Google Map API - Directions Service does not auto zoom when the map in a modal
问题 I have the following function to show direction between 2 lats and lngs to user $(document).ready(function(){ initialize_direction(); }); function initialize_direction() { var directionDisplay; var directionsService = new google.maps.DirectionsService(); var direction_map; directionDisplay = new google.maps.DirectionsRenderer(); var myOptions = { mapTypeId: google.maps.MapTypeId.ROADMAP, } direction_map = new google.maps.Map(document.getElementById("direction_canvas"), myOptions);