function restrictMap(map) {
		var bounds = new H.geo.Rect(
			30.397704598324953,
			-97.82197149621298,
			30.202843286012932,
			-97.69906076638804
		);
		map.getViewModel().addEventListener('sync', function () {
			var center = map.getCenter();

			if (!bounds.containsPoint(center)) {
				if (center.lat > bounds.getTop()) {
					center.lat = bounds.getTop();
				} else if (center.lat < bounds.getBottom()) {
					center.lat = bounds.getBottom();
				}
				if (center.lng < bounds.getLeft()) {
					center.lng = bounds.getLeft();
				} else if (center.lng > bounds.getRight()) {
					center.lng = bounds.getRight();
				}
				map.setCenter(center);
			}
		});
	}
// Function to restrict the map view to a designated area
Function to restrict the map view to a designated area
Function to restrict the map view to a designated area
function restrictMap(map) {
		var bounds = new H.geo.Rect(
			30.397704598324953,
			-97.82197149621298,
			30.202843286012932,
			-97.69906076638804
		);
		map.getViewModel().addEventListener('sync', function () {
			var center = map.getCenter();
			if (!bounds.containsPoint(center)) {
				if (center.lat > bounds.getTop()) {
					center.lat = bounds.getTop();
				} else if (center.lat < bounds.getBottom()) {
					center.lat = bounds.getBottom();
				}
				if (center.lng < bounds.getLeft()) {
					center.lng = bounds.getLeft();
				} else if (center.lng > bounds.getRight()) {
					center.lng = bounds.getRight();
				}
				map.setCenter(center);
			}
		});
	}
function restrictMap ( map ) { var bounds = new H . geo . Rect ( 30.397704598324953 , - 97.82197149621298 , 30.202843286012932 , - 97.69906076638804 ) ; map . getViewModel ( ) . addEventListener ( 'sync' , function ( ) { var center = map . getCenter ( ) ; if ( ! bounds . containsPoint ( center ) ) { if ( center . lat > bounds . getTop ( ) ) { center . lat = bounds . getTop ( ) ; } else if ( center . lat < bounds . getBottom ( ) ) { center . lat = bounds . getBottom ( ) ; } if ( center . lng < bounds . getLeft ( ) ) { center . lng = bounds . getLeft ( ) ; } else if ( center . lng > bounds . getRight ( ) ) { center . lng = bounds . getRight ( ) ; } map . setCenter ( center ) ; } } ) ; }
Function to restrict the map view to a designated area
Function to restrict the map view to a designated area