How do I make a map center on the client’s current location, but default to the LatLng below if the current location can’t be determined.
var myOptions = {
center: new google.maps.LatLng(12.659493, 79.415412),
zoom: 12,
scrollwheel: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
You can use the HTML 5 Geolocation functions for this purpose. It’s close but not super precise.
Demo