In an application I'm building, the Google Maps API takes up most (if not all) of the screen. However, during testing I've discovered that a user can drag the map down far enough so that the map isn't displayed anymore, and all thats left is a grey background.
How can I stop this? I have set a minZoom but this only solves the problem for when the page is loaded and the user wants to zoom out.
new solution
new google.maps.Map(document.getElementById('map'), {
restriction: {
latLngBounds: {
north: 85,
south: -85,
west: -180,
east: 180
}
},
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With