[Solved] setCenter with array values – Google Maps API
From the documentation. google.maps.Map.setCenter takes a google.maps.LatLng or a LatLngLiteral as an argument. This should work: <li><a onclick=”map.setCenter(new google.maps.LatLng(cityList[0][1], cityList[0][2])); return false”><script>document.write(cityList[0][0]);</script> </a></li> working code snippet: var map; var cityList = [ [‘Atlanta, GA’, 33.840644, -84.238972, 1, “text 0”], [‘Austin, TX’, 30.402887, -97.721606, 2, “text 1”], [‘Boston, MA’, 42.364247, -71.078575, 3, “text 2”], [‘Chicago, IL’, … Read more