Using the latest version of Google maps. How to add markers using longitude and latitude and automatically adjust the zoom level of the map to include all the markers using JavaScript?
Javascript – Automatically adjust zoom to accommodate all marker in a google map
google mapsgoogle-maps-api-3google-maps-markersjavascript
Related Topic
- Javascript – Convert form data to JavaScript object with jQuery
- Javascript – What does “use strict” do in JavaScript, and what is the reasoning behind it
- Javascript – Google Maps API v3: How to remove all markers
- Javascript – Google Map API v3 — set bounds and center
- Jquery – How to disable mouse scroll wheel scaling with Google Maps API
- Javascript – Google Maps JS API v3 – Simple Multiple Marker Example
- Android map v2 zoom to show all the markers
- RoR – Removing comma
Best Answer
Google Maps API v3 provides a
LatLngBounds
object to which you can add multipleLatLng
objects. You can then pass this toMap.fitBounds()
function as described here:Partial Example