我需要知道如何将所有标记居中并自动缩放地图以使其适合我在以下地图中的所有内容.我几天就打破了头来解决问题,请帮助我.
我的代码
<script type="text/javascript">
var map;
var address = new Array();
//we can also create following array with a for loop
address[0] = '798 9th Ave, New York, NY';
address[1] = '42 E 29th St, New York, NY';
address[2] = '56 W 25th St, New York, NY';
address[3] = '26 W 21th St, New York, NY';
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {zoom: 15, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP}
map = …Run Code Online (Sandbox Code Playgroud)