1
Google지도 V3에서 작업 중입니다. Google지도에서 파키스탄 만 표시하고 다른지도는 완전히 숨기고 싶은 것처럼 Google지도의 특정 부분을 가져오고 싶습니다.Google지도 특정 부분
Google지도 V3에서 작업 중입니다. Google지도에서 파키스탄 만 표시하고 다른지도는 완전히 숨기고 싶은 것처럼 Google지도의 특정 부분을 가져오고 싶습니다.Google지도 특정 부분
당신은 아마 완전히 다른 맵 부분을 숨길 수 있지만 사용자가 어떤을 스크롤 할 수 있도록 정의 된 점
google.maps.event.addListener(map,'center_changed',function() { checkBounds(); });
function checkBounds() {
if(! allowedBounds.contains(map.getCenter())) {
var C = map.getCenter();
var X = C.lng();
var Y = C.lat();
var AmaxX = allowedBounds.getNorthEast().lng();
var AmaxY = allowedBounds.getNorthEast().lat();
var AminX = allowedBounds.getSouthWest().lng();
var AminY = allowedBounds.getSouthWest().lat();
if (X < AminX) {X = AminX;}
if (X > AmaxX) {X = AmaxX;}
if (Y < AminY) {Y = AminY;}
if (Y > AmaxY) {Y = AmaxY;}
map.setCenter(new google.maps.LatLng(Y,X));
}
}
보다 더 맵에 경계를 설정할 수 있습니다