Pham-Vincent / Equitable-Water-Solutions

3 stars 0 forks source link

Sliding Past the Map #114

Closed Pham-Vincent closed 2 months ago

Pham-Vincent commented 3 months ago

image

We are able to go up and above the map for some reason

Set some type of restriction to stop this

Pham-Vincent commented 2 months ago

Added a Restriction to restrict how far the map can go

//Limits the Bounds Within this area var allowedBounds = new google.maps.LatLngBounds( new google.maps.LatLng(-60, -180),// Southwest corner (60 degrees south, entire western hemisphere) new google.maps.LatLng(85, 180) // Northeast corner (North Pole, entire eastern hemisphere) ); restriction: { latLngBounds: allowedBounds,// Gives the Maps Boundaries strictBounds: false // Set to true if you want to completely restrict panning }