Center markers google maps


Jan 25, 2018 · If you display a Google Map on your site using the Google JS API, here is how you can have it auto-centered and auto-zoomed depending on the markers it contains. Before adding markers: bounds = new google.maps.LatLngBounds(); Nov 07, 2019 · // Draw a line showing the straight distance between the markers var line = new google.maps.Polyline({path: [dakota, frick], map: map}); Reload the map and you should see a dark, diagonal line connecting the two markers, from one side of Central Park to the other. Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.