Click here to Skip to main content
15,851,510 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
function initialize() {
    var mapOptions = {
        zoom: 6,
        center: new google.maps.LatLng(30.893379000000000000, 60.028060900000010000),
    var coord;
    var map = new google.maps.Map(document.getElementById('map-canvas'),
google.maps.event.addDomListener(window, 'load', initialize);

1 solution

It seems to me that the simplest solution would be to check for if the latitude or longitude coordinates have exceeded the boundaries you wish to set, then set the latitude or longitude to the outermost coordinate. For example, if latitude > 40, then set latitude to 40 as to prevent the user from continuing onward.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900